require 'rails/generators/joosy/joosy_base' module Joosy module Generators class PageGenerator < ::Rails::Generators::JoosyBase source_root File.join(File.dirname(__FILE__), 'templates') def create_files super template "app/pages/template.js.coffee", "#{app_path}/pages/#{namespace_path}/#{file_name}.js.coffee" create_file "#{app_path}/templates/pages/#{namespace_path}/#{file_name}.jst.#{options[:template_kind]}" end protected def app_path if class_path.size < 2 puts <