|
1 |
| -# Syncromesh |
| 1 | +# Synchromesh  |
2 | 2 |
|
3 |
| -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/syncromesh`. To experiment with that code, run `bin/console` for an interactive prompt. |
| 3 | +Synchromesh provides multi-client synchronization for [reactive-record](https://github.com/catprintlabs/reactive-record) |
4 | 4 |
|
5 |
| -TODO: Delete this and the text above, and describe your gem |
| 5 | +In otherwords browser 1 creates, updates, or destroys a model, and the changes are broadcast to all other clients. |
| 6 | + |
| 7 | +Add the gem, setup the configuration, and synchromesh does the rest. |
| 8 | + |
| 9 | +## Transports |
| 10 | + |
| 11 | +Currently there are two transport mechanisms: |
| 12 | + |
| 13 | ++ [Pusher](http://pusher.com) which gives you zero config websockets. |
| 14 | ++ Short cycle polling (for development) |
| 15 | + |
| 16 | +As soon as Opal is working on Rails 5, we will add ActionCable. |
| 17 | + |
| 18 | +Also near term we will have a simple mechanism to plug in your own transport. |
| 19 | + |
| 20 | +## Security [NOT IMPLEMENTED YET] |
| 21 | + |
| 22 | +Synchromesh builds on top of ReactiveRecord's model-based permission mechanism: |
| 23 | + |
| 24 | +Each *user* gets a private transport channel. Before broadcasting an update to a users channel Synchromesh filters the data based on that users permissions. |
6 | 25 |
|
7 | 26 | ## Installation
|
8 | 27 |
|
9 | 28 | Add this line to your application's Gemfile:
|
10 | 29 |
|
11 | 30 | ```ruby
|
12 |
| -gem 'syncromesh' |
| 31 | +gem 'synchromesh' |
13 | 32 | ```
|
14 | 33 |
|
15 | 34 | And then execute:
|
16 | 35 |
|
17 |
| - $ bundle |
| 36 | + $ bundle install |
18 | 37 |
|
19 |
| -Or install it yourself as: |
| 38 | +Also you must `require 'synchromesh'` from your client side code. The easiest way is to |
| 39 | +find the `require 'reactive-record'` line (typically in `components.rb`) and add `require 'synchromesh'` directly below it. |
20 | 40 |
|
21 |
| - $ gem install syncromesh |
| 41 | +## Configuration |
22 | 42 |
|
23 |
| -## Usage |
| 43 | +Add an initializer like this: |
24 | 44 |
|
25 |
| -TODO: Write usage instructions here |
| 45 | +```ruby |
| 46 | +# for rails this would go in: config/initializers/synchromesh.rb |
| 47 | +Synchromesh.configuration do |config| |
26 | 48 |
|
27 |
| -## Development |
| 49 | + config.transport = :pusher # set to :none to turn off, or to :simple_poller (see below) |
| 50 | + |
| 51 | + config.app_id = '2xxxx2' |
| 52 | + config.key = 'dxxxxxxxxxxxxxxxxxx9' |
| 53 | + config.secret = '2xxxxxxxxxxxxxxxxxx2' |
| 54 | + config.channel_prefix = 'synchromesh' # this can be any string |
| 55 | + |
| 56 | + # config.client_logging = false # default is true |
28 | 57 |
|
29 |
| -After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. |
| 58 | + # simple_poller - good for debug or while developing on a plane... does NOT use long polling, so is not |
| 59 | + # workable for production |
30 | 60 |
|
31 |
| -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). |
| 61 | + # config.transport = :simple_poller |
| 62 | + # config.seconds_between_poll = 5 # default is 0.5 |
| 63 | + # config.seconds_polled_data_will_be_retained = 1.hour # clears channel data after this time, default is 5 minutes, |
| 64 | + |
| 65 | +end |
| 66 | +``` |
| 67 | + |
| 68 | +## Development |
| 69 | + |
| 70 | +TBD |
32 | 71 |
|
33 | 72 | ## Contributing
|
34 | 73 |
|
35 |
| -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/syncromesh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. |
| 74 | +Bug reports and pull requests are welcome on GitHub at https://github.com/reactive-ruby/synchromesh. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct. |
36 | 75 |
|
37 | 76 |
|
38 | 77 | ## License
|
39 | 78 |
|
40 | 79 | The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41 |
| - |
|
0 commit comments