a9n 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/a9n.rb +5 -1
- data/lib/a9n/exceptions.rb +1 -0
- data/lib/a9n/version.rb +1 -1
- data/spec/unit/a9n_spec.rb +16 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c61d91df158a98905540788736c8cb991ac74ad07b7e731d3cc4c90a7db51a
|
4
|
+
data.tar.gz: 91b249ed588ec98a51d630cc3ead8fd3940e1aac5b2a37c052fb6d90419cd9bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4c51ba32a2bd745ac6902f6ae53f0cfdb7f9f19d44fa0c35b615ba61e3d87ace7009bf5aad7cb06b16abd0a5e1c58e383210910cc186c9616dcba491a884848
|
7
|
+
data.tar.gz: b1ebbf900ae993a785ed432d514033c0b86d108fa3b9b94ca1ac1096cddfaf4952843bd4a21e291f934e54898efead2fd9b9f4bc88bfad8b496cd58247bbff43
|
data/lib/a9n.rb
CHANGED
@@ -19,7 +19,7 @@ module A9n
|
|
19
19
|
|
20
20
|
class << self
|
21
21
|
def env
|
22
|
-
@env ||= ::A9n::StringInquirer.new(app_env || env_var('RAILS_ENV') || env_var('RACK_ENV') || env_var('APP_ENV'))
|
22
|
+
@env ||= ::A9n::StringInquirer.new(app_env || env_var('RAILS_ENV') || env_var('RACK_ENV') || env_var('APP_ENV') || fail(UnknownEnvError))
|
23
23
|
end
|
24
24
|
|
25
25
|
def env=(value)
|
@@ -50,6 +50,10 @@ module A9n
|
|
50
50
|
@root = path.to_s.empty? ? nil : Pathname.new(path.to_s)
|
51
51
|
end
|
52
52
|
|
53
|
+
def groups
|
54
|
+
['default', env].compact
|
55
|
+
end
|
56
|
+
|
53
57
|
def rails_app
|
54
58
|
defined?(Rails) ? Rails : nil
|
55
59
|
end
|
data/lib/a9n/exceptions.rb
CHANGED
data/lib/a9n/version.rb
CHANGED
data/spec/unit/a9n_spec.rb
CHANGED
@@ -37,6 +37,22 @@ RSpec.describe A9n do
|
|
37
37
|
expect(subject.env.production?).to eq(false)
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
context 'unknown env' do
|
42
|
+
it do
|
43
|
+
expect { subject.env }.to raise_error(A9n::UnknownEnvError)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '.groups' do
|
49
|
+
before do
|
50
|
+
subject.env = 'development'
|
51
|
+
end
|
52
|
+
|
53
|
+
it do
|
54
|
+
expect(subject.groups).to eq(['default', 'development'])
|
55
|
+
end
|
40
56
|
end
|
41
57
|
|
42
58
|
describe '.app' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: a9n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.0.
|
160
|
+
rubygems_version: 3.0.6
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: a9n is a tool to keep ruby/rails apps extra configuration easily maintainable
|