cupcakinator 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9341bcd507ef2f519f09f3d970c4fbd77fb7a504
4
- data.tar.gz: 15dc57b3967bcf1fd0e0e68768f12ca5f7038cc2
3
+ metadata.gz: e0de255dd37d2bb6393bf1d014061336ac6df5b2
4
+ data.tar.gz: 73611969ac17cb76871969eef13eb24226209eb3
5
5
  SHA512:
6
- metadata.gz: 0ab02e58525b03bd57aff9076748e9637c4165793e8647fedf1f43c04c4b4b29e4370ae14a8afeebaf1b9b38082dd1701447043236d54ff91e10ea493db2b2df
7
- data.tar.gz: 4bb03c740853812623ce50a32004823b31be188675e34e7fb2ed0a31de6d5f55091164eff7ab8d68a02981ab5d28a0825fd6f7ce9915096263c799735292966d
6
+ metadata.gz: 4e4d2de362e7d39749c9a855c0901472828c11c49643122ef8d2531db4a8bf661c956d39775e332aa3cf8c5aa57b204c87c603ee00b7b09ab3763049f7957a4a
7
+ data.tar.gz: 612324f8a3687a2b8d516f010b28cc332ca166f0c1e7c23298f9ae828e9f459d33a3b7818ae33b4e8cdecb07f9bb852398d45a4bf4c88fbf051ad9ab7e1e46b1
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  *.log
5
5
  .bundle
6
6
  .config
7
+ .ruby-version
7
8
  .yardoc
8
9
  Gemfile.lock
9
10
  InstalledFiles
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.9.3"
4
- - "2.0.0"
5
- - "2.1.0"
6
3
  - "2.1.1"
4
+ - "2.3.4"
5
+ - "2.4.1"
7
6
  bundler_args: --without development,test
8
7
  script: bundle exec rspec spec
@@ -0,0 +1,8 @@
1
+ 2.0.0
2
+
3
+ - Dropped support for ruby > 2.1.1
4
+ - Locked for Hashie ~> 3
5
+ - Dropped locks for json and bundler versions
6
+ - Fixed for Hashie dependency
7
+ - removed .ruby-version from git... last supported version is listed in .travis.yml
8
+ - bumped included test_app to Rails 5.1
data/Gemfile CHANGED
@@ -2,10 +2,10 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'bundler', '~> 1.3'
6
- gem 'hashie'
5
+ gem 'bundler'
6
+ gem 'hashie', '~> 3'
7
7
  gem 'i18n'
8
- gem 'json', '~> 1.8'
8
+ gem 'json'
9
9
 
10
10
  group :development, :test do
11
11
  gem 'guard'
@@ -1,4 +1,5 @@
1
1
  require 'i18n'
2
+ require 'hashie'
2
3
  require 'cupcakinator/version'
3
4
  require 'cupcakinator/base'
4
5
  require 'cupcakinator/config'
@@ -1,6 +1,3 @@
1
- require 'hashie/extensions/method_access'
2
- require 'hashie/extensions/coercion'
3
-
4
1
  module Cupcakinator
5
2
 
6
3
  # known configuration variables
@@ -1,3 +1,3 @@
1
1
  module Cupcakinator
2
- VERSION = '1.1.2'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -20,7 +20,7 @@ describe Cupcakinator::Base do
20
20
  before :each do
21
21
  sleep(1)
22
22
  @klass = nil
23
- t = Time.now.strftime("Foo%Y%m%d%H%M%s")
23
+ t = Time.now.strftime('Foo%Y%m%d%H%M%s')
24
24
  eval <<-ENDOFKLASS
25
25
  class #{t}
26
26
  include Cupcakinator
@@ -31,7 +31,7 @@ describe Cupcakinator::Base do
31
31
 
32
32
 
33
33
  it 'should call _cupcakinator_options' do
34
- @klass.should_receive(:_cupcakinator_options).at_least(1).and_return({})
34
+ expect(@klass).to receive(:_cupcakinator_options).at_least(1).and_return({})
35
35
 
36
36
  @klass.cupcakinate method: 'config'
37
37
  end
@@ -39,13 +39,13 @@ describe Cupcakinator::Base do
39
39
  it 'should set the default config with no options' do
40
40
  @klass.cupcakinate
41
41
 
