lib/ubiquo/template.erb in ubiquo-0.9.0.b2 vs lib/ubiquo/template.erb in ubiquo-0.9.0.b3
- old
+ new
@@ -25,10 +25,26 @@
when "custom"
selected_plugins = (minimal_plugins + <%= @opts[:plugins].inspect %>).uniq
else selected_plugins = minimal_plugins + rest_plugins
end
+# File railties/lib/rails/generators/rails/app/app_generator.rb, line 238
+def file(*args, &block)
+ config = args.last.is_a?(Hash) ? args.pop : {}
+ # Force overwrite of existent files
+ create_file(*args, {:force => true}.merge(config), &block)
+end
+
+# File 'railties/lib/rails/generators/actions.rb', line 227
+def rake(command, options={})
+ log :rake, command
+ env = options[:env] || 'development'
+ sudo = options[:sudo] && RbConfig::CONFIG['host_os'] !~ /mswin|mingw/ ? 'sudo ' : ''
+ rvm = "<%= @opts[:rvm] ? "rvm @#{@opts[:app_name]} do " : '' %>"
+ in_root { run("#{sudo}#{rvm}#{extify(:rake)} #{command} RAILS_ENV=#{env}", :verbose => false) }
+end
+
def add_plugins(plugin_names, options={})
git_root = options[:devel] ? 'git@github.com:gnuine' : 'git://github.com/gnuine'
plugin_names.each { |name| plugin name, :git => "#{git_root}/#{name}.git", :branch => options[:branch], :submodule => true }
end
# To ask needed settings when boostraping the app
@@ -63,11 +79,11 @@
initializer 'ubiquo_config.rb', <<-CODE
Ubiquo::Config.add do |config|
config.app_name = "#{appname}"
config.app_title = "#{appname.gsub(/_/, " ").capitalize}"
config.app_description = "#{appname.gsub(/_/, " ").capitalize}"
- case RAILS_ENV
+ case Rails.env.to_s
when 'development', 'test'
config.notifier_email_from = 'railsmail@gnuine.com'
else
config.notifier_email_from = 'railsmail@gnuine.com'
end
@@ -211,11 +227,11 @@
# gnuine routes.rb
ubiquo_routes = selected_plugins.map do |plugin|
" #map.from_plugin :#{plugin}"
end.join("\n")
file 'config/routes.rb', <<-CODE
-Rails32::Application.routes.draw do
+#{appname.camelize}::Application.routes.draw do
end
#ActionController::Routing::Routes.draw do |map|
# map.namespace :ubiquo do |ubiquo|
# end
@@ -242,11 +258,11 @@
file 'Gemfile', <<-CODE
source "https://rubygems.org"
gem "rails", "= 3.2.0.rc1"
-platforms :mri_18 do
+platforms :mri_19 do
gem "#{adapter_gem}"
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
@@ -296,10 +312,9 @@
<% else %>
run" #{bundle_command}"
<% end %>
# End of bundler setup
-rake("rails:update")
rake("calendardateselect:install")
rake("ubiquo:install OVERWRITE=yes")
<% if RUBY_PLATFORM =~ /java/ %>
generate(:jdbc)