diff --git a/.gitignore b/.gitignore index af87fb2..4b8c7e6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ .ruby-version .ruby-gemset + +*.sublime-workspace diff --git a/Gemfile b/Gemfile index b11143e..8d623da 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ source 'https://rubygems.org' -ruby "2.1.0" -gem 'rails', '4.0.2' +gem 'rails', '~> 4.1.15' gem 'coffee-rails' gem 'decent_exposure' @@ -22,6 +21,10 @@ group :test, :development do end group :development do + gem 'quiet_assets' gem 'better_errors' gem 'binding_of_caller' end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock index 5209669..67c7343 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,142 +1,158 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) - mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - erubis (~> 2.7.0) + actionmailer (4.1.15) + actionpack (= 4.1.15) + actionview (= 4.1.15) + mail (~> 2.5, >= 2.5.4) + actionpack (4.1.15) + actionview (= 4.1.15) + activesupport (= 4.1.15) rack (~> 1.5.2) rack-test (~> 0.6.2) - activemodel (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) + actionview (4.1.15) + activesupport (= 4.1.15) + builder (~> 3.1) + erubis (~> 2.7.0) + activemodel (4.1.15) + activesupport (= 4.1.15) + builder (~> 3.1) + activerecord (4.1.15) + activemodel (= 4.1.15) + activesupport (= 4.1.15) + arel (~> 5.0.0) + activesupport (4.1.15) + 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.2) - atomic (1.1.16) - better_errors (1.1.0) + tzinfo (~> 1.1) + arel (5.0.1.20140414130214) + better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) + rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - builder (3.1.4) - coderay (1.1.0) - coffee-rails (4.0.1) + builder (3.2.2) + coderay (1.1.1) + coffee-rails (4.1.1) coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.0) - coffee-script (2.2.0) + railties (>= 4.0.0, < 5.1.x) + coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.7.0) + coffee-script-source (1.10.0) + concurrent-ruby (1.0.1) debug_inspector (0.0.2) - decent_exposure (2.3.1) - dotenv (0.11.1) - dotenv-deployment (~> 0.0.2) - dotenv-deployment (0.0.2) - dotenv-rails (0.11.1) - dotenv (= 0.11.1) + decent_exposure (2.3.3) + dotenv (2.1.0) + dotenv-rails (2.1.0) + dotenv (= 2.1.0) + railties (>= 4.0, < 5.1) erubis (2.7.0) - execjs (2.0.2) - haml (4.0.5) + execjs (2.6.0) + haml (4.0.7) tilt - haml-rails (0.5.3) + haml-rails (0.9.0) actionpack (>= 4.0.1) activesupport (>= 4.0.1) - haml (>= 3.1, < 5.0) + haml (>= 4.0.6, < 5.0) + html2haml (>= 1.0.1) railties (>= 4.0.1) - hike (1.2.3) - i18n (0.6.9) - jbuilder (1.5.3) - activesupport (>= 3.0.0) - multi_json (>= 1.2.0) - jquery-rails (3.1.0) + html2haml (2.0.0) + erubis (~> 2.7.0) + haml (~> 4.0.0) + nokogiri (~> 1.6.0) + ruby_parser (~> 3.5) + i18n (0.7.0) + jbuilder (2.4.1) + activesupport (>= 3.0.0, < 5.1) + multi_json (~> 1.2) + jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.1) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) + json (1.8.3) + mail (2.6.3) + mime-types (>= 1.16, < 3) method_source (0.8.2) - mime-types (1.25.1) - minitest (4.7.5) - multi_json (1.9.2) - pg (0.17.1) - polyglot (0.3.4) - pry (0.9.12.6) - coderay (~> 1.0) - method_source (~> 0.8) + mime-types (2.99.1) + mini_portile2 (2.0.0) + minitest (5.8.4) + multi_json (1.11.2) + nokogiri (1.6.7.2) + mini_portile2 (~> 2.0.0.rc2) + nokogiri (1.6.7.2-x86-mingw32) + mini_portile2 (~> 2.0.0.rc2) + pg (0.18.4) + pg (0.18.4-x86-mingw32) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) slop (~> 3.4) - pry-rails (0.3.2) + pry-rails (0.3.4) pry (>= 0.9.10) - puma (2.8.1) - rack (>= 1.1, < 2.0) - rack (1.5.2) - rack-test (0.6.2) + puma (3.1.1) + quiet_assets (1.1.0) + railties (>= 3.1, < 5.0) + rack (1.5.5) + rack-test (0.6.3) rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) + rails (4.1.15) + actionmailer (= 4.1.15) + actionpack (= 4.1.15) + actionview (= 4.1.15) + activemodel (= 4.1.15) + activerecord (= 4.1.15) + activesupport (= 4.1.15) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) - sprockets-rails (~> 2.0.0) - rails_12factor (0.0.2) + railties (= 4.1.15) + sprockets-rails (~> 2.0) + rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging - rails_serve_static_assets (0.0.2) - rails_stdout_logging (0.0.3) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.4) + railties (4.1.15) + actionpack (= 4.1.15) + activesupport (= 4.1.15) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.2.0) - redcarpet (3.1.1) - rouge (1.3.3) - sass (3.2.18) - sass-rails (4.0.2) + rake (11.1.1) + redcarpet (3.3.4) + rouge (1.10.1) + ruby_parser (3.8.1) + sexp_processor (~> 4.1) + sass (3.4.21) + sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) - sass (~> 3.2.0) - sprockets (~> 2.8, <= 2.11.0) - sprockets-rails (~> 2.0.0) - slop (3.5.0) - sprockets (2.11.0) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + sexp_processor (4.7.0) + slop (3.6.0) + sprockets (3.5.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) - sprockets (~> 2.8) + sprockets (>= 2.8, < 4.0) thor (0.19.1) - thread_safe (0.3.1) - atomic (>= 1.1.7, < 2) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.39) - uglifier (2.5.0) + thread_safe (0.3.5) + tilt (2.0.2) + tzinfo (1.2.2) + thread_safe (~> 0.1) + tzinfo-data (1.2016.2) + tzinfo (>= 1.0.0) + uglifier (2.7.2) execjs (>= 0.3.0) json (>= 1.8.0) PLATFORMS ruby + x86-mingw32 DEPENDENCIES better_errors @@ -150,9 +166,14 @@ DEPENDENCIES pg pry-rails puma - rails (= 4.0.2) + quiet_assets + rails (~> 4.1.15) rails_12factor redcarpet rouge sass-rails + tzinfo-data uglifier + +BUNDLED WITH + 1.11.2 diff --git a/app/assets/stylesheets/toggle.css.scss b/app/assets/stylesheets/toggle.scss similarity index 100% rename from app/assets/stylesheets/toggle.css.scss rename to app/assets/stylesheets/toggle.scss diff --git a/config/application.rb b/config/application.rb index 8c9d90f..9082d4d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,7 +4,7 @@ # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) +Bundler.require(*Rails.groups) module EmberTutorial class Application < Rails::Application diff --git a/config/boot.rb b/config/boot.rb index 3596736..5e5f0c1 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,4 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/environment.rb b/config/environment.rb index d7030ee..ee8d90d 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,4 +2,4 @@ require File.expand_path('../application', __FILE__) # Initialize the Rails application. -EmberTutorial::Application.initialize! +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 071faea..ddf0e90 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -EmberTutorial::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 @@ -19,11 +19,19 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations + # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index adceca9..b93a877 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,11 +1,11 @@ -EmberTutorial::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 @@ -20,20 +20,19 @@ # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = true + config.serve_static_assets = false # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = true + config.assets.compile = false # Generate digests for assets URLs. config.assets.digest = true - # Version of your assets, change this if you want to expire all your assets. - config.assets.version = '1.0' + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache @@ -57,16 +56,12 @@ # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = "http://assets.example.com" - # Precompile additional assets. - # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. - # config.assets.precompile += %w( search.js ) - # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. # 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. @@ -77,4 +72,7 @@ # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 11e60ae..053f5b6 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -EmberTutorial::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 @@ # 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 @@ -33,4 +33,7 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb new file mode 100644 index 0000000..d2f4ec3 --- /dev/null +++ b/config/initializers/assets.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. +# Rails.application.config.assets.precompile += %w( search.js ) diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..719a617 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :marshal \ No newline at end of file diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 72aca7e..dc18996 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,4 +2,3 @@ # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index bc99110..0000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -EmberTutorial::Application.config.secret_key_base = '9e2f68bdbbeb5f278dc6bbdda66e6194133fd22d7c9f86d28ff3e4ee874d4c5d3d97e011cdceeea731e8a617ca977ee8288677be2b687a1002d70c1b93c912b4' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 468ba7d..2cae6a6 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -EmberTutorial::Application.config.session_store :cookie_store, key: '_ember-tutorial_session' +Rails.application.config.session_store :cookie_store, key: '_ember-tutorial_session' diff --git a/config/routes.rb b/config/routes.rb index b56723c..94b62e0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,6 @@ -EmberTutorial::Application.routes.draw do +Rails.application.routes.draw do + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". root to: 'home#index' get 'chapters', to: 'home#chapters' diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..0be10d9 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 9e2f68bdbbeb5f278dc6bbdda66e6194133fd22d7c9f86d28ff3e4ee874d4c5d3d97e011cdceeea731e8a617ca977ee8288677be2b687a1002d70c1b93c912b4 + +test: + secret_key_base: dcf16739be080fd10926696764869abe2b72ae122879d2a485594f8aeb45a9ba420796cfef8ef1c62ddb2849936173052cad716f8776ca6076568926fc94a74c + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/ember-tutorial.sublime-project b/ember-tutorial.sublime-project new file mode 100644 index 0000000..c340217 --- /dev/null +++ b/ember-tutorial.sublime-project @@ -0,0 +1,15 @@ +{ + "folders": + [ + { + "path": ".", + "folder_exclude_patterns": [".bundle",".idea","tmp","log","public/assets"], + "file_exclude_patterns": ["*.sublime-workspace","*.sqlite3"] + } + ], + "settings": + { + "translate_tabs_to_spaces": true, + "tab_size": 2 + } +}