ramen-rails 0.1.3 → 0.2.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: 706da20850a8bebcdf95441f5e73f4ca4546b6c7
4
- data.tar.gz: cca46da4375726990fb1baf95a45d5dc71110945
3
+ metadata.gz: 938ed07e07491d1f7823571471a88e0a373dd34e
4
+ data.tar.gz: 6c8dd0a2b1f1af76ff0ea56650322cc3542d88b3
5
5
  SHA512:
6
- metadata.gz: 49560685a591a02637696f2b0c4894aa03b944cadc691b471bd51df951e91cc711ce44f63445c437c821a7a7079f9e1aacc8373f5c8de600b4a991d8ea536c1e
7
- data.tar.gz: 077640a1b609ee7e7eb440d7d719ff987ee0a93533c27bfd3734174c9b8350cae9c6397991c682a3e09bc946a99c9c102f5e24debffe55dff3c3b734fd6c8c3e
6
+ metadata.gz: 637a2e1e2da0a1f5d6820b4d0c9743570ec950b7fabf55ad347eada81da5df24e89473622f6b8450c732a91c09579e177a8e1aa44809bf2a0104914ff2df9e23
7
+ data.tar.gz: 76591af04bd28c872dd6e18cddfde6e72a10debd9780cc5884e62d35d3484041d2b3069c17a4d71cd548457d62dfce4fb8b6b9ce7a6af03db3650e36be3f897f
@@ -4,6 +4,10 @@ module RamenRails
4
4
  def add_ramen_script_tag
5
5
  RamenAfterFilter.filter(self)
6
6
  end
7
+
8
+ def ramen_script_tag_options
9
+ @ramen_script_tag_options || {}
10
+ end
7
11
  end
8
12
 
9
13
  class RamenAfterFilter
@@ -26,6 +30,10 @@ module RamenRails
26
30
  @controller = kontroller
27
31
  end
28
32
 
33
+ def ramen_script_tag_options
34
+ controller.ramen_script_tag_options
35
+ end
36
+
29
37
  def include_javascript!
30
38
  response.body = response.body.gsub(CLOSING_BODY_TAG, ramen_script_tag + '\\0')
31
39
  end
@@ -165,6 +173,9 @@ module RamenRails
165
173
  obj[:user][:labels] = ramen_user_labels unless ramen_user_labels.nil?
166
174
  obj[:custom_links] = ramen_custom_links if ramen_custom_links.present?
167
175
 
176
+
177
+ obj = obj.deep_merge(ramen_script_tag_options) if ramen_script_tag_options.present?
178
+
168
179
  super(obj, organization_secret: ramen_org_secret)
169
180
 
170
181
  rescue InvalidUserObject => e
@@ -1,3 +1,3 @@
1
1
  module RamenRails
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -77,6 +77,20 @@ describe 'After filter' do
77
77
  end
78
78
  end
79
79
 
80
+ context "and ramen_script_tag_options" do
81
+ before :each do |c|
82
+ @dummy.ramen_script_tag_options = {survey_id: 'survey_ryan'}
83
+ end
84
+
85
+ it "should include value in output" do
86
+ filter = RamenRails::RamenAfterFilter.filter(@dummy)
87
+
88
+ expect(@dummy.response.body).to include("survey_ryan")
89
+ expect(@dummy.response.body).to include("survey_id")
90
+ end
91
+ end
92
+
93
+
80
94
  it "should include value in output" do
81
95
  filter = RamenRails::RamenAfterFilter.filter(@dummy)
82
96
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramen-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Angilly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack