active_template.rb in active_leonardo-0.2.3 vs active_template.rb in active_leonardo-0.4.1

- old
+ new

@@ -8,17 +8,19 @@ # # ------------------------------------------------------- # ######################################################### +rails_version = Rails::VERSION::STRING + puts '*' * 40 -puts "* Processing template..." +puts "* Rails #{rails_version} Processing template..." puts '*' * 40 test_mode = nil ARGV.each{|arg| test_mode = true if arg == "test_mode"} -app_path = ARGV[0] +app_path = ARGV[1] puts "**** Starting app into #{app_path} in test mode! ****" if test_mode use_git = test_mode || yes?("Do you use git ?") if use_git @@ -45,44 +47,40 @@ /*.dat /config/initializers/secret_token.rb EOS end -gem "activeadmin", git: 'http://github.com/gregbell/active_admin.git' + +gem "activeadmin", git: 'http://github.com/gregbell/active_admin.git' if test_mode - gem "active_leonardo", :path => "../../." + gem "active_leonardo", path: "../../." else gem "active_leonardo" end gem "jquery-turbolinks" gem "bourbon" easy_develop = test_mode || yes?("Do you want to make development easier?") if easy_develop - gem "rack-mini-profiler", :group => :development - gem "better_errors", :group => :development - gem "awesome_print", :group => :development + gem "rack-mini-profiler", group: :development + gem "better_errors", group: :development + gem "awesome_print", group: :development end #use_editor = yes?("Do you want a wysihtml editor?") #if use_editor # gem 'activeadmin-dragonfly', git: 'https://github.com/stefanoverna/activeadmin-dragonfly' # gem 'activeadmin-wysihtml5', git: 'https://github.com/stefanoverna/activeadmin-wysihtml5' #end rspec = test_mode || 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 + gem 'rspec-rails', group: [:test, :development] + gem 'capybara', group: :test + gem 'launchy', group: :test + gem 'database_cleaner', group: :test + gem 'factory_girl_rails', group: :test end authentication = test_mode || yes?("Authentication ?") model_name = authorization = nil if authentication @@ -99,19 +97,27 @@ rails g leosca Product name price:decimal --auth_class=#{model_name} ************************************************************************* REMEM p stdout end + gem "devise" authorization = test_mode || yes?("Authorization ?") if authorization gem "cancan" end end gem 'state_machine' if test_mode || yes?("Do you have to handle states ?") +# Updates for Rails 4.1 +if /4.1.*/ === rails_version + gem 'ransack', git: 'http://github.com/activerecord-hackery/ransack.git', branch: 'rails-4.1' + gem 'polyamorous', git: 'http://github.com/activerecord-hackery/polyamorous.git' + gem 'formtastic', git: 'http://github.com/justinfrench/formtastic.git' +end + dashboard_root = test_mode || yes?("Would you use dashboard as root ? (recommended)") home = test_mode || yes?("Ok. Would you create home controller as root ?") unless dashboard_root if test_mode || yes?("Bundle install ?") dir = test_mode ? "" : ask(" Insert folder name to install locally: [blank=default gems path]") @@ -128,13 +134,13 @@ end generate "leolay", "active", #specify theme "--auth_class=#{model_name}", - (rspec ? nil : "--skip-rspec"), - (authorization ? nil : "--skip-authorization"), - (authentication ? nil : "--skip-authentication"), - (test_mode ? "--no-verbose" : nil) + (rspec ? nil : "--skip-rspec"), + (authorization ? nil : "--skip-authorization"), + (authentication ? nil : "--skip-authentication"), + (test_mode ? "--no-verbose" : nil) if dashboard_root route "root :to => 'admin/dashboard#index'" elsif home \ No newline at end of file