rails-secrets 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73084a7c41b8f330e12e667d5b8e5d943a9e17b3
4
- data.tar.gz: fc74fe1d179e314e4f41d50bd7b8086058a964dd
3
+ metadata.gz: 4c81cd87748dd386af0710b471f63c59780df0ac
4
+ data.tar.gz: 7509ee34f741eb1c4301cda1e5eaa35ebec9fbd3
5
5
  SHA512:
6
- metadata.gz: 2c2584a57905b56909a1c5c8b3fc65354108ef8100b9390494f9c742585c654fe9140af4ae3d07bb826f3b7dfbdf4d9eca4dfd3af74fc4b7805ef604ba077f43
7
- data.tar.gz: 32afcf75e60b32ee5c68498daaa9b77b36c0f3ea6925086e55706234bcfdc91ddcfff05cb18981f1ec64696d3ddc0ee0b43ebf10e50ba40a66504d371419b793
6
+ metadata.gz: 118f409bb9015ce55cbba001685143dc696d79cc8e0b2306b9fc362583b03fb51918065fec19b24563eb30a7ed54feb71a495140e01838fa0866b83c245ac429
7
+ data.tar.gz: 4271b37947a2776626bfcf59accb0efa9713ee7a1763549496dbd5028618678e4aa918fb0d3ca939271bca8909f6c0c2bca63a3bebdb04bb87e382510a6bb8cb
@@ -2,3 +2,6 @@ rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
4
  - 2.1.0
5
+ gemfile:
6
+ - gemfiles/rails_3_2.gemfile
7
+ - gemfiles/rails_4_0.gemfile
@@ -0,0 +1,7 @@
1
+ appraise 'rails_3_2' do
2
+ gem 'rails', '~> 3.2.0'
3
+ end
4
+
5
+ appraise 'rails_4_0' do
6
+ gem 'rails', '~> 4.0.0'
7
+ end
data/README.md CHANGED
@@ -22,6 +22,12 @@ Add this gem to your Gemfile, remove `config/initializers/secret_token.rb` and c
22
22
 
23
23
  ## Changelog
24
24
 
25
+ ### 1.0.2
26
+
27
+ * Add support for Rails 3.2.x
28
+
29
+ * Include instance methods before configuration begins so that it's available in environment configuration
30
+
25
31
  ### 1.0.1
26
32
 
27
33
  * Include instance methods before initialization begins so that it's available in all initializers
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  require "rake/testtask"
3
3
  require "bundler/gem_tasks"
4
+ require "appraisal"
4
5
 
5
6
  desc "Default: run rails-secrets unit tests."
6
7
  task :default => :test
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.0.0"
6
+
7
+ gemspec :path=>"../"
@@ -20,7 +20,7 @@ module Rails
20
20
  end
21
21
 
22
22
  class Railtie < ::Rails::Railtie
23
- config.before_initialize do |app|
23
+ config.before_configuration do |app|
24
24
  app.paths.add "config/secrets", with: "config/secrets.yml"
25
25
  app.extend(InstanceMethods)
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Secrets
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -10,8 +10,8 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["andyw@pixeltrix.co.uk"]
11
11
  gem.homepage = "https://github.com/pixeltrix/rails-secrets"
12
12
 
13
- gem.summary = %q{Rails 4.1 secrets.yml for Rails 4.0}
14
- gem.description = %q{Rails::Secrets is a backport of Rails 4.1 secrets.yml to Rails 4.0}
13
+ gem.summary = %q{Rails 4.1 secrets.yml for Rails 4.0 and 3.2}
14
+ gem.description = %q{Rails::Secrets is a backport of Rails 4.1 secrets.yml to Rails 4.0 and 3.2}
15
15
 
16
16
  gem.files = `git ls-files`.split("\n")
17
17
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -21,5 +21,6 @@ Gem::Specification.new do |gem|
21
21
  gem.required_ruby_version = '>= 1.9.3'
22
22
  gem.required_rubygems_version = '>= 1.8.11'
23
23
 
24
- gem.add_runtime_dependency 'rails', ['>= 4.0.0', '<= 4.1.0']
24
+ gem.add_runtime_dependency 'rails', ['>= 3.2.0', '<= 4.1.0']
25
+ gem.add_development_dependency 'appraisal', '~> 1.0'
25
26
  end
@@ -26,4 +26,7 @@ Dummy::Application.configure do
26
26
  # This option may cause significant delays in view rendering with a large
27
27
  # number of complex assets.
28
28
  config.assets.debug = true
29
+
30
+ # Test whether secrets can be read in a configuration context
31
+ config.secret_environment_config = Rails.application.secrets.secret_key_base
29
32
  end
@@ -77,4 +77,7 @@ Dummy::Application.configure do
77
77
 
78
78
  # Use default logging formatter so that PID and timestamp are not suppressed.
79
79
  config.log_formatter = ::Logger::Formatter.new
80
+
81
+ # Test whether secrets can be read in a configuration context
82
+ config.secret_environment_config = Rails.application.secrets.secret_key_base
80
83
  end
@@ -33,4 +33,7 @@ Dummy::Application.configure do
33
33
 
34
34
  # Print deprecation notices to the stderr.
35
35
  config.active_support.deprecation = :stderr
36
+
37
+ # Test whether secrets can be read in a configuration context
38
+ config.secret_environment_config = Rails.application.secrets.secret_key_base
36
39
  end
@@ -8,6 +8,10 @@ class RailsSecretsTest < ActiveSupport::TestCase
8
8
  assert_equal "9f4a992", app.secrets.api_token
9
9
  end
10
10
 
11
+ test "a config value set in the configuration stage is set to the correct value" do
12
+ assert_equal app.secrets.secret_key_base, app.config.secret_environment_config
13
+ end
14
+
11
15
  test "config.secret_key_base is copied from secrets.secret_key_base" do
12
16
  assert_equal app.secrets.secret_key_base, app.config.secret_key_base
13
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-secrets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2014-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 3.2.0
20
20
  - - <=
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.1.0
@@ -26,11 +26,26 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 4.0.0
29
+ version: 3.2.0
30
30
  - - <=
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.1.0
33
- description: Rails::Secrets is a backport of Rails 4.1 secrets.yml to Rails 4.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: appraisal
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ description: Rails::Secrets is a backport of Rails 4.1 secrets.yml to Rails 4.0 and
48
+ 3.2
34
49
  email:
35
50
  - andyw@pixeltrix.co.uk
36
51
  executables: []
@@ -39,10 +54,13 @@ extra_rdoc_files: []
39
54
  files:
40
55
  - .gitignore
41
56
  - .travis.yml
57
+ - Appraisals
42
58
  - Gemfile
43
59
  - LICENSE
44
60
  - README.md
45
61
  - Rakefile
62
+ - gemfiles/rails_3_2.gemfile
63
+ - gemfiles/rails_4_0.gemfile
46
64
  - lib/rails-secrets.rb
47
65
  - lib/rails/secrets.rb
48
66
  - lib/rails/secrets/railtie.rb
@@ -76,10 +94,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
94
  version: 1.8.11
77
95
  requirements: []
78
96
  rubyforge_project:
79
- rubygems_version: 2.2.1
97
+ rubygems_version: 2.2.2
80
98
  signing_key:
81
99
  specification_version: 4
82
- summary: Rails 4.1 secrets.yml for Rails 4.0
100
+ summary: Rails 4.1 secrets.yml for Rails 4.0 and 3.2
83
101
  test_files:
84
102
  - test/dummy/config.ru
85
103
  - test/dummy/config/application.rb