@@ -81,7 +81,7 @@ def after_everything(&block); @after_everything_blocks << [@current_recipe, bloc
8181def before_config ( &block ) ; @before_configs [ @current_recipe ] = block ; end
8282
8383def copy_from_repo ( filename , opts = { } )
84- repo = 'https://raw.github.com/RailsApps/rails3-application-templates /master/files-v2 /'
84+ repo = 'https://raw.github.com/RailsApps/rails-composer /master/files/'
8585 repo = opts [ :repo ] unless opts [ :repo ] . nil?
8686 if ( !opts [ :prefs ] . nil? ) && ( !prefs . has_value? opts [ :prefs ] )
8787 return
@@ -183,7 +183,7 @@ def html_to_slim(source)
183183if prefer :git , true
184184 begin
185185 remove_file '.gitignore'
186- get 'https://raw.github.com/RailsApps/rails3-application-templates /master/files/gitignore.txt' , '.gitignore'
186+ get 'https://raw.github.com/RailsApps/rails-composer /master/files/gitignore.txt' , '.gitignore'
187187 rescue OpenURI ::HTTPError
188188 say_wizard "Unable to obtain gitignore file from the repo"
189189 end
@@ -207,39 +207,39 @@ def html_to_slim(source)
207207
208208prefs [ :railsapps ] = multiple_choice "Install an example application?" ,
209209 [ [ "No, let me build my own application" , "none" ] ,
210- [ "rails3-devise-rspec-cucumber" , "rails3-devise-rspec-cucumber" ] ,
211210 [ "rails3-bootstrap-devise-cancan" , "rails3-bootstrap-devise-cancan" ] ,
211+ [ "rails3-devise-rspec-cucumber" , "rails3-devise-rspec-cucumber" ] ,
212212 [ "rails3-mongoid-devise" , "rails3-mongoid-devise" ] ,
213213 [ "rails3-mongoid-omniauth" , "rails3-mongoid-omniauth" ] ,
214214 [ "rails3-subdomains" , "rails3-subdomains" ] ] unless prefs . has_key? :railsapps
215215
216216case prefs [ :railsapps ]
217- when 'rails3-devise-rspec-cucumber '
217+ when 'rails3-bootstrap- devise-cancan '
218218 prefs [ :database ] = 'sqlite'
219219 prefs [ :templates ] = 'erb'
220220 prefs [ :unit_test ] = 'rspec'
221221 prefs [ :integration ] = 'cucumber'
222222 prefs [ :fixtures ] = 'factory_girl'
223- prefs [ :frontend ] = 'none'
223+ prefs [ :frontend ] = 'bootstrap'
224+ prefs [ :bootstrap ] = 'sass'
224225 prefs [ :email ] = 'gmail'
225226 prefs [ :authentication ] = 'devise'
226227 prefs [ :devise_modules ] = 'default'
227- prefs [ :authorization ] = 'none '
228- prefs [ :starter_app ] = 'users_app '
228+ prefs [ :authorization ] = 'cancan '
229+ prefs [ :starter_app ] = 'admin_app '
229230 prefs [ :form_builder ] = 'none'
230- when 'rails3-bootstrap- devise-cancan '
231+ when 'rails3-devise-rspec-cucumber '
231232 prefs [ :database ] = 'sqlite'
232233 prefs [ :templates ] = 'erb'
233234 prefs [ :unit_test ] = 'rspec'
234235 prefs [ :integration ] = 'cucumber'
235236 prefs [ :fixtures ] = 'factory_girl'
236- prefs [ :frontend ] = 'bootstrap'
237- prefs [ :bootstrap ] = 'sass'
237+ prefs [ :frontend ] = 'none'
238238 prefs [ :email ] = 'gmail'
239239 prefs [ :authentication ] = 'devise'
240240 prefs [ :devise_modules ] = 'default'
241- prefs [ :authorization ] = 'cancan '
242- prefs [ :starter_app ] = 'admin_app '
241+ prefs [ :authorization ] = 'none '
242+ prefs [ :starter_app ] = 'users_app '
243243 prefs [ :form_builder ] = 'none'
244244 when 'rails3-mongoid-devise'
245245 prefs [ :database ] = 'mongodb'
@@ -332,7 +332,14 @@ def html_to_slim(source)
332332 unless sqlite_detected
333333 prefs [ :orm ] = multiple_choice "How will you connect to MongoDB?" , [ [ "Mongoid" , "mongoid" ] ] unless prefs . has_key? :orm
334334 else
335- raise StandardError . new "SQLite detected in the Gemfile. Use '-O' or '--skip-activerecord' as in 'rails new foo -O' if you don't want ActiveRecord and SQLite"
335+ say_wizard "WARNING! SQLite gem detected in the Gemfile"
336+ say_wizard "If you wish to use MongoDB you must skip Active Record."
337+ say_wizard "When launching rails_apps_composer, choose 'skip Active Record'."
338+ say_wizard "If using an application template, use the '-O' flag as in 'rails new foo -O'."
339+ prefs [ :fail ] = multiple_choice "Abort or continue?" , [ [ "abort" , "abort" ] , [ "continue" , "continue" ] ]
340+ if prefer :fail , 'abort'
341+ raise StandardError . new "SQLite detected in the Gemfile. Use '-O' or '--skip-activerecord' as in 'rails new foo -O' if you don't want ActiveRecord and SQLite"
342+ end
336343 end
337344end
338345
@@ -527,7 +534,7 @@ def html_to_slim(source)
527534gem 'puma' , '>= 1.5.0' , :group => [ :development , :test ] if prefer :dev_webserver , 'puma'
528535gem 'thin' , '>= 1.4.1' , :group => :production if prefer :prod_webserver , 'thin'
529536gem 'unicorn' , '>= 4.3.1' , :group => :production if prefer :prod_webserver , 'unicorn'
530- gem 'puma' , '>= 1.5.0 ' , :group => :production if prefer :prod_webserver , 'puma'
537+ gem 'puma' , '>= 1.6.1 ' , :group => :production if prefer :prod_webserver , 'puma'
531538
532539## Database Adapter
533540gem 'mongoid' , '>= 3.0.3' if prefer :orm , 'mongoid'
@@ -538,7 +545,7 @@ def html_to_slim(source)
538545
539546## Template Engine
540547if prefer :templates , 'haml'
541- gem 'haml' , '>= 3.1.6 '
548+ gem 'haml' , '>= 3.1.7 '
542549 gem 'haml-rails' , '>= 0.3.4' , :group => :development
543550 # hpricot and ruby_parser are needed for conversion of HTML to Haml
544551 gem 'hpricot' , '>= 0.8.6' , :group => :development
@@ -889,7 +896,7 @@ def html_to_slim(source)
889896 ### CANCAN ###
890897 if prefer :authorization , 'cancan'
891898 generate 'cancan:ability'
892- if prefer :starter_app , 'admin_dashboard '
899+ if prefer :starter_app , 'admin_app '
893900 # Limit access to the users#index page
894901 inject_into_file 'app/models/ability.rb' , :after => "def initialize(user)\n " do <<-RUBY
895902 user ||= User.new # guest user (not logged in)
0 commit comments