ettin 1.0.2 → 1.0.3

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: 47dab157474e398ab94290dcd54fdb7589111a4c
4
- data.tar.gz: cc0cd5d64fb813615d5fefedc3809cbb07800baf
3
+ metadata.gz: 3aaec313791d211b54f6d3de30fe5d9d127a6d42
4
+ data.tar.gz: 5af07746b3df038a85257d488e7329604e4d4422
5
5
  SHA512:
6
- metadata.gz: be7f21b4243c4ec193c93be5f8d28264f8b85fa659ab6814cfcc0cecaf681b289ecd1d480699bb74da32bbcbaa0541ec7a5a08771395e418f207669056738dd0
7
- data.tar.gz: 0bc13c323591c92275602d970960690455d58b1f5ed44490367c0bad06752bdb7c06cba793062e84be0f487f030edee78cbfb493ea2dfd21a8b8d5500e3ef40f
6
+ metadata.gz: 493d1629489226bdfd70425c9bf8cfdc3bad7e2e45957c5619b44c12bb442b053433dcabd438e9a97d9d72a09adb541714bdc35a8b801c45f4fd01f84f48eb22
7
+ data.tar.gz: d9571bf717edcd772070b15d0e97904da2f2fe8cf499f9b9c806aca41c5997c10de15ba580e73c2a7d5cdcc78013aebec8dcd5a156f01dc4430b823e37d123f2
data/lib/ettin/options.rb CHANGED
@@ -18,11 +18,14 @@ module Ettin
18
18
  end
19
19
 
20
20
  def method_missing(method, *args, &block)
21
- super(method, *args, &block) unless respond_to?(method)
22
- if bang?(method) && !key?(debang(method))
23
- raise KeyError, "key #{debang(method)} not found"
21
+ if handles?(method)
22
+ if bang?(method) && !key?(debang(method))
23
+ raise KeyError, "key #{debang(method)} not found"
24
+ else
25
+ self[debang(method)]
26
+ end
24
27
  else
25
- self[debang(method)]
28
+ super(method, *args, &block)
26
29
  end
27
30
  end
28
31
 
@@ -31,7 +34,7 @@ module Ettin
31
34
  # * all methods that are mostly alpha-numeric: /^[a-zA-Z_0-9]*$/
32
35
  # * all methods that are mostly alpha-numeric + !: /^[a-zA-Z_0-9]*\!$/
33
36
  def respond_to_missing?(method, include_all = false)
34
- super(method, include_all) || /^[a-zA-Z_0-9]*\!?$/.match(method.to_s)
37
+ handles?(method) || super(method, include_all)
35
38
  end
36
39
 
37
40
  def key?(key)
@@ -69,6 +72,10 @@ module Ettin
69
72
 
70
73
  attr_reader :hash
71
74
 
75
+ def handles?(method)
76
+ /^[a-zA-Z_0-9]*\!?$/.match(method.to_s)
77
+ end
78
+
72
79
  def bang?(method)
73
80
  method.to_s[-1] == "!"
74
81
  end
data/lib/ettin/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ettin
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ettin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Hockey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge