• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 15 years ago
  • Updated over 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A rails plugin that allows you to create extensible log of activity

Pfeed

You need Pfeed when you want to automagically create fancy logs / activity updates in your rails app, asynchronously.

What's so magical here?

Lets assume you have a model that looks like


 class User < ActiveRecord::Base
   has_many :friends
   has_one  :company
   def buy(x)
    ...
   end

   def sell(x)
    ...
   end
  
   def find_friends
    ...
   end  
 end

Now lets add two lines at bottom of model definition


 emits_pfeeds :on => [:buy,:sell,:find_friends,:update_attribute] , :for => [:itself , :friends]   # Note: if feed needs to be received by all users , you could use :for => [:all_in_its_class]
 receives_pfeed

And you perform regular operations, like this


 u1 = User.first
 u1.buy(10)
 u1.sell(5)
 u2 = User.last
 list = u2.find_friends
 u2.update_attribute(:nick_name, "alice")
 u2.buy (1)

your application now emits feed without any other additional piece of code, and feed will look like this in view.

 parolkar sold item about 6 minutes ago
 parolkar bought item about 4 minutes ago
 foo found friends about 2 minutes ago
 foo updated attribute nick name about 2 minutes ago
 alice bought item about 2 minutes ago

Isn't it magical? that it guesses the identity of model object (parolkar or foo in this case) and methods being called are treated as verbs to form a simple past tense.

Even more, each feed can be customized and skinned the way you want. You can easily extend the functionality to suit your requirements.

If all this excites you, check out the tutorials here or explore some more advanced techniques here

Performance

How efficient is feed generation and delivery?

If your app has mechanisms for asynchronous processing, like delayed_job , pfeed plugin will automatically figure out how to schedule the delivery in the queue so that your request loop remains efficient and workers can perform deliveries. Find out more

More Details

What is feed? Feed is the collection of activity logs which is generated while you perform actions on model objects.

Whats so special?, Why should I bother about it?

Imagine you want to create admin console for your app to monitor functional activities in your web apps ,i.e how users are using different parts of application. You will need to think of mechanism to capture the logs and then display in some logical manner.

OR

Imagine you are building an app like facebook and you want to capture all activity user is performing and display it to her friends/group member/admin , Its a whole new feature whose implementation will force you to dig into design of your app and see where all the logs get generated and then to whom all the logs are going to be published.

What if I give you a generalized information model which will allow you to create such feature by keeping it completely isolated from your existing logic? and What if it is really scalable enough?

(more content to come here...)

Installation

 
 $ rails plugin install git://github.com/parolkar/pfeed.git # or use script/plugin for older version of rails
 $ rake pfeed:setup 

Copyright (c) 2009 [Abhishek Parolkar] abhishek[at]parolkar.com , released under the MIT license

More Repositories

1

geo_mere_laal

Zero-effort creation of Location-aware Rails application based on W3C Geolocaton API.
HTML
117
star
2

deployment_pipeline

[Workflow] Deployment Pipeline - An opinionated continuous delivery workflow for Agile Teams
Ruby
49
star
3

active_log

Auto version control for your activerecord objects
Ruby
38
star
4

has_profile_items

A plugin to ease your effort of building profile of user, company, project, pet, group.... blah blah blah
Ruby
14
star
5

fluent-plugin-splunk

Splunk output plugin for Fluent event collector
Ruby
13
star
6

concerto

Computerized Adaptive Testing platform which combines R statistical engine
PHP
12
star
7

obey_robots_dot_txt

Easy to use extension of Net::HTTP to let you obey robots.txt while crawling/scrapping/mining
Ruby
11
star
8

why_sandbox

Mirror of _why's sandbox , which was heart of tryruby
Ruby
10
star
9

inflectionist

Complex linguistic processing on top of ActiveSupport's Inflections in form of a plugin
Ruby
10
star
10

fluent-plugin-http-enhanced

Enhanced HTTP input plugin for Fluent event collector
Ruby
9
star
11

smstrolley

A high performace framework for SMS based Ruby Applications with support for SMPP, SameSession & Push protocols and intelligent cost-model
Ruby
9
star
12

fluent-plugin-udp

This fluent input plugin allows you to collect incoming events over UDP
Ruby
7
star
13

mesos-babushka

babushka-deps to provision Apache Mesos
Ruby
6
star
14

watson4rails

A boilerplate Ruby On Rails app for IBM Watson's Dialog API
CSS
5
star
15

automated_sysadmin_screen_test

Automated SysAdmin Screen Test - write interview test in **Rspec** and provision a problem environment using **Puppet**
Puppet
5
star
16

local_news_radar

A rails plugin which gathers local news/tweets like a spider and make it available for you to query thru your existing model (Based on outside.in api)
Ruby
4
star
17

rails-app-skeleton

This is a quick skeleton with preconfigured environment for rspec, deployment (Vlad) , jrails (jquery drop-in replacement)
Ruby
3
star
18

brew_install_hadoop

Ruby
2
star
19

awesome-mesos

A curated list of awesome apache mesos resources, frameworks and other awesomeness.
2
star
20

rancho

Location based full text search plugin for rails app
Ruby
2
star
21

RubyConfLogo

This is logo proposal for RubyConfIndia 2010
1
star
22

imageloads

1
star
23

creative-design

Parolkar's design works released under Creative Commons
1
star
24

crorepati_uncle

CSV to QIF
1
star
25

momsmatter

Moms Matter Initiative's Open Source Code
Ruby
1
star