diff --git a/getting-started/bookshelf/Gemfile b/getting-started/bookshelf/Gemfile index 421bf48d7..a36b97ff6 100644 --- a/getting-started/bookshelf/Gemfile +++ b/getting-started/bookshelf/Gemfile @@ -20,9 +20,11 @@ ruby ">= 2.5" gem "google-cloud-error_reporting" gem "google-cloud-firestore", "~> 2.0" gem "google-cloud-storage", "~> 1.10" -gem "rails", "~> 5.2.3" +gem "rails", "~> 7.0" gem "jquery-rails" +gem "sprockets-rails", require: "sprockets/railtie" + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/getting-started/bookshelf/Gemfile.lock b/getting-started/bookshelf/Gemfile.lock new file mode 100644 index 000000000..a34c6fc2d --- /dev/null +++ b/getting-started/bookshelf/Gemfile.lock @@ -0,0 +1,461 @@ +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + actionmailer (7.2.2.2) + actionpack (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activesupport (= 7.2.2.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.2.2) + actionview (= 7.2.2.2) + activesupport (= 7.2.2.2) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.2) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.2.2) + actionpack (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.2.2) + activesupport (= 7.2.2.2) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.2.2) + activesupport (= 7.2.2.2) + globalid (>= 0.3.6) + activemodel (7.2.2.2) + activesupport (= 7.2.2.2) + activerecord (7.2.2.2) + activemodel (= 7.2.2.2) + activesupport (= 7.2.2.2) + timeout (>= 0.4.0) + activestorage (7.2.2.2) + actionpack (= 7.2.2.2) + activejob (= 7.2.2.2) + activerecord (= 7.2.2.2) + activesupport (= 7.2.2.2) + marcel (~> 1.0) + activesupport (7.2.2.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.2.2) + bindex (0.8.1) + builder (3.3.0) + byebug (12.0.0) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) + crass (1.0.6) + cuprite (0.17) + capybara (~> 3.0) + ferrum (~> 0.17.0) + date (3.4.1) + declarative (0.0.20) + diff-lcs (1.6.2) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + drb (2.2.3) + erb (5.0.2) + erubi (1.13.1) + faraday (2.13.4) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-follow_redirects (0.3.0) + faraday (>= 1, < 3) + faraday-net_http (3.4.1) + net-http (>= 0.5.0) + faraday-retry (2.3.2) + faraday (~> 2.0) + ferrum (0.17.1) + addressable (~> 2.5) + base64 (~> 0.2) + concurrent-ruby (~> 1.1) + webrick (~> 1.7) + websocket-driver (~> 0.7) + ffi (1.17.2-aarch64-linux-gnu) + ffi (1.17.2-aarch64-linux-musl) + ffi (1.17.2-arm-linux-gnu) + ffi (1.17.2-arm-linux-musl) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-darwin) + ffi (1.17.2-x86_64-linux-gnu) + ffi (1.17.2-x86_64-linux-musl) + gapic-common (1.1.0) + faraday (>= 1.9, < 3.a) + faraday-retry (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + google-protobuf (>= 3.25, < 5.a) + googleapis-common-protos (~> 1.6) + googleapis-common-protos-types (~> 1.15) + googleauth (~> 1.12) + grpc (~> 1.66) + globalid (1.1.0) + activesupport (>= 5.0) + google-apis-core (1.0.1) + addressable (~> 2.8, >= 2.8.7) + faraday (~> 2.13) + faraday-follow_redirects (~> 0.3) + googleauth (~> 1.14) + mini_mime (~> 1.1) + representable (~> 3.0) + retriable (~> 3.1) + google-apis-iamcredentials_v1 (0.24.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-storage_v1 (0.55.0) + google-apis-core (>= 0.15.0, < 2.a) + google-cloud-core (1.8.0) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (2.3.1) + base64 (~> 0.2) + faraday (>= 1.0, < 3.a) + google-cloud-error_reporting (0.44.0) + concurrent-ruby (~> 1.1) + google-cloud-core (~> 1.5) + google-cloud-error_reporting-v1beta1 (~> 0.0) + stackdriver-core (~> 1.3) + google-cloud-error_reporting-v1beta1 (0.14.0) + gapic-common (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-errors (1.5.0) + google-cloud-firestore (2.16.1) + bigdecimal (~> 3.0) + concurrent-ruby (~> 1.0) + google-cloud-core (~> 1.5) + google-cloud-firestore-v1 (>= 0.10, < 2.a) + rbtree (~> 0.4.2) + google-cloud-firestore-v1 (1.3.0) + gapic-common (>= 0.25.0, < 2.a) + google-cloud-errors (~> 1.0) + google-cloud-location (>= 0.7, < 2.a) + google-cloud-location (1.1.0) + gapic-common (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-storage (1.57.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-core (>= 0.18, < 2) + google-apis-iamcredentials_v1 (~> 0.18) + google-apis-storage_v1 (>= 0.42) + google-cloud-core (~> 1.6) + googleauth (~> 1.9) + mini_mime (~> 1.0) + google-logging-utils (0.2.0) + google-protobuf (4.32.0) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-aarch64-linux-gnu) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-aarch64-linux-musl) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-x86_64-linux-gnu) + bigdecimal + rake (>= 13) + google-protobuf (4.32.0-x86_64-linux-musl) + bigdecimal + rake (>= 13) + googleapis-common-protos (1.8.0) + google-protobuf (>= 3.18, < 5.a) + googleapis-common-protos-types (~> 1.20) + grpc (~> 1.41) + googleapis-common-protos-types (1.20.0) + google-protobuf (>= 3.18, < 5.a) + googleauth (1.14.0) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + grpc (1.74.1) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-aarch64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-aarch64-linux-musl) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-arm64-darwin) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-x86_64-darwin) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-x86_64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + grpc (1.74.1-x86_64-linux-musl) + google-protobuf (>= 3.25, < 5.0) + googleapis-common-protos-types (~> 1.0) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-console (0.8.1) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jquery-rails (4.6.0) + rails-dom-testing (>= 1, < 3) + railties (>= 4.2.0) + thor (>= 0.14, < 2.0) + json (2.13.2) + jwt (2.10.2) + base64 + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + loofah (2.24.1) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.3) + mini_mime (1.1.5) + minitest (5.25.5) + multi_json (1.17.0) + net-http (0.6.0) + uri + net-imap (0.5.9) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.4) + nokogiri (1.18.9-aarch64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.9-aarch64-linux-musl) + racc (~> 1.4) + nokogiri (1.18.9-arm-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.9-arm-linux-musl) + racc (~> 1.4) + nokogiri (1.18.9-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.9-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.18.9-x86_64-linux-gnu) + racc (~> 1.4) + nokogiri (1.18.9-x86_64-linux-musl) + racc (~> 1.4) + os (1.1.4) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.6) + date + stringio + public_suffix (6.0.2) + racc (1.8.1) + rack (2.2.17) + rack-session (1.0.2) + rack (< 3) + rack-test (2.2.0) + rack (>= 1.3) + rackup (1.0.1) + rack (< 3) + webrick + rails (7.2.2.2) + actioncable (= 7.2.2.2) + actionmailbox (= 7.2.2.2) + actionmailer (= 7.2.2.2) + actionpack (= 7.2.2.2) + actiontext (= 7.2.2.2) + actionview (= 7.2.2.2) + activejob (= 7.2.2.2) + activemodel (= 7.2.2.2) + activerecord (= 7.2.2.2) + activestorage (= 7.2.2.2) + activesupport (= 7.2.2.2) + bundler (>= 1.15.0) + railties (= 7.2.2.2) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.2.2.2) + actionpack (= 7.2.2.2) + activesupport (= 7.2.2.2) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.3.0) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rbtree (0.4.6) + rdoc (6.14.2) + erb + psych (>= 4.0.0) + regexp_parser (2.11.2) + reline (0.6.2) + io-console (~> 0.5) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rspec-core (3.13.5) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-retry (0.6.2) + rspec-core (> 3.3) + rspec-support (3.13.4) + rspec_junit_formatter (0.6.0) + rspec-core (>= 2, < 4, != 2.12.0) + securerandom (0.4.1) + signet (0.20.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) + sprockets (>= 3.0.0) + stackdriver-core (1.7.0) + google-cloud-core (~> 1.2) + stringio (3.1.7) + thor (1.4.0) + timeout (0.4.3) + trailblazer-option (0.1.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uber (0.1.0) + uri (1.0.3) + useragent (0.16.11) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + webrick (1.9.1) + websocket-driver (0.8.0) + base64 + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.7.3) + +PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + byebug + capybara + cuprite + google-cloud-error_reporting + google-cloud-firestore (~> 2.0) + google-cloud-storage (~> 1.10) + jquery-rails + listen (>= 3.0.5, < 3.8.1) + rack-test + rails (~> 7.0) + rspec-rails + rspec-retry + rspec_junit_formatter + sprockets-rails + tzinfo-data + web-console (>= 3.3.0) + +RUBY VERSION + ruby 3.2.1p31 + +BUNDLED WITH + 2.6.3 diff --git a/getting-started/bookshelf/app/controllers/books_controller.rb b/getting-started/bookshelf/app/controllers/books_controller.rb index 1dab4fa3e..83fd580fd 100644 --- a/getting-started/bookshelf/app/controllers/books_controller.rb +++ b/getting-started/bookshelf/app/controllers/books_controller.rb @@ -51,10 +51,12 @@ def update def create @book = Book.new book_params + debugger if @book.create flash[:success] = "Added Book" redirect_to book_path(@book) else + render :new end end diff --git a/getting-started/bookshelf/bin/setup b/getting-started/bookshelf/bin/setup index 439725034..905e92596 100755 --- a/getting-started/bookshelf/bin/setup +++ b/getting-started/bookshelf/bin/setup @@ -18,11 +18,11 @@ require "fileutils" # path to your application root. APP_ROOT = File.expand_path "..", __dir__ -def system! *args +def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -FileUtils.chdir APP_ROOT do +chdir APP_ROOT do # This script is a starting point to setup your application. # Add necessary setup steps to this file. @@ -30,13 +30,8 @@ FileUtils.chdir APP_ROOT do system! "gem install bundler --conservative" system("bundle check") || system!("bundle install") - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! "bin/rails db:setup" + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" diff --git a/getting-started/bookshelf/bin/update b/getting-started/bookshelf/bin/update new file mode 100755 index 000000000..6ed6f89e0 --- /dev/null +++ b/getting-started/bookshelf/bin/update @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby + +# Copyright 2019 Google LLC. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "fileutils" + +# path to your application root. +APP_ROOT = File.expand_path "..", __dir__ + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts "== Installing dependencies ==" + system! "gem install bundler --conservative" + system("bundle check") || system!("bundle install") + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + puts "\n== Removing old logs and tempfiles ==" + system! "bin/rails log:clear tmp:clear" + + puts "\n== Restarting application server ==" + system! "bin/rails restart" +end diff --git a/getting-started/bookshelf/bin/yarn b/getting-started/bookshelf/bin/yarn new file mode 100755 index 000000000..21b5496bc --- /dev/null +++ b/getting-started/bookshelf/bin/yarn @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby +# Copyright 2019 Google LLC. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +APP_ROOT = File.expand_path "..", __dir__ +Dir.chdir APP_ROOT do + begin + exec "yarnpkg", *ARGV + rescue Errno::ENOENT + warn "Yarn executable was not detected in the system." + warn "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/getting-started/bookshelf/config/application.rb b/getting-started/bookshelf/config/application.rb index c5e57745c..6256a8118 100644 --- a/getting-started/bookshelf/config/application.rb +++ b/getting-started/bookshelf/config/application.rb @@ -17,10 +17,14 @@ # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" -require "active_storage/engine" +# require "active_record/railtie" +# require "active_storage/engine" require "action_controller/railtie" +# require "action_mailer/railtie" require "action_view/railtie" +# require "action_cable/engine" require "sprockets/railtie" +require "rails/test_unit/railtie" require "google/cloud/error_reporting/rails" # Require the gems listed in Gemfile, including any gems @@ -36,8 +40,5 @@ class Application < Rails::Application # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. - - # Don't generate system test files. - config.generators.system_tests = nil end end diff --git a/getting-started/bookshelf/config/environments/development.rb b/getting-started/bookshelf/config/environments/development.rb index 21eab4173..ff8660a77 100644 --- a/getting-started/bookshelf/config/environments/development.rb +++ b/getting-started/bookshelf/config/environments/development.rb @@ -40,23 +40,16 @@ config.cache_store = :null_store end - # Store uploaded files on the local file system (see config/storage.yml for options) - # config.active_storage.service = :local - - # Don't care if the mailer can't send. - # config.action_mailer.raise_delivery_errors = false - - # config.action_mailer.perform_caching = false - # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations. - # config.active_record.migration_error = :page_load - - # Highlight code that triggered database queries in logs. - # config.active_record.verbose_query_logs = true + # 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 + # Suppress logger output for asset requests. + config.assets.quiet = true # Raises error for missing translations # config.action_view.raise_on_missing_translations = true diff --git a/getting-started/bookshelf/config/environments/production.rb b/getting-started/bookshelf/config/environments/production.rb index 73370a492..01d0f0ae9 100644 --- a/getting-started/bookshelf/config/environments/production.rb +++ b/getting-started/bookshelf/config/environments/production.rb @@ -35,6 +35,15 @@ # Apache or NGINX already handles this. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? + # 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 = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -42,14 +51,6 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options) - # config.active_storage.service = :local - - # Mount Action Cable outside main process or domain - # config.action_cable.mount_path = nil - # config.action_cable.url = 'wss://example.com/cable' - # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true @@ -67,12 +68,6 @@ # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "bookshelf_#{Rails.env}" - # config.action_mailer.perform_caching = false - - # 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 cannot be found). config.i18n.fallbacks = true @@ -92,7 +87,4 @@ logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new logger end - - # Do not dump schema after migrations. - # config.active_record.dump_schema_after_migration = false end diff --git a/getting-started/bookshelf/config/environments/test.rb b/getting-started/bookshelf/config/environments/test.rb index 35e28bdb7..188074772 100644 --- a/getting-started/bookshelf/config/environments/test.rb +++ b/getting-started/bookshelf/config/environments/test.rb @@ -41,16 +41,6 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory - config.active_storage.service = :test - - # config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - # config.action_mailer.delivery_method = :test - # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr diff --git a/getting-started/bookshelf/config/initializers/assets.rb b/getting-started/bookshelf/config/initializers/assets.rb new file mode 100644 index 000000000..cc02e9fdf --- /dev/null +++ b/getting-started/bookshelf/config/initializers/assets.rb @@ -0,0 +1,27 @@ +# Copyright 2019 Google LLC. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# 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" + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join("node_modules") + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/getting-started/bookshelf/config/initializers/inflections.rb b/getting-started/bookshelf/config/initializers/inflections.rb index 5ca2b1125..ac033bf9d 100644 --- a/getting-started/bookshelf/config/initializers/inflections.rb +++ b/getting-started/bookshelf/config/initializers/inflections.rb @@ -1,16 +1,3 @@ -# Copyright 2019 Google LLC. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/getting-started/bookshelf/config/initializers/wrap_parameters.rb b/getting-started/bookshelf/config/initializers/wrap_parameters.rb index 41341fd7e..06c3d05fc 100644 --- a/getting-started/bookshelf/config/initializers/wrap_parameters.rb +++ b/getting-started/bookshelf/config/initializers/wrap_parameters.rb @@ -20,8 +20,3 @@ ActiveSupport.on_load :action_controller do wrap_parameters format: [:json] end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/getting-started/bookshelf/config/routes.rb b/getting-started/bookshelf/config/routes.rb index b63e78b8d..ebfe91c1c 100644 --- a/getting-started/bookshelf/config/routes.rb +++ b/getting-started/bookshelf/config/routes.rb @@ -12,12 +12,5 @@ # limitations under the License. Rails.application.routes.draw do - # Route root of application to BooksController#index action - root "books#index" - - # Restful routes for BooksController - resources :books - - get "/logs", to: "stackdriver#logs" - get "/errors", to: "stackdriver#errors" + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end diff --git a/run/rails/tmp/.keep b/run/rails/tmp/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/run/rails/tmp/pids/.keep b/run/rails/tmp/pids/.keep deleted file mode 100644 index e69de29bb..000000000