46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/generators/web_feed/install_generator.rb', line 46
def generate_app
if options.include_models?
template "models/resource.rb.erb", "#{Rails.root}/app/models/#{resource}.rb"
template "models/news.rb.erb", "#{Rails.root}/app/models/#{news}.rb"
template "models/keyword.rb.erb", "#{Rails.root}/app/models/#{keyword}.rb"
end
if options.include_controllers?
template "controllers/resources_controller.rb.erb", "#{Rails.root}/app/controllers/#{resource.pluralize}_controller.rb"
template "controllers/news_controller.rb.erb", "#{Rails.root}/app/controllers/#{news.pluralize}_controller.rb"
template "controllers/keywords_controller.rb.erb", "#{Rails.root}/app/controllers/#{keyword.pluralize}_controller.rb"
end
if options.include_views?
%w( index new edit _form).each do |file|
template "views/resources/#{file}.html.erb", "#{Rails.root}/app/views/#{resource.pluralize}/#{file}.html.erb"
end
%w( index new edit _form).each do |file|
template "views/keywords/#{file}.html.erb", "#{Rails.root}/app/views/#{keyword.pluralize}/#{file}.html.erb"
end
%w( index show).each do |file|
template "views/news/#{file}.html.erb", "#{Rails.root}/app/views/#{news.pluralize}/#{file}.html.erb"
end
copy_file "views/layouts/webfeed.html.erb", "#{Rails.root}/app/views/layouts/webfeed.html.erb"
template "views/layouts/_webfeed.html.erb", "#{Rails.root}/app/views/layouts/_webfeed.html.erb"
copy_file "stylesheets/webfeed.css", "#{Rails.root}/app/assets/stylesheets/webfeed.css"
end
end
|