@@ -7,7 +7,7 @@ def inspect_hash(hash)
77 else
88 pairs = hash.map do |key , value |
99 if key == " lambda"
10- " #{ key.inspect } => #{ ((value as Hash (String , JSON ::Type ))[" ruby" ] as String ).gsub(/^proc \{ (?:(?:\| )([^|] +)(?:\| ) ) ?/ ){|m , p | " ->(#{ p[1 ]? ? " #{ p[1 ] } : String" : " " } ){" }.gsub(/1/ , " 1; $ calls.to_s" ).gsub(/false/ , " false.to_s" ) } "
10+ " #{ key.inspect } => #{ ((value.as( Hash (String , JSON ::Type ))) [" ruby" ]. as String ).gsub(/^proc \{ (?:(?:\| )([^|] +)(?:\| ) ) ?/ ){|m , p | " ->(#{ p[1 ]? ? " #{ p[1 ] } : String" : " " } ){" }.gsub(/\$ / , " Global. " ).gsub( / 1/ , " 1; Global. calls.to_s" ).gsub(/false/ , " false.to_s" ) } "
1111 else
1212 " #{ key.inspect } => #{ inspect_hash value } "
1313 end
@@ -19,7 +19,7 @@ def inspect_hash(hash)
1919 if hash.empty?
2020 " [] of String"
2121 else
22- vals = hash.map{|x | inspect_hash(x) as String }
22+ vals = hash.map{|x | inspect_hash(x). as String }
2323 " [#{ vals.join " ," } ]"
2424 end
2525 else
2929
3030filename = ARGV [0 ]
3131
32- file = (JSON .parse File .read " ./spec/mustache-spec/specs/#{ filename } " ).as_h as Hash (String , JSON ::Type )
32+ file = (JSON .parse File .read " ./spec/mustache-spec/specs/#{ filename } " ).as_h. as Hash (String , JSON ::Type )
3333
3434puts " describe #{ filename.inspect } do"
35- (file[" tests" ] as Array (JSON ::Type )).each do |test |
36- test = test as Hash (String , JSON ::Type )
35+ (file[" tests" ]. as Array (JSON ::Type )).each do |test |
36+ test = test. as Hash (String , JSON ::Type )
3737
3838 puts " it #{ test[" desc" ].inspect } do"
3939 puts " template = Crustache.parse #{ test[" template" ].inspect } "
@@ -43,7 +43,7 @@ puts "describe #{filename.inspect} do"
4343
4444 puts " fs = Crustache::HashFileSystem.new"
4545 if test.has_key?(" partials" )
46- (test[" partials" ] as Hash (String , JSON ::Type )).each do |name , tmpl |
46+ (test[" partials" ]. as Hash (String , JSON ::Type )).each do |name , tmpl |
4747 puts " fs.register #{ name.inspect } , Crustache.parse #{ tmpl.inspect } "
4848 end
4949 end
0 commit comments