require_env 1.0.0 → 1.1.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: 8873d2fe4dd5389196b6854022c31f7bfc49f757
4
- data.tar.gz: 01ac5d2b6ef15c421f72bc265ebd2fe3e38b51cf
3
+ metadata.gz: 8eb9728be43545f46faf31271e028c8fed316091
4
+ data.tar.gz: fb02df77efae3aef38a1e758fcf4afd2dc94b027
5
5
  SHA512:
6
- metadata.gz: 871c3aa4c3fa584e68e521ec607e7058589f21869a3446c00f33a98d7e14641ea873d709ce6913d58cc36b5d91687533a4986120532d2b74f4a2547308ab0b53
7
- data.tar.gz: a792a8397f994323bb6fed208119061de24a76c192304fae00df409dc8d3e1104d62727d67d01042db352fb1e742694c9396b77f9892afb7fb873fcf4fd0b7e2
6
+ metadata.gz: 9e4cd887a4627c2b6aa4abfcc6d21757d5b0fa7430c169f465f0d2ed36d742b9c69b99b00d10c0283dd0b3f4cba94527f693bc38b496767e9a944163b511c273
7
+ data.tar.gz: 4f8a49ab4c57d2bb12dc1c2d2e3868f19902e3d4798456f11ca485dd1b8ecff3c8490c7d175c6ab8a0163ed5a7de3f40a2ec6d5aaaa43c3481c1ceec37e8fd7e
@@ -1,3 +1,3 @@
1
1
  module RequireEnv
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
data/lib/require_env.rb CHANGED
@@ -52,6 +52,10 @@ module RequireEnv
52
52
  end
53
53
 
54
54
  def self.application_environment
55
- ENV['RAILS_ENV']
55
+ @application_environment ||= ENV['RAILS_ENV']
56
+ end
57
+
58
+ def self.application_environment=(value)
59
+ @application_environment = value
56
60
  end
57
61
  end
@@ -17,6 +17,7 @@ class RequireEnvTest < ActiveSupport::TestCase
17
17
  test 'check' do
18
18
  file = File.expand_path('../test.yml', __FILE__)
19
19
 
20
+ RequireEnv.application_environment = nil
20
21
  assert_raise(ArgumentError) do
21
22
  RequireEnv.check(file, file)
22
23
  end
@@ -31,13 +32,14 @@ class RequireEnvTest < ActiveSupport::TestCase
31
32
  end
32
33
 
33
34
  test 'application_environment' do
34
- assert_equal nil, RequireEnv.application_environment
35
-
36
35
  ENV['RAILS_ENV'] = 'test'
37
36
  assert_equal 'test', RequireEnv.application_environment
38
37
 
39
38
  ENV['RAILS_ENV'] = 'foo'
40
- assert_equal 'foo', RequireEnv.application_environment
39
+ assert_equal 'test', RequireEnv.application_environment
40
+
41
+ RequireEnv.application_environment = 'whatever'
42
+ assert_equal 'whatever', RequireEnv.application_environment
41
43
  end
42
44
 
43
45
  test 'requirements_from_file' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: require_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffroy Planquart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml