https://github.com/jnunemaker/ag
Nothing serious or finished, just playing with events, feeds, activities, timelines, wooooooooooo
https://github.com/jnunemaker/ag
Last synced: about 1 year ago
JSON representation
Nothing serious or finished, just playing with events, feeds, activities, timelines, wooooooooooo
- Host: GitHub
- URL: https://github.com/jnunemaker/ag
- Owner: jnunemaker
- License: mit
- Created: 2015-02-15T15:58:56.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2018-12-06T01:10:07.000Z (over 7 years ago)
- Last Synced: 2025-03-31T12:04:46.538Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 46.9 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Ag
WORK IN PROGRESS...
Experiments in describing feeds/timelines of events in code based on adapters so things can work at most levels of throughput.
## Installation
Add this line to your application's Gemfile:
```ruby
gem "ag"
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install ag
## Usage
```ruby
require "ag"
adapter = Ag::Adapters::Memory.new
client = Ag::Client.new(adapter)
john = Ag::Object.new("User", "1")
steve = Ag::Object.new("User", "2")
presentation = Ag::Object.new("Presentation", "1")
event = Ag::Event.new({
producer: steve,
object: presentation,
verb: "upload_presentation",
})
# connect john to steve
pp connect: client.connect(john, steve)
# is john connected to steve
pp connected?: client.connected?(john, steve)
# consumers of steve
pp consumers: client.consumers(steve)
# producers john is connected to
pp producers: client.producers(john)
# produce an event for steve
pp produce: client.produce(event)
# get the timeline of events for john based on the producers john follows
pp timeline: client.timeline(john)
```
## Contributing
1. Fork it ( https://github.com/jnunemaker/ag/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request