Permalink
Browse files

More defense on Gaston internal class name

Ruby does not enjoy `-` in a class's name.

Signed-off-by: chatgris <jboyer@af83.com>
  • Loading branch information...
1 parent 9128c55 commit 83e0c3578a29e386ea6b97f972aa3082667f6f18 chatgris committed Apr 16, 2014
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/gaston/builder.rb
  2. +5 −0 spec/fixtures/dash.yml
View
2 lib/gaston/builder.rb
@@ -5,7 +5,7 @@ class << self
def new(parent, hash={})
hash.each_with_object({}) do |(key, store), hsh|
if store.is_a?(Hash)
- camelize = "Gaston" + Inflecto.camelize(key)
+ camelize = "Gaston" + Inflecto.camelize(Inflecto.underscore(key))
klass = if parent.const_defined? camelize, false
Inflecto.constantize("#{parent}::#{camelize}")
else
View
5 spec/fixtures/dash.yml
@@ -0,0 +1,5 @@
+:gaston:
+ dash:
+ :level:
+ CAL-150x150-M:
+ :ohai: :this_is_a_bug

0 comments on commit 83e0c35

Please sign in to comment.