lib/jets/commands/upgrade.rb in jets-1.6.1 vs lib/jets/commands/upgrade.rb in jets-1.6.2

- old
+ new

@@ -22,11 +22,11 @@ def environment_configs path = File.expand_path("templates/skeleton/config/environments", File.dirname(__FILE__)) puts "path #{path}" Dir.glob("#{path}/*").each do |src| config_file = "config/environments/#{File.basename(src)}" - dest = "#{Jets.root}#{config_file}" + dest = "#{Jets.root}/#{config_file}" puts "src #{src}" puts "dest #{dest}" unless File.exist?(dest) puts "Create: #{config_file}" @@ -35,11 +35,11 @@ end end end def update_routes - routes_file = "#{Jets.root}config/routes.rb" + routes_file = "#{Jets.root}/config/routes.rb" return unless File.exist?(routes_file) lines = IO.readlines(routes_file) deprecated_code = 'root "jets/welcome#index"' return unless lines.detect { |l| l.include?(deprecated_code) } @@ -56,11 +56,11 @@ content = lines.join IO.write(routes_file, content) end def update_mode_setting - application_file = "#{Jets.root}config/application.rb" + application_file = "#{Jets.root}/config/application.rb" lines = IO.readlines(application_file) deprecated_code = 'config.api_generator' return unless lines.detect { |l| l.include?(deprecated_code) } puts "Update: config/application.rb" @@ -76,22 +76,22 @@ content = lines.join IO.write(application_file, content) end def update_config_ru - config_ru = File.read("#{Jets.root}config.ru") + config_ru = File.read("#{Jets.root}/config.ru") return if config_ru.include?("Jets.boot") src = File.expand_path("templates/skeleton/config.ru", File.dirname(__FILE__)) - dest = "#{Jets.root}config.ru" + dest = "#{Jets.root}/config.ru" puts "Update: config.ru" FileUtils.cp(src, dest) end def remove_ruby_lazy_load - app_config = "#{Jets.root}config/application.rb" + app_config = "#{Jets.root}/config/application.rb" remove_ruby_lazy_load_for(app_config) - Dir.glob("#{Jets.root}config/environments/*.rb").each do |env_config| + Dir.glob("#{Jets.root}/config/environments/*.rb").each do |env_config| remove_ruby_lazy_load_for(env_config) end end def remove_ruby_lazy_load_for(path)