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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e810f8be3ddd542c6219561717aeceecea23909
4
- data.tar.gz: 56fd9b04bd5d18e30a32ada542b7d437e3ea3e30
3
+ metadata.gz: 6500409f7ed7d93417ea6768be36cd7f23c43135
4
+ data.tar.gz: be8935bf286156e5c0bcef479003942303c0e9fe
5
5
  SHA512:
6
- metadata.gz: a613fcbdd71910ee54e81cf8a7dbd533bf0ceaac761b755c045a899e6eed493e88911bf78a5a80fa41e7aa1412abafe4ff1c355d6421af5f0a5c67900ef5eee0
7
- data.tar.gz: 6098e5d61ab2bd4dce6e489a2dd659f3e9b81b2497ebd02bc73ef8a4ecae3d6799dfe9e9a91b9d6d1800e5988954ddcb0436c1dfc218de73491ee8996ec0904f
6
+ metadata.gz: d41d682050384b8a91b2c921c854c6ce182ae4ce029d4708cd8f5c61f3535a0cfa5aebbfefc22717a1e2b388f5be503312c5fd03e5fe989decd2b4e63e560b89
7
+ data.tar.gz: 156b79084867ba84b812be0ef52cd83621166127ace67b870a790e260ded3d324773a4e641f454e06632d2926e530ad9a90193c1bd632254021656adca72f7b1
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Renderer
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.3"
4
4
  end
5
5
  end
@@ -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])/,"\1_\2").
17
- gsub(/([a-z\d])([A-Z])/,"\1_\2").
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
@@ -1,5 +1,5 @@
1
1
  module MyApp
2
- class Bar < Alephant::Renderer::Views::Html
2
+ class BarAbc < Alephant::Renderer::Views::Html
3
3
  def content
4
4
  @data[:content]
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module MyApp
2
- class Foo < Alephant::Renderer::Views::Html
2
+ class FooXyz < Alephant::Renderer::Views::Html
3
3
  def content
4
4
  @data[:content]
5
5
  end
@@ -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? "bar").to be
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? "foo").to be
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.2
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-03 00:00:00.000000000 Z
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/bar.rb
235
- - spec/fixtures/components/foo-renderer/models/foo.rb
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/bar.rb
270
- - spec/fixtures/components/foo-renderer/models/foo.rb
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