lib/generators/md/scaffold/scaffold_generator.rb in marionette_dust-0.0.3 vs lib/generators/md/scaffold/scaffold_generator.rb in marionette_dust-0.1.0

- old
+ new

@@ -19,24 +19,19 @@ type: :array, aliases: "--sub", default: "", desc: "" - def parse_options - coffee = options.coffeescript - @ext = coffee ? ".js.coffee" : ".js" - end - def create_marionette_entity file = File.join(entities_path, singular_file_name) - template "entity#{@ext}", file + template "entity#{extension}", file end def create_marionette_app empty_directory File.join(apps_path, file_name.downcase) file = File.join(apps_path, file_name.downcase, sub_app_file_name) - template "app#{@ext}", file + template "app#{extension}", file end def create_subapp return if options.submodule.empty? for submodule in options.submodule @@ -46,13 +41,13 @@ create_asset("controller") create_dust_template end end - protected + protected def create_asset(type) file = File.join(apps_path, file_name.downcase, @submodule_name.downcase, asset_file_name(type)) - template "#{type}#{@ext}", file + template "#{type}#{extension}", file end def create_dust_template empty_directory File.join(template_path, file_name.downcase, @submodule_name.downcase) file = File.join(template_path, file_name.downcase, @submodule_name.downcase, "#{@submodule_name.downcase}.jst.dust")