a9n 1.1.1 → 1.2.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
  SHA256:
3
- metadata.gz: f386d05290b6202fb5273b66318059c6d28e9d5987008af9a32b07270e8b3f54
4
- data.tar.gz: 2f18da7b5e40b207d30f8847721a49e339052adbb84aaedbf90622c5ae1cd787
3
+ metadata.gz: fca032540da11055ed22e392e1c2024cda311a6785c4046837fd5b9732d4bfb1
4
+ data.tar.gz: 5aa10ab6b540ccfbb44bfc043de67a4e6f5a4baa0027063af5b06d123b8cb6bd
5
5
  SHA512:
6
- metadata.gz: 6df38774085bbd85de7c48e3d6db68519d48ae08450789b7e9cc43bd9de3372887700f3ab680b12dacac41998272bae261b0de486206b65fd353a004b96b6787
7
- data.tar.gz: c9621b46975a2f9b29945b21b6bd26f7da88aee2df93c3259674ce5c5d59aa60fb44aaa5a840883409a2aaf5d876880c63fc7fd38d9e7c489b47671c4297be7b
6
+ metadata.gz: d916422540256299c914740bef44289464c5ae259c46dddfb864d579279e7f43fe869071c724b3cf7d4b406b227ef529c48b3440c6fa02473890ceab71a5f623
7
+ data.tar.gz: 75ebd13b032d9132c0c565a3309e93792cf297a5fc0ddaa8634fba7afac4620b7abca91ee5e32b5c3b2095d03218686e41696c5f01f647fb19e869afb59a9740
@@ -5,6 +5,7 @@ cache: bundler
5
5
  rvm:
6
6
  - 2.5
7
7
  - 2.6
8
+ - 2.7
8
9
  before_install: gem install bundler
9
10
  script:
10
11
  - bundle exec rake
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- a9n (1.1.1)
4
+ a9n (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,16 +13,16 @@ GEM
13
13
  diff-lcs (1.3)
14
14
  docile (1.3.2)
15
15
  jaro_winkler (1.5.4)
16
- json (2.3.0)
17
16
  method_source (0.9.2)
18
17
  parallel (1.19.1)
19
- parser (2.7.0.2)
18
+ parser (2.7.0.4)
20
19
  ast (~> 2.4.0)
21
20
  pry (0.12.2)
22
21
  coderay (~> 1.1.0)
23
22
  method_source (~> 0.9.0)
24
23
  rainbow (3.0.0)
25
24
  rake (13.0.1)
25
+ rexml (3.2.4)
26
26
  rspec (3.9.0)
27
27
  rspec-core (~> 3.9.0)
28
28
  rspec-expectations (~> 3.9.0)
@@ -36,19 +36,19 @@ GEM
36
36
  diff-lcs (>= 1.2.0, < 2.0)
37
37
  rspec-support (~> 3.9.0)
38
38
  rspec-support (3.9.2)
39
- rubocop (0.79.0)
39
+ rubocop (0.80.1)
40
40
  jaro_winkler (~> 1.5.1)
41
41
  parallel (~> 1.10)
42
42
  parser (>= 2.7.0.1)
43
43
  rainbow (>= 2.2.2, < 4.0)
44
+ rexml
44
45
  ruby-progressbar (~> 1.7)
45
46
  unicode-display_width (>= 1.4.0, < 1.7)
46
47
  ruby-progressbar (1.10.1)
47
- simplecov (0.17.1)
48
+ simplecov (0.18.5)
48
49
  docile (~> 1.1)
49
- json (>= 1.8, < 3)
50
- simplecov-html (~> 0.10.0)
51
- simplecov-html (0.10.2)
50
+ simplecov-html (~> 0.11)
51
+ simplecov-html (0.12.2)
52
52
  unicode-display_width (1.6.1)
53
53
 
54
54
  PLATFORMS
@@ -1,9 +1,11 @@
1
1
  module A9n
2
- class ConfigurationNotLoadedError < StandardError; end
3
- class MissingConfigurationDataError < StandardError; end
4
- class MissingConfigurationVariablesError < StandardError; end
5
- class NoSuchConfigurationVariableError < StandardError; end
6
- class MissingEnvVariableError < StandardError; end
7
- class UnknownEnvError < StandardError; end
8
- class RootNotSetError < StandardError; end
2
+ Error = Class.new(StandardError)
3
+ ConfigurationNotLoadedError = Class.new(Error)
4
+ MissingConfigurationDataError = Class.new(Error)
5
+ MissingConfigurationVariablesError = Class.new(Error)
6
+ NoSuchConfigurationVariableError = Class.new(Error)
7
+ KeyNotFoundError = Class.new(NoSuchConfigurationVariableError)
8
+ MissingEnvVariableError = Class.new(Error)
9
+ UnknownEnvError = Class.new(Error)
10
+ RootNotSetError = Class.new(Error)
9
11
  end
@@ -17,14 +17,18 @@ module A9n
17
17
  data.merge!(another_data)
18
18
  end
19
19
 
20
- def method_missing(name, *_args)
21
- if data.key?(name)
22
- fetch(name)
20
+ def find(key)
21
+ if data.key?(key)
22
+ fetch(key)
23
23
  else
24
- raise NoSuchConfigurationVariableError.new, name
24
+ raise KeyNotFoundError.new, "Could not find #{key} in #{data.keys.inspect}"
25
25
  end
26
26
  end
27
27
 
28
+ def method_missing(key, *_args)
29
+ find(key)
30
+ end
31
+
28
32
  def set(key, value)
29
33
  data[key.to_sym] = value
30
34
  end
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
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: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2020-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codeclimate-test-reporter