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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/erector/convenience.rb +1 -1
- data/lib/erector/version.rb +1 -1
- data/spec/erector/convenience_spec.rb +7 -7
- data/spec/erector/widget_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c20bfa9a5097c2798f37dd76a0ad33755091cd02
|
4
|
+
data.tar.gz: 39ce033e53636ba5673f0311335751be5c9d7139
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcd8610d526dd2db3fb72ebad5e8a20aa83e85b847757916b3b481f9013a70b1d8730b660598459a343043e0f54933277405274886d544e9130f8ae316e34c59
|
7
|
+
data.tar.gz: d8bb332fbc1bb04f00d03e67bbdacf9a189a05acd641c2eeab18c8eed615638f4496b4403a842fed493a18dd940bbee5bccba618209fd981764f24521084c6f2
|
data/Gemfile.lock
CHANGED
data/lib/erector/convenience.rb
CHANGED
data/lib/erector/version.rb
CHANGED
@@ -208,22 +208,22 @@ describe Erector::Convenience do
|
|
208
208
|
|
209
209
|
end
|
210
210
|
|
211
|
-
describe "#
|
211
|
+
describe "#widget_dom_id" do
|
212
212
|
class DOMIDWidget < Erector::Widget
|
213
213
|
def content
|
214
|
-
div :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.
|
221
|
-
widget.
|
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.
|
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.
|
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.
|
243
|
+
g.widget_dom_id.should == "ErectorConvenienceSpec_NestedWidget_#{g.object_id}"
|
244
244
|
end
|
245
245
|
|
246
246
|
end
|
data/spec/erector/widget_spec.rb
CHANGED
@@ -163,13 +163,13 @@ module WidgetSpec
|
|
163
163
|
def content
|
164
164
|
div do
|
165
165
|
widget @child_widget do |child|
|
166
|
-
b child.
|
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.
|
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.
|
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:
|
16
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rails
|