alephant-renderer 0.0.3 → 0.0.4

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: e10f2ccda58347efd0066e188a2476184a678d7b
4
- data.tar.gz: 381928cd451908ffa930066a001356c19f492c57
3
+ metadata.gz: 2c9953c9b606f3d11b0ff6938090d669319209a3
4
+ data.tar.gz: e98af7fee7f6c5b4bf395a626080f2548a3baadc
5
5
  SHA512:
6
- metadata.gz: c0415a201d03b777715029ed77a0aafdf1a34c8689b0bf6e66615e07568dc42ad0c247f9da11bc1a0433e387de14a02f8a195c485e58168db838919dfcd4a23d
7
- data.tar.gz: ab1c19eafdaeccd8a94a53c196855827751c55f1c8ceca01139b0713c56c09e070c9ad799c83a4c713c1cdd7b218077a073fa8240136ee2cba5c3a73809d73dd
6
+ metadata.gz: 327c03e516395caddc5644b987ce71ec69b80133d7d6f1e3253077cf2e81c6268dcbb32029b62d754fc6ba73d88e10de179629d85a9da687df52cb29431d2721
7
+ data.tar.gz: a7c4d64d8cf0bea9ab9c58874d0061b8ffbf9b81b38409e14a74519f2a55738f5610a5a90f730e702f803108429bd3e6cc570bb4b11fadd611b5a35d20955128
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Renderer
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -5,10 +5,11 @@ module Alephant
5
5
  @@views = {}
6
6
 
7
7
  def self.register(klass)
8
- id = klass.name.split('::').last
9
- self.underscorify(id)
8
+ id = self.underscorify(
9
+ klass.name.split('::').last
10
+ )
10
11
 
11
- @@views[id.underscore] = klass
12
+ @@views[id] = klass
12
13
  end
13
14
 
14
15
  def self.get_registered_class(id)
@@ -16,17 +17,11 @@ module Alephant
16
17
  end
17
18
 
18
19
  def self.underscorify(str)
19
- unless str.respond_to? :underscore
20
- str.instance_eval do
21
- def underscore
22
- self.gsub(/::/, '/').
23
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
24
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
25
- tr("-", "_").
26
- downcase
27
- end
28
- end
29
- end
20
+ str.gsub(/::/, '/').
21
+ gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
22
+ gsub(/([a-z\d])([A-Z])/,'\1_\2').
23
+ tr("-", "_").
24
+ downcase
30
25
  end
31
26
  end
32
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-renderer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Kenny