jibe 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -10
  3. data/lib/jibe/version.rb +1 -1
  4. data/lib/jibe.rb +0 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33888929add103943b15a2826aeb54e53113b58b
4
- data.tar.gz: 99057dfff580047555b6776d36c4d93de035434f
3
+ metadata.gz: 1934e5d8e1c100412827dd32a8028beeafd68f4d
4
+ data.tar.gz: ca820173bb5bcf6d1e108165185fc4fd628036d7
5
5
  SHA512:
6
- metadata.gz: db9c4f3ac7c1ec8f304865ebb0c604cef73f73cc99b58f2373c9c182477b129cd71288196328c504262b9fa81a75b6b127e643e348afca2f8af5afcc47dd5961
7
- data.tar.gz: 33bfc22a589cf5875294df37475b38972a3e94ab94d8b68b2e5cd9adcfef218e812a4b2195cd7d1e5d09efedf5056ef4c13b86b7f34db9b70cd2083702afc879
6
+ metadata.gz: e6862898be25bd60e735de6aaa75d495a174972a87038ea25c8a7d243ec2de6bd15da7bc29207d9ad87482ea58820fa67323be63a4d1b9df21c090ffc877e4b1
7
+ data.tar.gz: 6ba56ba5725a7d1f352749d7e31be75e451672498122572d6d4a3d139109dcb29729e6cd1cc0df6b140b45ddd69eb636ba7797eb1f014888a7c8b1ea1dd3faf5
data/README.md CHANGED
@@ -1,28 +1,66 @@
1
1
  # Jibe
2
2
 
3
- TODO: Write a gem description
3
+ Jibe keeps simple data 'n sync with very little setup. For now, it relies on Pusher.
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ First, Add `gem 'jibe'` to your application's Gemfile and `bundle`.
8
8
 
9
- gem 'jibe'
9
+ Then, [Set up Pusher.](https://github.com/pusher/pusher-gem) You'll also need to throw your pusher key into a meta tag named `pusher-key`.
10
10
 
11
- And then execute:
11
+ Add `//= require jibe` to your `application.js` file.
12
12
 
13
- $ bundle
13
+ Add `jibe` to your model.
14
14
 
15
- Or install it yourself as:
15
+ ```
16
+ class Comment < ActiveRecord::Base
17
+ jibe
18
+ end
19
+ ```
16
20
 
17
- $ gem install jibe
21
+ Replace a collection render call:
18
22
 
19
- ## Usage
23
+ ```
24
+ <table>
25
+ <%= render @comments %>
26
+ </table>
27
+ ```
20
28
 
21
- TODO: Write usage instructions here
29
+ with:
30
+
31
+ ```
32
+ <table>
33
+ <%= jibe @comments %>
34
+ </table>
35
+ ```
36
+
37
+ Now, all those `@comments` will stay in sync. At this point, its probably worth adding `remote: true` to your forms.
38
+
39
+ ## Options
40
+
41
+ ```
42
+ <%=
43
+ jibe @comments,
44
+ strategy: "prepend", # by default, new tasks are appended
45
+ scope: "completed", # useful in conjunction with JS callbacks
46
+ restrict_to: [@folder, current_user] # limit access
47
+ %>
48
+ ```
49
+
50
+ You can hijack the `beforeCreate`, `afterCreate`, `beforeUpdate`, `afterUpdate`, `beforeDestroy`, `afterDestroy` events. This is helpful for transitions.
51
+
52
+ ```
53
+ Jibe.events["comments"] =
54
+ beforeCreate: (partial, data, scope) ->
55
+ # partial = the DOM node
56
+ # data = the model's attributes (override with jibe_data method in your model)
57
+ # scope = an optional scope based on the jibe tag in your view
58
+
59
+ ```
22
60
 
23
61
  ## Contributing
24
62
 
25
- 1. Fork it ( https://github.com/[my-github-username]/jibe/fork )
63
+ 1. Fork it ( https://github.com/dallasread/jibe/fork )
26
64
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
65
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
66
  4. Push to the branch (`git push origin my-new-feature`)
data/lib/jibe/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jibe
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/jibe.rb CHANGED
@@ -34,7 +34,6 @@ module Jibe
34
34
  Pusher["Jibe"].trigger("event", {
35
35
  action_name: action_name,
36
36
  action_capitalized: action_name.capitalize,
37
- folder_id: folder_id,
38
37
  id: id,
39
38
  collection: self.class.name.downcase.pluralize,
40
39
  model: model,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jibe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dallas Read