generators/rhogen.rb in rhodes-0.2.3 vs generators/rhogen.rb in rhodes-0.2.4
- old
+ new
@@ -8,17 +8,17 @@
desc <<-DESC
Generate rhodes application
DESC
class BaseGenerator < Templater::Generator
- def class_name
- name.gsub('-', '_').camel_case
- end
-
- alias_method :module_name, :class_name
+ def class_name
+ name.gsub('-', '_').camel_case
end
+ alias_method :module_name, :class_name
+ end
+
class AppGenerator < BaseGenerator
def self.source_root
File.join(File.dirname(__FILE__), 'templates', 'application')
end
@@ -32,21 +32,21 @@
first_argument :name, :required => true, :desc => "application name"
template :application do |template|
template.source = 'application.rb'
- template.destination = "#{name}/application.rb"
+ template.destination = "#{name.camel_case}/application.rb"
end
template :index do |template|
template.source = 'index.erb'
- template.destination = "#{name}/index.erb"
+ template.destination = "#{name.camel_case}/index.erb"
end
template :layout do |template|
template.source = 'layout.erb'
- template.destination = "#{name}/layout.erb"
+ template.destination = "#{name.camel_case}/layout.erb"
end
end
class ModelGenerator < BaseGenerator
@@ -83,9 +83,14 @@
end
template :new do |template|
template.source = 'new.erb'
template.destination = "#{name.camel_case}/new.erb"
+ end
+
+ template :new do |template|
+ template.source = 'show.erb'
+ template.destination = "#{name.camel_case}/show.erb"
end
template :controller do |template|
template.source = 'controller.rb'
template.destination = "#{name.camel_case}/controller.rb"
\ No newline at end of file