42
- @klass._cupcakinator_options.should eq Cupcakinator::Options.new
42
+ expect(@klass._cupcakinator_options).to eq Cupcakinator::Options.new
43
43
  end
44
44
 
45
45
  it 'should merge options into default' do
46
46
  @klass.cupcakinate file: 'conf.yml'
47
47
 
48
- @klass._cupcakinator_options[:file].should == 'conf.yml'
48
+ expect(@klass._cupcakinator_options[:file]).to eq 'conf.yml'
49
49
  end
50
50
 
51
51
  end
@@ -54,18 +54,18 @@ describe Cupcakinator::Base do
54
54
  describe '_cupcakinator_config' do
55
55
 
56
56
  it 'should return a Cupcakinator::Config' do
57
- CupcakinatorBaseSpecFoo._cupcakinator_config.class.should eq(Cupcakinator::Config)
57
+ expect(CupcakinatorBaseSpecFoo._cupcakinator_config.class).to eq(Cupcakinator::Config)
58
58
  end
59
59
 
60
60
  it 'should return a Cupcakinator::Config for an embedded Hash (in yaml)' do
61
- CupcakinatorBaseSpecFoo._cupcakinator_config.bacon.class.should eq(Cupcakinator::Config)
61
+ expect(CupcakinatorBaseSpecFoo._cupcakinator_config.bacon.class).to eq(Cupcakinator::Config)
62
62
  end
63
63
 
64
64
  it 'should not load more than once' do
65
65
  h = double
66
66
  CupcakinatorBaseSpecFoo.instance_variable_set('@cupcakinator_config', h)
67
- CupcakinatorBaseSpecFoo._cupcakinator_config.should == h
68
- CupcakinatorBaseSpecFoo.should_not_receive(:load_cupcakinator_config)
67
+ expect(CupcakinatorBaseSpecFoo._cupcakinator_config).to eq h
68
+ expect(CupcakinatorBaseSpecFoo).not_to receive(:load_cupcakinator_config)
69
69
  end
70
70
 
71
71
  end
@@ -78,8 +78,8 @@ describe Cupcakinator::Base do
78
78
 
79
79
  cupcakinate file: 'no_exist.yml'
80
80
  end
