alephant-renderer 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alephant/renderer/version.rb +1 -1
- data/lib/alephant/renderer/views.rb +3 -3
- data/spec/fixtures/components/foo-renderer/models/{bar.rb → BAR_ABC.rb} +1 -1
- data/spec/fixtures/components/foo-renderer/models/{foo.rb → foo_xyz.rb} +1 -1
- data/spec/renderer_spec.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6500409f7ed7d93417ea6768be36cd7f23c43135
|
4
|
+
data.tar.gz: be8935bf286156e5c0bcef479003942303c0e9fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d41d682050384b8a91b2c921c854c6ce182ae4ce029d4708cd8f5c61f3535a0cfa5aebbfefc22717a1e2b388f5be503312c5fd03e5fe989decd2b4e63e560b89
|
7
|
+
data.tar.gz: 156b79084867ba84b812be0ef52cd83621166127ace67b870a790e260ded3d324773a4e641f454e06632d2926e530ad9a90193c1bd632254021656adca72f7b1
|
@@ -8,13 +8,13 @@ module Alephant
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def self.get_registered_class(id)
|
11
|
-
@@views[id]
|
11
|
+
@@views[id.downcase]
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.underscorify(str)
|
15
15
|
str.gsub(/::/, "/").
|
16
|
-
gsub(/([A-Z]+)([A-Z][a-z])/,"
|
17
|
-
gsub(/([a-z\d])([A-Z])/,"
|
16
|
+
gsub(/([A-Z]+)([A-Z][a-z])/,"\\1_\\2").
|
17
|
+
gsub(/([a-z\d])([A-Z])/,"\\1_\\2").
|
18
18
|
tr("-", "_").
|
19
19
|
downcase
|
20
20
|
end
|
data/spec/renderer_spec.rb
CHANGED
@@ -43,11 +43,11 @@ describe Alephant::Renderer do
|
|
43
43
|
|
44
44
|
context "using `bar`, `foo`, `json` models" do
|
45
45
|
it "contains a View for `bar` model" do
|
46
|
-
expect(subject.views.key? "
|
46
|
+
expect(subject.views.key? "BAR_ABC").to be
|
47
47
|
end
|
48
48
|
|
49
49
|
it "contains a View for `foo` model" do
|
50
|
-
expect(subject.views.key? "
|
50
|
+
expect(subject.views.key? "foo_xyz").to be
|
51
51
|
end
|
52
52
|
|
53
53
|
it "contains a View for `json` model" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BBC News
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,8 +231,8 @@ files:
|
|
231
231
|
- lib/alephant/renderer/views/base.rb
|
232
232
|
- lib/alephant/renderer/views/html.rb
|
233
233
|
- lib/alephant/renderer/views/json.rb
|
234
|
-
- spec/fixtures/components/foo-renderer/models/
|
235
|
-
- spec/fixtures/components/foo-renderer/models/
|
234
|
+
- spec/fixtures/components/foo-renderer/models/BAR_ABC.rb
|
235
|
+
- spec/fixtures/components/foo-renderer/models/foo_xyz.rb
|
236
236
|
- spec/fixtures/components/foo-renderer/models/json.rb
|
237
237
|
- spec/integration/spec_helper.rb
|
238
238
|
- spec/renderer_spec.rb
|
@@ -266,8 +266,8 @@ signing_key:
|
|
266
266
|
specification_version: 4
|
267
267
|
summary: Render HTML snippets
|
268
268
|
test_files:
|
269
|
-
- spec/fixtures/components/foo-renderer/models/
|
270
|
-
- spec/fixtures/components/foo-renderer/models/
|
269
|
+
- spec/fixtures/components/foo-renderer/models/BAR_ABC.rb
|
270
|
+
- spec/fixtures/components/foo-renderer/models/foo_xyz.rb
|
271
271
|
- spec/fixtures/components/foo-renderer/models/json.rb
|
272
272
|
- spec/integration/spec_helper.rb
|
273
273
|
- spec/renderer_spec.rb
|