diff options
Diffstat (limited to 'guides/code/getting_started')
12 files changed, 108 insertions, 105 deletions
| diff --git a/guides/code/getting_started/Gemfile b/guides/code/getting_started/Gemfile index eef6180804..c3d7e96c4d 100644 --- a/guides/code/getting_started/Gemfile +++ b/guides/code/getting_started/Gemfile @@ -1,43 +1,40 @@  source 'https://rubygems.org' -gem 'rails', '4.0.0' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '4.1.0'  # Use sqlite3 as the database for Active Record  gem 'sqlite3' -  # Use SCSS for stylesheets -gem 'sass-rails' - +gem 'sass-rails', '~> 4.0.1' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0'  # Use CoffeeScript for .js.coffee assets and views -gem 'coffee-rails' - +gem 'coffee-rails', '~> 4.0.0'  # See https://github.com/sstephenson/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby - -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.0.3' +# gem 'therubyracer',  platforms: :ruby +# Use jquery as the JavaScript library  gem 'jquery-rails' -  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks  gem 'turbolinks' - -group :doc do -  # bundle exec rake doc:rails generates the API under doc/api. -  gem 'sdoc', require: false -end -  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 1.2' +gem 'jbuilder', '~> 2.0' +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', '~> 0.4.0',          group: :doc -# To use ActiveModel has_secure_password -# gem 'bcrypt-ruby', '~> 3.1.2' +# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring +gem 'spring',        group: :development + +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7'  # Use unicorn as the app server  # gem 'unicorn' -# Deploy with Capistrano -# gem 'capistrano', group: :development +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +# Use debugger +# gem 'debugger', group: [:development, :test] -# To use debugger -# gem 'debugger' diff --git a/guides/code/getting_started/Gemfile.lock b/guides/code/getting_started/Gemfile.lock index 2d5c50ef5c..a2ab76c908 100644 --- a/guides/code/getting_started/Gemfile.lock +++ b/guides/code/getting_started/Gemfile.lock @@ -1,120 +1,126 @@  GEM    remote: https://rubygems.org/    specs: -    actionmailer (4.0.0) -      actionpack (= 4.0.0) -      mail (~> 2.5.3) -    actionpack (4.0.0) -      activesupport (= 4.0.0) -      builder (~> 3.1.0) -      erubis (~> 2.7.0) +    actionmailer (4.1.0) +      actionpack (= 4.1.0) +      actionview (= 4.1.0) +      mail (~> 2.5.4) +    actionpack (4.1.0) +      actionview (= 4.1.0) +      activesupport (= 4.1.0)        rack (~> 1.5.2)        rack-test (~> 0.6.2) -    activemodel (4.0.0) -      activesupport (= 4.0.0) -      builder (~> 3.1.0) -    activerecord (4.0.0) -      activemodel (= 4.0.0) -      activerecord-deprecated_finders (~> 1.0.2) -      activesupport (= 4.0.0) -      arel (~> 4.0.0) -    activerecord-deprecated_finders (1.0.3) -    activesupport (4.0.0) -      i18n (~> 0.6, >= 0.6.4) -      minitest (~> 4.2) -      multi_json (~> 1.3) +    actionview (4.1.0) +      activesupport (= 4.1.0) +      builder (~> 3.1) +      erubis (~> 2.7.0) +    activemodel (4.1.0) +      activesupport (= 4.1.0) +      builder (~> 3.1) +    activerecord (4.1.0) +      activemodel (= 4.1.0) +      activesupport (= 4.1.0) +      arel (~> 5.0.0) +    activesupport (4.1.0) +      i18n (~> 0.6, >= 0.6.9) +      json (~> 1.7, >= 1.7.7) +      minitest (~> 5.1)        thread_safe (~> 0.1) -      tzinfo (~> 0.3.37) -    arel (4.0.0) -    atomic (1.1.10) -    builder (3.1.4) -    coffee-rails (4.0.0) +      tzinfo (~> 1.1) +    arel (5.0.0) +    atomic (1.1.14) +    builder (3.2.2) +    coffee-rails (4.0.1)        coffee-script (>= 2.2.0) -      railties (>= 4.0.0.beta, < 5.0) +      railties (>= 4.0.0, < 5.0)      coffee-script (2.2.0)        coffee-script-source        execjs      coffee-script-source (1.6.3)      erubis (2.7.0) -    execjs (1.4.0) -      multi_json (~> 1.0) +    execjs (2.0.2)      hike (1.2.3) -    i18n (0.6.4) -    jbuilder (1.4.2) +    i18n (0.6.9) +    jbuilder (2.0.2)        activesupport (>= 3.0.0)        multi_json (>= 1.2.0) -    jquery-rails (3.0.2) +    jquery-rails (3.0.4)        railties (>= 3.0, < 5.0)        thor (>= 0.14, < 2.0) -    json (1.8.0) +    json (1.8.1)      mail (2.5.4)        mime-types (~> 1.16)        treetop (~> 1.4.8) -    mime-types (1.23) -    minitest (4.7.5) -    multi_json (1.7.7) +    mime-types (1.25.1) +    minitest (5.2.1) +    multi_json (1.8.4)      polyglot (0.3.3)      rack (1.5.2)      rack-test (0.6.2)        rack (>= 1.0) -    rails (4.0.0) -      actionmailer (= 4.0.0) -      actionpack (= 4.0.0) -      activerecord (= 4.0.0) -      activesupport (= 4.0.0) +    rails (4.1.0) +      actionmailer (= 4.1.0) +      actionpack (= 4.1.0) +      actionview (= 4.1.0) +      activemodel (= 4.1.0) +      activerecord (= 4.1.0) +      activesupport (= 4.1.0)        bundler (>= 1.3.0, < 2.0) -      railties (= 4.0.0) +      railties (= 4.1.0)        sprockets-rails (~> 2.0.0) -    railties (4.0.0) -      actionpack (= 4.0.0) -      activesupport (= 4.0.0) +    railties (4.1.0) +      actionpack (= 4.1.0) +      activesupport (= 4.1.0)        rake (>= 0.8.7)        thor (>= 0.18.1, < 2.0) -    rake (10.1.0) -    rdoc (3.12.2) +    rake (10.1.1) +    rdoc (4.1.1)        json (~> 1.4) -    sass (3.2.9) -    sass-rails (4.0.0) -      railties (>= 4.0.0.beta, < 5.0) +    sass (3.2.13) +    sass-rails (4.0.1) +      railties (>= 4.0.0, < 5.0)        sass (>= 3.1.10)        sprockets-rails (~> 2.0.0) -    sdoc (0.3.20) -      json (>= 1.1.3) -      rdoc (~> 3.10) -    sprockets (2.10.0) +    sdoc (0.4.0) +      json (~> 1.8) +      rdoc (~> 4.0, < 5.0) +    spring (1.0.0) +    sprockets (2.10.1)        hike (~> 1.2)        multi_json (~> 1.0)        rack (~> 1.0)        tilt (~> 1.1, != 1.3.0) -    sprockets-rails (2.0.0) +    sprockets-rails (2.0.1)        actionpack (>= 3.0)        activesupport (>= 3.0)        sprockets (~> 2.8) -    sqlite3 (1.3.7) +    sqlite3 (1.3.8)      thor (0.18.1) -    thread_safe (0.1.0) +    thread_safe (0.1.3)        atomic      tilt (1.4.1) -    treetop (1.4.14) +    treetop (1.4.15)        polyglot        polyglot (>= 0.3.1) -    turbolinks (1.2.0) +    turbolinks (2.2.0)        coffee-rails -    tzinfo (0.3.37) -    uglifier (2.1.1) +    tzinfo (1.1.0) +      thread_safe (~> 0.1) +    uglifier (2.4.0)        execjs (>= 0.3.0) -      multi_json (~> 1.0, >= 1.0.2) +      json (>= 1.8.0)  PLATFORMS    ruby  DEPENDENCIES -  coffee-rails -  jbuilder (~> 1.2) +  coffee-rails (~> 4.0.0) +  jbuilder (~> 2.0)    jquery-rails -  rails (= 4.0.0) -  sass-rails -  sdoc +  rails (= 4.1.0) +  sass-rails (~> 4.0.1) +  sdoc (~> 0.4.0) +  spring    sqlite3    turbolinks -  uglifier (>= 1.0.3) +  uglifier (>= 1.3.0) diff --git a/guides/code/getting_started/Rakefile b/guides/code/getting_started/Rakefile index 05de8bb536..ba6b733dd2 100644 --- a/guides/code/getting_started/Rakefile +++ b/guides/code/getting_started/Rakefile @@ -3,4 +3,4 @@  require File.expand_path('../config/application', __FILE__) -Blog::Application.load_tasks +Rails.application.load_tasks diff --git a/guides/code/getting_started/app/views/layouts/application.html.erb b/guides/code/getting_started/app/views/layouts/application.html.erb index 95368c37a3..d0ba8415e6 100644 --- a/guides/code/getting_started/app/views/layouts/application.html.erb +++ b/guides/code/getting_started/app/views/layouts/application.html.erb @@ -2,8 +2,8 @@  <html>  <head>    <title>Blog</title> -  <%= stylesheet_link_tag    "application", media: "all", "data-turbolinks-track" => true %> -  <%= javascript_include_tag "application", "data-turbolinks-track" => true %> +  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %> +  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>    <%= csrf_meta_tags %>  </head>  <body> diff --git a/guides/code/getting_started/config.ru b/guides/code/getting_started/config.ru index ddf869e921..5bc2a619e8 100644 --- a/guides/code/getting_started/config.ru +++ b/guides/code/getting_started/config.ru @@ -1,4 +1,4 @@  # This file is used by Rack-based servers to start the application.  require ::File.expand_path('../config/environment',  __FILE__) -run Blog::Application +run Rails.application diff --git a/guides/code/getting_started/config/environment.rb b/guides/code/getting_started/config/environment.rb index e7e341c960..ee8d90dc65 100644 --- a/guides/code/getting_started/config/environment.rb +++ b/guides/code/getting_started/config/environment.rb @@ -2,4 +2,4 @@  require File.expand_path('../application', __FILE__)  # Initialize the Rails application. -Blog::Application.initialize! +Rails.application.initialize! diff --git a/guides/code/getting_started/config/environments/development.rb b/guides/code/getting_started/config/environments/development.rb index 7e5692b08b..ae9ffe209a 100644 --- a/guides/code/getting_started/config/environments/development.rb +++ b/guides/code/getting_started/config/environments/development.rb @@ -1,4 +1,4 @@ -Blog::Application.configure do +Rails.application.configure do    # Settings specified here will take precedence over those in config/application.rb.    # In the development environment your application's code is reloaded on diff --git a/guides/code/getting_started/config/environments/production.rb b/guides/code/getting_started/config/environments/production.rb index 368a735122..c8ae858574 100644 --- a/guides/code/getting_started/config/environments/production.rb +++ b/guides/code/getting_started/config/environments/production.rb @@ -1,11 +1,11 @@ -Blog::Application.configure do +Rails.application.configure do    # Settings specified here will take precedence over those in config/application.rb.    # Code is not reloaded between requests.    config.cache_classes = true    # Eager load code on boot. This eager loads most of Rails and -  # your application in memory, allowing both thread web servers +  # your application in memory, allowing both threaded web servers    # and those relying on copy on write to perform better.    # Rake tasks automatically ignore this option for performance.    config.eager_load = true @@ -66,7 +66,7 @@ Blog::Application.configure do    # config.action_mailer.raise_delivery_errors = false    # Enable locale fallbacks for I18n (makes lookups for any locale fall back to -  # the I18n.default_locale when a translation can not be found). +  # the I18n.default_locale when a translation cannot be found).    config.i18n.fallbacks = true    # Send deprecation notices to registered listeners. diff --git a/guides/code/getting_started/config/environments/test.rb b/guides/code/getting_started/config/environments/test.rb index 00adaa5015..680d0b9e06 100644 --- a/guides/code/getting_started/config/environments/test.rb +++ b/guides/code/getting_started/config/environments/test.rb @@ -1,4 +1,4 @@ -Blog::Application.configure do +Rails.application.configure do    # Settings specified here will take precedence over those in config/application.rb.    # The test environment is used exclusively to run your application's @@ -14,7 +14,7 @@ Blog::Application.configure do    # Configure static asset server for tests with Cache-Control for performance.    config.serve_static_assets = true -  config.static_cache_control = "public, max-age=3600" +  config.static_cache_control = 'public, max-age=3600'    # Show full error reports and disable caching.    config.consider_all_requests_local       = true diff --git a/guides/code/getting_started/config/initializers/secret_token.rb b/guides/code/getting_started/config/initializers/secret_token.rb index aaf57731be..c2a549c299 100644 --- a/guides/code/getting_started/config/initializers/secret_token.rb +++ b/guides/code/getting_started/config/initializers/secret_token.rb @@ -9,4 +9,4 @@  # Make sure your secret_key_base is kept private  # if you're sharing your code publicly. -Blog::Application.config.secret_key_base = 'e8aab50cec8a06a75694111a4cbaf6e22fc288ccbc6b268683aae7273043c69b15ca07d10c92a788dd6077a54762cbfcc55f19c3459f7531221b3169f8171a53' +Rails.application.config.secret_key_base = 'e8aab50cec8a06a75694111a4cbaf6e22fc288ccbc6b268683aae7273043c69b15ca07d10c92a788dd6077a54762cbfcc55f19c3459f7531221b3169f8171a53' diff --git a/guides/code/getting_started/config/initializers/session_store.rb b/guides/code/getting_started/config/initializers/session_store.rb index 3b2ca93ab9..1b9fa324d4 100644 --- a/guides/code/getting_started/config/initializers/session_store.rb +++ b/guides/code/getting_started/config/initializers/session_store.rb @@ -1,3 +1,3 @@  # Be sure to restart your server when you modify this file. -Blog::Application.config.session_store :cookie_store, key: '_blog_session' +Rails.application.config.session_store :cookie_store, key: '_blog_session' diff --git a/guides/code/getting_started/config/routes.rb b/guides/code/getting_started/config/routes.rb index 0155b613a3..65d273b58d 100644 --- a/guides/code/getting_started/config/routes.rb +++ b/guides/code/getting_started/config/routes.rb @@ -1,4 +1,4 @@ -Blog::Application.routes.draw do +Rails.application.routes.draw do    resources :posts do      resources :comments    end | 