81
- YAML.stub(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
82
- YAML.stub(:load_file).with(anything).and_call_original
81
+ allow(YAML).to receive(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
82
+ allow(YAML).to receive(:load_file).with(anything).and_call_original
83
83
 
84
84
  expect{ CupcakinatorBaseSpecNoExist.load_cupcakinator_config }.to raise_error(Cupcakinator::ConfigFileNotFoundError)
85
85
  end
@@ -90,8 +90,8 @@ describe Cupcakinator::Base do
90
90
 
91
91
  cupcakinate file: 'no_exist.yml', allow_missing: false
92
92
  end
93
- YAML.stub(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
94
- YAML.stub(:load_file).with(anything).and_call_original
93
+ allow(YAML).to receive(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
94
+ allow(YAML).to receive(:load_file).with(anything).and_call_original
95
95
 
96
96
  expect{ CupcakinatorBaseSpecNoExist.load_cupcakinator_config }.to raise_error(Cupcakinator::ConfigFileNotFoundError)
97
97
  end
@@ -102,10 +102,10 @@ describe Cupcakinator::Base do
102
102
 
103
103
  cupcakinate file: 'no_exist.yml', allow_missing: true
104
104
  end
105
- YAML.stub(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
106
- YAML.stub(:load_file).with(anything).and_call_original
105
+ allow(YAML).to receive(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
106
+ allow(YAML).to receive(:load_file).with(anything).and_call_original
107
107
 
108
- expect{ CupcakinatorBaseSpecNoExist.load_cupcakinator_config }.to_not raise_error(Cupcakinator::ConfigFileNotFoundError)
108
+ expect{ CupcakinatorBaseSpecNoExist.load_cupcakinator_config }.not_to raise_error
109
109
  end
110
110
 
111
111
  it 'should return empty Config if config file is not found and allow_missing is true' do
@@ -114,8 +114,8 @@ describe Cupcakinator::Base do
114
114
 
115
115
  cupcakinate file: 'no_exist.yml', allow_missing: true
116
116
  end
117
- YAML.stub(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
118
- YAML.stub(:load_file).with(anything).and_call_original
117
+ allow(YAML).to receive(:load_file).with('./no_exist.yml').and_raise(Errno::ENOENT)
118
+ allow(YAML).to receive(:load_file).with(anything).and_call_original
119
119
 
120
120
  expect(CupcakinatorBaseSpecNoExist.config.to_h).to eq({})
121
121
  end
@@ -128,7 +128,7 @@ describe Cupcakinator::Base do
128
128
 
129
129
  cupcakinate file: 'bad_file.yml'
130
130
  end
131
- YAML.stub(:load_file).with('./bad_file.yml').and_raise(Psych::SyntaxError.new(dummy,dummy,dummy,dummy,dummy,dummy))
131
+ allow(YAML).to receive(:load_file).with('./bad_file.yml').and_raise(Psych::SyntaxError.new(dummy,dummy,dummy,dummy,dummy,dummy))
132
132
 
133
133
  expect{ CupcakinatorBaseSpecBadFile.load_cupcakinator_config }.to raise_error(Cupcakinator::ConfigFileInvalidError)
134
134
  end
@@ -141,8 +141,8 @@ describe Cupcakinator::Base do
141
141
  end
142
142
 
143
143
  subject = CupcakinatorBaseSpecRootKey.new
144
- subject.config.has_key?(:special).should be_false
145
- subject.config.bacon.chunky.should be_false
144
+ expect(subject.config.has_key?(:special)).to be false
145
+ expect(subject.config.bacon.chunky).to be false
146
146
  end
147
147
 
148
148
 
@@ -162,7 +162,7 @@ describe Cupcakinator::Base do
162
162
  end
163
163
 
164
164
  it 'should delegeate to _cupcakinator_config when using the configured cupcakinator method' do
165
- CupcakinatorBaseSpecFoo.should_receive(:_cupcakinator_config).with('john')
165
+ expect(CupcakinatorBaseSpecFoo).to receive(:_cupcakinator_config).with('john')
166
166
 
167
167
  subject.el_config('john')
168
168
  end
@@ -187,7 +187,7 @@ describe Cupcakinator::Base do
187
187
  end
188
188
 
189
189
  it 'should delegeate to _cupcakinator_config when using the configured cupcakinator method' do
190
- CupcakinatorBaseSpecFoo.should_receive(:_cupcakinator_config).with('john')
190
+ expect(CupcakinatorBaseSpecFoo).to receive(:_cupcakinator_config).with('john')
191
191
 
192
192
  subject.el_config('john')
193
193
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Cupcakinator::ConfigFileNotFoundError do
4
4
 
5
5
  it 'should call I18n with args filename and options' do
6
- I18n.should_receive(:t).with(an_instance_of(String), hash_including(:filename, :options))
6
+ expect(I18n).to receive(:t).with(an_instance_of(String), hash_including(:filename, :options))
7
7
  Cupcakinator::ConfigFileNotFoundError.new('foo', 'bar')
8
8
  end
9
9
 
@@ -13,7 +13,7 @@ end
13
13
  describe Cupcakinator::ConfigFileInvalidError do
14
14
 
15
15
  it 'should call I18n with args filename and message' do
16
- I18n.should_receive(:t).with(an_instance_of(String), hash_including(:filename, :message))
16
+ expect(I18n).to receive(:t).with(an_instance_of(String), hash_including(:filename, :message))
17
17
  Cupcakinator::ConfigFileInvalidError.new('foo', 'bar')
18
18
  end
19
19
 
@@ -22,11 +22,11 @@ describe Cupcakinator do
22
22
  context 'inheritence' do
23
23
 
24
24
  it "parent should not have child's options" do
25
- CupcakinatorSpecFoo._cupcakinator_options[:method].should == 'config'
25
+ expect(CupcakinatorSpecFoo._cupcakinator_options[:method]).to eq 'config'
26
26
  end
27
27
 
28
28
  it "child should not have parent's options" do
29
- CupcakinatorSpecBar._cupcakinator_options[:method].should == 'bar_config'
29
+ expect(CupcakinatorSpecBar._cupcakinator_options[:method]).to eq 'bar_config'
30
30
  end
31
31
 
32
32
  end
@@ -35,7 +35,7 @@ describe Cupcakinator do
35
35
  context 'multiple uses' do
36
36
 
37
37
  it "should exist separately per invocation" do
38
- CupcakinatorSpecBaz._cupcakinator_options[:method].should_not eq CupcakinatorSpecFoo._cupcakinator_options[:method]
38
+ expect(CupcakinatorSpecBaz._cupcakinator_options[:method]).not_to eq CupcakinatorSpecFoo._cupcakinator_options[:method]
39
39
  end
40
40
 
41
41
  end
@@ -44,7 +44,7 @@ describe Cupcakinator do
44
44
  context 'localization' do
45
45
 
46
46
  it 'should have loaded the locales file' do
47
- I18n.t('cupcakinator.error.deprecation.include_base').should =~ /don't include Cupcakinator::Base directly/
47
+ expect(I18n.t('cupcakinator.error.deprecation.include_base')).to match /don't include Cupcakinator::Base directly/
48
48
  end
49
49
  end
50
50
 
@@ -1,7 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 4.0.4'
3
+ gem 'listen'
4
+ gem 'rails', '~> 5'
4
5
  gem 'rspec-rails'
5
6
  gem 'sqlite3'
6
7
 
7
- gem 'cupcakinator', path: '..'
8
+ gem 'cupcakinator', path: '..'
@@ -1,12 +1,18 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- Bundler.require(:default, Rails.env)
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
6
8
 
7
9
  module TestApp
8
10
  class Application < Rails::Application
9
- config.i18n.default_locale = :en
10
- config.autoload_paths += %w( lib )
11
+ # Initialize configuration defaults for originally generated Rails version.
12
+ config.load_defaults 5.1
13
+
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
11
17
  end
12
18
  end
@@ -1,4 +1,3 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
2
 
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
10
+ channel_prefix: test_app_production
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative 'application'
3
3
 
4
4
  # Initialize the Rails application.
5
- TestApp::Application.initialize!
5
+ Rails.application.initialize!
@@ -1,4 +1,4 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -9,21 +9,46 @@ TestApp::Application.configure do
9
9
  # Do not eager load code on boot.
10
10
  config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
+
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
15
28
 
16
29
  # Don't care if the mailer can't send.
17
30
  config.action_mailer.raise_delivery_errors = false
18
31
 
32
+ config.action_mailer.perform_caching = false
33
+
19
34
  # Print deprecation notices to the Rails logger.
20
35
  config.active_support.deprecation = :log
21
36
 
22
- # Raise an error on page load if there are pending migrations
37
+ # Raise an error on page load if there are pending migrations.
23
38
  config.active_record.migration_error = :page_load
24
39
 
25
40
  # Debug mode disables concatenation and preprocessing of assets.
26
41
  # This option may cause significant delays in view rendering with a large
27
42
  # number of complex assets.
28
43
  config.assets.debug = true
44
+
45
+ # Suppress logger output for asset requests.
46
+ config.assets.quiet = true
47
+
48
+ # Raises error for missing translations
49
+ # config.action_view.raise_on_missing_translations = true
50
+
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
29
54
  end
@@ -1,11 +1,11 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
7
  # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
8
+ # your application in memory, allowing both threaded web servers
9
9
  # and those relying on copy on write to perform better.
10
10
  # Rake tasks automatically ignore this option for performance.
11
11
  config.eager_load = true
@@ -14,13 +14,14 @@ TestApp::Application.configure do
14
14
  config.consider_all_requests_local = false
15
15
  config.action_controller.perform_caching = true
16
16
 
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
17
+ # Attempt to read encrypted secrets from `config/secrets.yml.enc`.
18
+ # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
19
+ # `config/secrets.yml.key`.
20
+ config.read_encrypted_secrets = true
21
21
 
22
- # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
22
+ # Disable serving static files from the `/public` folder by default since
23
+ # Apache or NGINX already handles this.
24
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
24
25
 
25
26
  # Compress JavaScripts and CSS.
26
27
  config.assets.js_compressor = :uglifier
@@ -29,52 +30,62 @@ TestApp::Application.configure do
29
30
  # Do not fallback to assets pipeline if a precompiled asset is missed.
30
31
  config.assets.compile = false
31
32
 
32
- # Generate digests for assets URLs.
33
- config.assets.digest = true
33
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
34
34
 
35
- # Version of your assets, change this if you want to expire all your assets.
36
- config.assets.version = '1.0'
35
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
36
+ # config.action_controller.asset_host = 'http://assets.example.com'
37
37
 
38
38
  # Specifies the header that your server uses for sending files.
39
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
39
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
40
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
41
+
42
+ # Mount Action Cable outside main process or domain
43
+ # config.action_cable.mount_path = nil
44
+ # config.action_cable.url = 'wss://example.com/cable'
45
+ # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
41
46
 
42
47
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
48
  # config.force_ssl = true
44
49
 
45
- # Set to :debug to see everything in the log.
46
- config.log_level = :info
50
+ # Use the lowest log level to ensure availability of diagnostic information
51
+ # when problems arise.
52
+ config.log_level = :debug
47
53
 
48
54
  # Prepend all log lines with the following tags.
49
- # config.log_tags = [ :subdomain, :uuid ]
50
-
51
- # Use a different logger for distributed setups.
52
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
55
+ config.log_tags = [ :request_id ]
53
56
 
54
57
  # Use a different cache store in production.
55
58
  # config.cache_store = :mem_cache_store
56
59
 
57
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
- # config.action_controller.asset_host = "http://assets.example.com"
59
-
60
- # Precompile additional assets.
61
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
- # config.assets.precompile += %w( search.js )
60
+ # Use a real queuing backend for Active Job (and separate queues per environment)
61
+ # config.active_job.queue_adapter = :resque
62
+ # config.active_job.queue_name_prefix = "test_app_#{Rails.env}"
63
+ config.action_mailer.perform_caching = false
63
64
 
64
65
  # Ignore bad email addresses and do not raise email delivery errors.
65
66
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
67
  # config.action_mailer.raise_delivery_errors = false
67
68
 
68
69
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
- # the I18n.default_locale when a translation can not be found).
70
+ # the I18n.default_locale when a translation cannot be found).
70
71
  config.i18n.fallbacks = true
71
72
 
72
73
  # Send deprecation notices to registered listeners.
73
74
  config.active_support.deprecation = :notify
74
75
 
75
- # Disable automatic flushing of the log to improve performance.
76
- # config.autoflush_log = false
77
-
78
76
  # Use default logging formatter so that PID and timestamp are not suppressed.
79
77
  config.log_formatter = ::Logger::Formatter.new
78
+
79
+ # Use a different logger for distributed setups.
80
+ # require 'syslog/logger'
81
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
82
+
83
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
84
+ logger = ActiveSupport::Logger.new(STDOUT)
85
+ logger.formatter = config.log_formatter
86
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
87
+ end
88
+
89
+ # Do not dump schema after migrations.
90
+ config.active_record.dump_schema_after_migration = false
80
91
  end
@@ -1,4 +1,4 @@
1
- TestApp::Application.configure do
1
+ Rails.application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -12,9 +12,11 @@ TestApp::Application.configure do
12
12
  # preloads Rails for running tests, you may have to set it to true.
13
13
  config.eager_load = false
14
14
 
15
- # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
17
- config.static_cache_control = "public, max-age=3600"
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
19
+ }
18
20
 
19
21
  # Show full error reports and disable caching.
20
22
  config.consider_all_requests_local = true
@@ -25,6 +27,7 @@ TestApp::Application.configure do
25
27
 
26
28
  # Disable request forgery protection in test environment.
27
29
  config.action_controller.allow_forgery_protection = false
30
+ config.action_mailer.perform_caching = false
28
31
 
29
32
  # Tell Action Mailer not to deliver emails to the real world.
30
33
  # The :test delivery method accumulates sent emails in the
@@ -33,4 +36,7 @@ TestApp::Application.configure do
33
36
 
34
37
  # Print deprecation notices to the stderr.
35
38
  config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
36
42
  end
@@ -0,0 +1,6 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ApplicationController.renderer.defaults.merge!(
4
+ # http_host: 'example.org',
5
+ # https: false
6
+ # )
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path.
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+ # Add Yarn node_modules folder to the asset load path.
9
+ Rails.application.config.assets.paths << Rails.root.join('node_modules')
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,5 @@
1
+ module TestApp
2
+ include Cupcakinator
3
+ cupcakinate dir: 'config', file: 'config.yml'
4
+ end
5
+
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.1 upgrade.
4
+ #
5
+ # Once upgraded flip defaults one by one to migrate to the new default.
6
+ #
7
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Make `form_with` generate non-remote forms.
10
+ Rails.application.config.action_view.form_with_generates_remote_forms = false
11
+
12
+ # Unknown asset fallback will return the path passed in when the given
13
+ # asset is not present in the asset pipeline.
14
+ # Rails.application.config.assets.unknown_asset_fallback = false
@@ -5,10 +5,10 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
8
+ wrap_parameters format: [:json]
9
9
  end
10
10
 
11
11
  # To enable root element in JSON for ActiveRecord objects.
12
12
  # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
13
+ # self.include_root_in_json = true
14
14
  # end
@@ -16,6 +16,16 @@
16
16
  #
17
17
  # This would use the information in config/locales/es.yml.
18
18
  #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
19
29
  # To learn more, please read the Rails Internationalization guide
20
30
  # available at http://guides.rubyonrails.org/i18n.html.
21
31
 
@@ -0,0 +1,56 @@
1
+ # Puma can serve each request in a thread from an internal thread pool.
2
+ # The `threads` method setting takes two numbers: a minimum and maximum.
3
+ # Any libraries that use thread pools should be configured to match
4
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
+ # and maximum; this matches the default thread size of Active Record.
6
+ #
7
+ threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
8
+ threads threads_count, threads_count
9
+
10
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
11
+ #
12
+ port ENV.fetch("PORT") { 3000 }
13
+
14
+ # Specifies the `environment` that Puma will run in.
15
+ #
16
+ environment ENV.fetch("RAILS_ENV") { "development" }
17
+
18
+ # Specifies the number of `workers` to boot in clustered mode.
19
+ # Workers are forked webserver processes. If using threads and workers together
20
+ # the concurrency of the application would be max `threads` * `workers`.
21
+ # Workers do not work on JRuby or Windows (both of which do not support
22
+ # processes).
23
+ #
24
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
+
26
+ # Use the `preload_app!` method when specifying a `workers` number.
27
+ # This directive tells Puma to first boot the application and load code
28
+ # before forking the application. This takes advantage of Copy On Write
29
+ # process behavior so workers use less memory. If you use this option
30
+ # you need to make sure to reconnect any threads in the `on_worker_boot`
31
+ # block.
32
+ #
33
+ # preload_app!
34
+
35
+ # If you are preloading your application and using Active Record, it's
36
+ # recommended that you close any connections to the database before workers
37
+ # are forked to prevent connection leakage.
38
+ #
39
+ # before_fork do
40
+ # ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
41
+ # end
42
+
43
+ # The code in the `on_worker_boot` will be called if you are using
44
+ # clustered mode by specifying a number of `workers`. After each worker
45
+ # process is booted, this block will be run. If you are using the `preload_app!`
46
+ # option, you will want to use this block to reconnect to any threads
47
+ # or connections that may have been created at application boot, as Ruby
48
+ # cannot share connections between processes.
49
+ #
50
+ # on_worker_boot do
51
+ # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
52
+ # end
53
+ #
54
+
55
+ # Allow puma to be restarted by `rails restart` command.
56
+ plugin :tmp_restart
@@ -1,56 +1,3 @@
1
- TestApp::Application.routes.draw do
2
- # The priority is based upon order of creation: first created -> highest priority.
3
- # See how all your routes lay out with "rake routes".
4
-
5
- # You can have the root of your site routed with "root"
6
- # root 'welcome#index'
7
-
8
- # Example of regular route:
9
- # get 'products/:id' => 'catalog#view'
10
-
11
- # Example of named route that can be invoked with purchase_url(id: product.id)
12
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
-
14
- # Example resource route (maps HTTP verbs to controller actions automatically):
15
- # resources :products
16
-
17
- # Example resource route with options:
18
- # resources :products do
19
- # member do
20
- # get 'short'
21
- # post 'toggle'
22
- # end
23
- #
24
- # collection do
25
- # get 'sold'
26
- # end
27
- # end
28
-
29
- # Example resource route with sub-resources:
30
- # resources :products do
31
- # resources :comments, :sales
32
- # resource :seller
33
- # end
34
-
35
- # Example resource route with more complex sub-resources:
36
- # resources :products do
37
- # resources :comments
38
- # resources :sales do
39
- # get 'recent', on: :collection
40
- # end
41
- # end
42
-
43
- # Example resource route with concerns:
44
- # concern :toggleable do
45
- # post 'toggle'
46
- # end
47
- # resources :posts, concerns: :toggleable
48
- # resources :photos, concerns: :toggleable
49
-
50
- # Example resource route within a namespace:
51
- # namespace :admin do
52
- # # Directs /admin/products/* to Admin::ProductsController
53
- # # (app/controllers/admin/products_controller.rb)
54
- # resources :products
55
- # end
1
+ Rails.application.routes.draw do
2
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
56
3
  end
@@ -0,0 +1,32 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ # Shared secrets are available across all environments.
14
+
15
+ # shared:
16
+ # api_key: a1B2c3D4e5F6
17
+
18
+ # Environmental secrets are only available for that specific environment.
19
+
20
+ development:
21
+ secret_key_base: a9e98587a2487b090d5b24e0ad264dc7eb8a43ba0694622666c285dc94a19be094cfe66983e7fb124ee6fea09bde18d0239849099059191cdf79d8f7216a9012
22
+
23
+ test:
24
+ secret_key_base: 257c1d2d88010b8f129fa56d39f2e699eb9e6f57fe0902216784121251d5cb88897f8c277e352051b2b2de9cfb7800ae8609df5b654fb37dd063e3e2bcfc7d66
25
+
26
+ # Do not keep production secrets in the unencrypted secrets file.
27
+ # Instead, either read values from the environment.
28
+ # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29
+ # and move the `production:` environment over there.
30
+
31
+ production:
32
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,6 @@
1
+ %w(
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ).each { |path| Spring.watch(path) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cupcakinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -33,8 +33,8 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - ".gitignore"
35
35
  - ".rspec"
36
- - ".ruby-version"
37
36
  - ".travis.yml"
37
+ - CHANGELOG.md
38
38
  - Gemfile
39
39
  - Guardfile
40
40
  - LICENSE
@@ -70,20 +70,29 @@ files:
70
70
  - test_app/config.ru
71
71
  - test_app/config/application.rb
72
72
  - test_app/config/boot.rb
73
+ - test_app/config/cable.yml
73
74
  - test_app/config/database.yml
74
75
  - test_app/config/environment.rb
75
76
  - test_app/config/environments/development.rb
76
77
  - test_app/config/environments/production.rb
77
78
  - test_app/config/environments/test.rb
79
+ - test_app/config/initializers/application_controller_renderer.rb
80
+ - test_app/config/initializers/assets.rb
78
81
  - test_app/config/initializers/backtrace_silencers.rb
82
+ - test_app/config/initializers/cookies_serializer.rb
83
+ - test_app/config/initializers/cupcakinator.rb
79
84
  - test_app/config/initializers/filter_parameter_logging.rb
80
85
  - test_app/config/initializers/inflections.rb
81
86
  - test_app/config/initializers/mime_types.rb
87
+ - test_app/config/initializers/new_framework_defaults_5_1.rb
82
88
  - test_app/config/initializers/secret_token.rb
83
89
  - test_app/config/initializers/session_store.rb
84
90
  - test_app/config/initializers/wrap_parameters.rb
85
91
  - test_app/config/locales/en.yml
92
+ - test_app/config/puma.rb
86
93
  - test_app/config/routes.rb
94
+ - test_app/config/secrets.yml
95
+ - test_app/config/spring.rb
87
96
  - test_app/db/seeds.rb
88
97
  - test_app/db/test.sqlite3
89
98
  - test_app/lib/assets/.keep
@@ -119,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
128
  version: '0'
120
129
  requirements: []
121
130
  rubyforge_project:
122
- rubygems_version: 2.2.2
131
+ rubygems_version: 2.5.1
123
132
  signing_key:
124
133
  specification_version: 4
125
134
  summary: Easy to add config from YAML to any class
@@ -129,4 +138,3 @@ test_files:
129
138
  - spec/cupcakinator_spec.rb
130
139
  - spec/el_config.yml
131
140
  - spec/spec_helper.rb
132
- has_rdoc:
@@ -1 +0,0 @@
1
- 2.1.0