active_template.rb in active_leonardo-0.0.5 vs active_template.rb in active_leonardo-0.0.6.beta1

- old
+ new

@@ -37,14 +37,27 @@ /*.dat EOS end gem "activeadmin" +gem "active_admin_editor" gem "meta_search" gem "active_leonardo" -gem 'state_machine' if yes?("Do you have to handle states ?") +rspec = yes?("Add rspec as testing framework ?") +if rspec + gem 'rspec-rails', :group => [:test, :development] + gem 'capybara', :group => :test + gem 'launchy', :group => :test + gem 'database_cleaner', :group => :test + if /1.8.*/ === RUBY_VERSION + gem 'factory_girl', '2.6.4', :group => :test + gem 'factory_girl_rails', '1.7.0', :group => :test + else + gem 'factory_girl_rails', :group => :test + end +end authentication = yes?("Authentication ?") model_name = authorization = nil if authentication default_model_name = "User" @@ -68,29 +81,35 @@ gem 'cancan' gem 'activeadmin-cancan' end end +gem 'state_machine' if yes?("Do you have to handle states ?") + dashboard_root = yes?("Would you use dashboard as root ? (recommended)") home = yes?("Ok. Would you create home controller as root ?") unless dashboard_root if yes?("Bundle install ?") dir = ask(" Insert folder name to install locally: [blank=default gems path]") run "bundle install #{"--path=#{dir}" unless dir.empty? || dir=='y'}" end +generate "rspec:install" if rspec + generate "active_admin:install #{authentication ? model_name : "--skip-users"}" +generate "active_admin:editor" if authorization generate "cancan:ability" generate "migration", "AddRolesMaskTo#{model_name}", "roles_mask:integer" end generate "leolay", "active", #specify theme "--auth_class=#{model_name}", - (authorization ? "" : "--skip-authorization"), - (authentication ? "" : "--skip-authentication") + (rspec ? nil : "--skip-rspec"), + (authorization ? nil : "--skip-authorization"), + (authentication ? nil : "--skip-authentication") if dashboard_root route "root :to => 'admin/dashboard#index'" elsif home