lib/spree_cmd/installer.rb in spree_cmd-1.2.0.rc1 vs lib/spree_cmd/installer.rb in spree_cmd-1.2.0.rc2

- old
+ new

@@ -1,6 +1,7 @@ require 'rbconfig' +require 'active_support/core_ext/string' module SpreeCmd class Installer < Thor::Group include Thor::Actions @@ -62,10 +63,16 @@ end def ask_questions @install_default_gateways = ask_with_default('Would you like to install the default gateways?') @install_default_auth = ask_with_default('Would you like to install the default authentication system?') + unless @install_default_auth + @user_class = ask("What is the name of the class representing users within your application? [User]") + if @user_class.blank? + @user_class = "User" + end + end if options[:skip_install_data] @run_migrations = false @load_seed_data = false @load_sample_data = false @@ -92,11 +99,11 @@ gem :spree_usa_epay gem :spree_skrill end if @install_default_auth - gem :spree_auth_devise, :git => "git://github.com/radar/spree_auth_devise" + gem :spree_auth_devise, :git => "git://github.com/spree/spree_auth_devise" end run 'bundle install', :capture => true end end @@ -104,10 +111,11 @@ def initialize_spree spree_options = [] spree_options << "--migrate=#{@run_migrations}" spree_options << "--seed=#{@load_seed_data}" spree_options << "--sample=#{@load_sample_data}" + spree_options << "--user_class=#{@user_class}" spree_options << "--auto_accept" if options[:auto_accept] inside @app_path do run "rails generate spree:install #{spree_options.join(' ')}", :verbose => false end @@ -179,12 +187,18 @@ def windows? %r{msdos|mswin|djgpp|mingw} === RbConfig::CONFIG['host_os'] end def image_magick_installed? + cmd = 'identify -version' + if RUBY_PLATFORM =~ /mswin/ #windows + cmd += " >nul" + else + cmd += " >/dev/null" + end # true if command executed succesfully # false for non zero exit status # nil if command execution fails - system('identify -version') + system(cmd) end end end