lib/template/spec.rb in klipp-0.2.0 vs lib/template/spec.rb in klipp-0.2.1

- old
+ new

@@ -153,10 +153,14 @@ kf = "create '#{self.class.expand_identifier(self.identifier)}' do |tokens|\n\n" @tokens.each do |name, token| unless token.hidden kf += " # #{token.comment}\n" if token.comment kf += " # #{token.validation_hint}\n" if token.validation_hint - kf += " tokens[:#{name}] = #{token.type == :bool ? 'false' : "\"\""}\n" + if token.type == :bool + kf += " tokens[:#{name}] = #{token.default_value ? 'true' : 'false'}\n" + else + kf += " tokens[:#{name}] = \"#{token.default_value}\"\n" + end kf += "\n" end end kf += "end" end \ No newline at end of file