foreign_office 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d142bf9d30488d84689f0d71ff4346b4dc65c6e7
4
- data.tar.gz: 82305b9d0ce078aa7a8154ecdc26ed9dc46aac91
3
+ metadata.gz: 55270150e750fa6f209103448c796f3b34f8a762
4
+ data.tar.gz: 660fa594f55b965d17b480a021a32befe632ef33
5
5
  SHA512:
6
- metadata.gz: e942557985b5ae99d0f771dc9e185f964cc80aef4bf44feaa280ea6775eb149a67a8dafafbe260828ac8c4bc2f1827a60bafd6dff260b4a2d881765aee3693e6
7
- data.tar.gz: d973591ef364e2278004b3cbe88e831d33cb7e9a0e63a634b5b8244fa01299a21f43b600d695c2f23436cf942f8086d7da8991340b98dc54b66f7255288f4a81
6
+ metadata.gz: 1a50cf24779141b53d93f9d3ac96c40f006e4e3720d497e0c765e89364f17f9eb9c47299160e8990ea9d0cc512c3456ef69081ece4e212fe90a4d3cf9df28e51
7
+ data.tar.gz: afb139d91e662406f4755090e8b408e003f8beb45f5a8b477db756c3c58f38d47e0abcdd3ff18ecdaa08619ac8e3a32bb0ee79079819d3fa99153cf3906d2ddb
@@ -1,3 +1,4 @@
1
+ require 'foreign_office/railtie' if defined?(Rails)
1
2
  require 'request_store'
2
3
  module ForeignOffice
3
4
 
@@ -0,0 +1,15 @@
1
+ module ForeignOffice
2
+ module ForeignOfficeHelper
3
+ def listener_attrs(resource, key, subtype: nil)
4
+ data_attrs = "data-listener=true data-channel=#{resource.class.name}#{resource.id} data-key=#{key}"
5
+ data_attrs += " data-sub-type=#{subtype}" if subtype
6
+ data_attrs
7
+ end
8
+
9
+ def listener_attrs_raw(channel, key, subtype: nil)
10
+ data_attrs = "data-listener=true data-channel=#{channel} data-key=#{key}"
11
+ data_attrs += " data-sub-type=#{subtype}" if subtype
12
+ data_attrs
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ require 'foreign_office/foreign_office_helper'
2
+ module ForeignOffice
3
+ class Railtie < Rails::Railtie
4
+ initializer "foreign_office.foreign_office_helper" do
5
+ ActionView::Base.send :include, ForeignOfficeHelper
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module ForeignOffice
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -9,3 +9,14 @@ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another te
9
9
  ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
10
10
  ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
11
11
  ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
12
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
13
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
14
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
15
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
16
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
17
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
18
+ ForeignOffice#publish! attempt: 1 message: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
19
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
20
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is another test"}}
21
+ ForeignOffice.publish: {:channel=>"TestMe", :object=>{:this=>"is a test"}}
22
+ ForeignOffice.publish: {:channel=>"TestMeAgain", :object=>{:this=>"is another test"}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreign_office
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-21 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -88,6 +88,8 @@ files:
88
88
  - lib/foreign_office/busses/generic_bus.rb
89
89
  - lib/foreign_office/busses/pubnub_bus.rb
90
90
  - lib/foreign_office/busses/pusher_bus.rb
91
+ - lib/foreign_office/foreign_office_helper.rb
92
+ - lib/foreign_office/railtie.rb
91
93
  - lib/foreign_office/test/client_exec.rb
92
94
  - lib/foreign_office/test/fake_foreign_office.rb
93
95
  - lib/foreign_office/version.rb