lib/railsthemes/theme_installer.rb in railsthemes-2.0.0 vs lib/railsthemes/theme_installer.rb in railsthemes-2.0.1

- old
+ new

@@ -35,10 +35,11 @@ ['doc', ''], ['images', 'app/assets'], ['mailers', 'app'], ['views', 'app'], ['fonts', 'app/assets'], + ['vendor', ''], ] logger.warn 'Done installing.' return Utils.read_file(File.join(source_filepath, 'theme_name')).chomp end @@ -60,21 +61,25 @@ def basic_route_lines output = <<-EOS ### Begin RailsThemes basic generated routes ### + # Routes to RailsThemes Theme Example markup: - unless Rails.env.production? - get 'railsthemes', controller: :railsthemes, action: :index - match 'railsthemes/:action', controller: :railsthemes, via: [:get, :post] + namespace :railsthemes do + match '/' => 'railsthemes#index' + match '/previews', controller: :previews, action: :index + match '/previews/:name', controller: :previews, action: :show + match '/previews/:feature/:partial', controller: :previews, action: :partial + match '/:action', controller: :railsthemes end # This is magical routing for errors (instead of using the static markup in # public/*.html) - get '/403', to: 'railsthemes_errors#403_forbidden' - get '/404', to: 'railsthemes_errors#404_not_found' - get '/500', to: 'railsthemes_errors#500_internal_server_error' + match '/403', to: 'railsthemes_errors#403_forbidden' + match '/404', to: 'railsthemes_errors#404_not_found' + match '/500', to: 'railsthemes_errors#500_internal_server_error' ### End RailsThemes basic generated routes ### EOS output.split("\n") end @@ -86,11 +91,11 @@ if lines.grep(/Begin RailsThemes basic generated routes/).count == 0 lines_to_insert += basic_route_lines end if lines.grep(/^\s*root /).count == 0 - lines_to_insert << ' root :to => "railsthemes#index"' + lines_to_insert << ' root :to => "railsthemes/railsthemes#index"' end logger.warn 'Creating basic RailsThemes routes...' Utils.insert_into_routes_file! lines_to_insert logger.warn 'Done creating basic RailsThemes routes.' @@ -98,10 +103,14 @@ # General assumption is `bundler check` is always clean prior to installation (via ensurer), # so if the gemspecs are in the Gemfile.lock, then the gem is in the Gemfile def add_needed_gems installed_gems = Utils.gemspecs.map(&:name) - ['sass', 'jquery-rails', 'jquery-ui-rails'].each do |gemname| + ['sass', + 'jquery-rails', + 'jquery-ui-rails', + 'coderay', + ].each do |gemname| Utils.add_gem_to_gemfile gemname unless installed_gems.include?(gemname) end unless installed_gems.include?('compass-rails') Utils.add_gem_to_gemfile('compass-rails', :group => 'assets')