diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c6aa555..7e3fac6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,6 +14,7 @@ def rails_version; current_user.rails_version; end def mac?; os =~ /Mac/; end def windows?; os =~ /Windows/; end + def linux?; os =~ /Linux/; end helper_method :mac?, :windows?, :current_user, :os_version end diff --git a/app/controllers/install_steps_controller.rb b/app/controllers/install_steps_controller.rb index 22f82af..549dd13 100644 --- a/app/controllers/install_steps_controller.rb +++ b/app/controllers/install_steps_controller.rb @@ -9,9 +9,9 @@ class InstallStepsController < ApplicationController def show case step when :update_ruby - skip_step if ruby_version =~ /2.0/ + skip_step if ruby_version =~ /2/ when :update_rails - skip_step if rails_version =~ /4.0/ + skip_step if rails_version =~ /5/ end render_wizard end @@ -24,57 +24,59 @@ def update private def set_steps - self.steps = case - when mac? then mac_steps - when windows? then windows_steps - when os == "Linux" then ubuntu_steps - else [:choose_os] - end + self.steps = [:choose_os] + case + when mac? + self.steps += mac_steps + when windows? + self.steps += windows_steps + when linux? + self.steps += ubuntu_steps + end end def mac_steps + steps = [:choose_os_version] case os_version when "10.8", "10.7", "10.6" - [ :choose_os, - :choose_os_version, - :railsinstaller, + steps += [ :railsinstaller, :find_the_command_line, :verify_ruby_version, :update_ruby, :verify_rails_version, :update_rails, :configure_git, - text_editor_step, + :sublime_text, :create_your_first_app, :see_it_live] - when "10.11", "10.10", "10.9" - [ :choose_os, - :choose_os_version, - :install_xcode, + when "10.12", "10.11", "10.10", "10.9" + steps += [ :install_xcode, :find_the_command_line, :install_homebrew, :install_git, :configure_git, :install_rvm_and_ruby, :install_rails, - text_editor_step, + :sublime_text, :create_your_first_app, :see_it_live] - else - [:choose_os, :choose_os_version] end + return steps end def windows_steps - [:choose_os, :railsinstaller_windows, text_editor_step, :find_git_bash, :update_rubygems, :create_your_first_app, :see_it_live] + [ :railsinstaller_windows, + :find_git_bash, + :update_rubygems, + :update_rails, + :sublime_text, + :create_your_first_app, + :see_it_live + ] end def ubuntu_steps - [:choose_os, :rails_for_linux_and_other] - end - - def text_editor_step - :sublime_text + [:rails_for_linux_and_other] end def finish_wizard_path diff --git a/app/views/install_steps/choose_os_version.html.erb b/app/views/install_steps/choose_os_version.html.erb index 4bbe6c7..af09502 100644 --- a/app/views/install_steps/choose_os_version.html.erb +++ b/app/views/install_steps/choose_os_version.html.erb @@ -15,6 +15,7 @@ Select your version of OS X
+ <%= button_to "10.12", wizard_path, name: :os_version, method: :put, class: "option" %> <%= button_to "10.11", wizard_path, name: :os_version, method: :put, class: "option" %> <%= button_to "10.10", wizard_path, name: :os_version, method: :put, class: "option" %> <%= button_to "10.9", wizard_path, name: :os_version, method: :put, class: "option" %> diff --git a/app/views/install_steps/verify_rails_version.html.erb b/app/views/install_steps/verify_rails_version.html.erb index c2d9432..f1cb3fa 100644 --- a/app/views/install_steps/verify_rails_version.html.erb +++ b/app/views/install_steps/verify_rails_version.html.erb @@ -12,8 +12,9 @@

What version of Rails do you have?

- <%= button_to "Rails 4.0", wizard_path, name: :rails_version, method: :put, class: "option" %> - <%= button_to "Rails 3.2", wizard_path, name: :rails_version, method: :put, class: "option" %> + <%= button_to "Rails 5", wizard_path, name: :rails_version, method: :put, class: "option" %> + <%= button_to "Rails 4", wizard_path, name: :rails_version, method: :put, class: "option" %> + <%= button_to "Rails 3", wizard_path, name: :rails_version, method: :put, class: "option" %> <%= button_to "Nothing! I get an error.", wizard_path, name: :rails_version, method: :put, class: "option" %>