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

- old
+ new

@@ -21,19 +21,19 @@ def template_path File.join(asset_path, "templates") end def singular_file_name - "#{file_name.singularize}#{@ext}" + "#{file_name.singularize}#{extension}" end def plural_file_name - "#{file_name.pluralize}#{@ext}" + "#{file_name.pluralize}#{extension}" end def asset_file_name(type) - "#{@submodule_name.downcase.singularize}_#{type}#{@ext}" + "#{@submodule_name.downcase.singularize}_#{type}#{extension}" end def singular_entity_name file_name.singularize.camelize end @@ -41,31 +41,35 @@ def plural_entity_name file_name.pluralize.camelize end def sub_app_name - [file_name.pluralize.camelize, "App"].join("") + [file_name.camelize, "App"].join("") end def sub_app_file_name - [file_name.singularize.downcase, "_app", "#{@ext}"].join("") + [file_name.singularize.downcase, "_app", "#{extension}"].join("") end def sub_app_scope - @submodule_name.capitalize + @submodule_name.camelize end + def extension + @ext ||= options.coffeescript ? ".js.coffee" : ".js" + end + def app_name rails_app_name.camelize end - def app_filename - rails_app_name.underscore - end - def rails_app_name Rails.application.class.name.split('::').first end + def trackeable_directory(path) + empty_directory path + template ".gitkeep", "#{path}/.gitkeep" + end end end end