erector-rails4 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76617a89c514165596b405b26b4d478954e8d2f4
4
- data.tar.gz: 8918a4e0c6781101c4d5535af2dc8c9948c509c2
3
+ metadata.gz: c20bfa9a5097c2798f37dd76a0ad33755091cd02
4
+ data.tar.gz: 39ce033e53636ba5673f0311335751be5c9d7139
5
5
  SHA512:
6
- metadata.gz: 175007a5293001ebfba00e9fd7c80a2a89826a89b55227cb7328eac9c923e23827e1227ba81bf54481aabfdb421ee0963140c1ccb665b78f211016b43335546b
7
- data.tar.gz: ec15d388ca8691a1d67423207c1e4cffb59e2711b187784f5fe8760430039b03314471c2c8efeacfb65db6b14867b7d6995b5e8977a914eaf53e14aa3a0f4339
6
+ metadata.gz: bcd8610d526dd2db3fb72ebad5e8a20aa83e85b847757916b3b481f9013a70b1d8730b660598459a343043e0f54933277405274886d544e9130f8ae316e34c59
7
+ data.tar.gz: d8bb332fbc1bb04f00d03e67bbdacf9a189a05acd641c2eeab18c8eed615638f4496b4403a842fed493a18dd940bbee5bccba618209fd981764f24521084c6f2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- erector-rails4 (0.0.5)
4
+ erector-rails4 (0.0.6)
5
5
  rails (>= 4.0)
6
6
  treetop (>= 1.2.3)
7
7
 
@@ -91,7 +91,7 @@ module Erector
91
91
 
92
92
  # makes a unique id based on the widget's class name and object id
93
93
  # that you can use as the HTML id of an emitted element
94
- def dom_id
94
+ def widget_dom_id
95
95
  "#{self.class.name.gsub(/:+/,"_")}_#{self.object_id}"
96
96
  end
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module Erector
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -208,22 +208,22 @@ describe Erector::Convenience do
208
208
 
209
209
  end
210
210
 
211
- describe "#dom_id" do
211
+ describe "#widget_dom_id" do
212
212
  class DOMIDWidget < Erector::Widget
213
213
  def content
214
- div :id => dom_id
214
+ div :id => widget_dom_id
215
215
  end
216
216
  end
217
217
 
218
218
  it "makes a unique id based on the widget's class name and object id" do
219
219
  widget = DOMIDWidget.new
220
- widget.dom_id.should include("#{widget.object_id}")
221
- widget.dom_id.should include("DOMIDWidget")
220
+ widget.widget_dom_id.should include("#{widget.object_id}")
221
+ widget.widget_dom_id.should include("DOMIDWidget")
222
222
  end
223
223
 
224
224
  it "can be used as an HTML id" do
225
225
  widget = DOMIDWidget.new
226
- widget.to_html.should == "<div id=\"#{widget.dom_id}\"></div>"
226
+ widget.to_html.should == "<div id=\"#{widget.widget_dom_id}\"></div>"
227
227
  end
228
228
 
229
229
  describe 'for a namespaced widget class' do
@@ -235,12 +235,12 @@ describe Erector::Convenience do
235
235
 
236
236
  it 'is colon escaped' do
237
237
  g = ErectorConvenienceSpec::NestedWidget.new
238
- g.dom_id.should_not =~ /:/
238
+ g.widget_dom_id.should_not =~ /:/
239
239
  end
240
240
 
241
241
  it 'combines all parent namespaces' do
242
242
  g = ErectorConvenienceSpec::NestedWidget.new
243
- g.dom_id.should == "ErectorConvenienceSpec_NestedWidget_#{g.object_id}"
243
+ g.widget_dom_id.should == "ErectorConvenienceSpec_NestedWidget_#{g.object_id}"
244
244
  end
245
245
 
246
246
  end
@@ -163,13 +163,13 @@ module WidgetSpec
163
163
  def content
164
164
  div do
165
165
  widget @child_widget do |child|
166
- b child.dom_id
166
+ b child.widget_dom_id
167
167
  end
168
168
  end
169
169
  end
170
170
  end
171
171
 
172
- Parent2.new(:child_widget => child_widget).to_html.should == "<div><b>#{child_widget.dom_id}</b></div>"
172
+ Parent2.new(:child_widget => child_widget).to_html.should == "<div><b>#{child_widget.widget_dom_id}</b></div>"
173
173
  end
174
174
  end
175
175
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erector-rails4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Chaffee
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-12-31 00:00:00.000000000 Z
16
+ date: 2014-01-04 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rails