hash_dot 2.4.2 → 2.5.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: b000fb504eb9fa8b97ebb7a0ee1d6ca9a8735818824c61ea45b15b815ed0663d
4
- data.tar.gz: 9557757def023b3806a71259c8f902ccee4740eb16aa1986ae0dd40f02ba24b6
3
+ metadata.gz: aa8bb14cb875b48772a2c118ef62a6e604d863997354648c08aeb9cbcbb99689
4
+ data.tar.gz: c9b83eb8f3d753c5be3a1a093655ce55c34903df2b541641960e9c1ad8485bfc
5
5
  SHA512:
6
- metadata.gz: 75d365cef6894f8a34507c964d8974e464e7dd0b9a7e521e33d78253b10094f21c10159a8268060a7d75d5722ed766b4c0652e8f2db5efe40d79dd05307918e5
7
- data.tar.gz: 77a5b2a46774a79a69ca65c4d7e6f65e05afbb557398c511ef7b4d9331ac85688ba3d499c3d1ac17ca2de08871d8256e2b64dc7c15f91ffeb16d145a884e2d56
6
+ metadata.gz: 64f929f0fff4ae36c5761da32142278f22f757bc708065e854f0b77ed4372199b59c752802694bd4281bf2094d0bb39355ea641ce3c831a201b8e8822b98b96e
7
+ data.tar.gz: a03ed8b68b439d53f15f7c96b1243a2a3957be709bd3b633a81c0cb6d060b3f6cbcf374bb417aafa5b38917f5483e253c98d175e5dea12c04028ed5633aa1029
data/.rubocop.yml CHANGED
@@ -1,25 +1,46 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.0
2
+ TargetRubyVersion: 2.7
3
3
  Include:
4
4
  - 'lib/**/*'
5
5
  - 'spec/**/*'
6
6
 
7
- Metrics/LineLength:
7
+ Layout/LineLength:
8
8
  Max: 120
9
9
 
10
- Style/Style/BlockDelimiters:
10
+ Layout/SpaceBeforeBlockBraces:
11
+ EnforcedStyle: space
12
+
13
+ Layout/SpaceInsideArrayLiteralBrackets:
14
+ Enabled: false
15
+
16
+ Layout/SpaceInsideParens:
17
+ Enabled: false
18
+
19
+ Metrics/BlockLength:
20
+ Enabled: false
21
+
22
+ Metrics/MethodLength:
23
+ Enabled: false
24
+
25
+ Style/BlockDelimiters:
11
26
  Enabled: false
12
27
 
13
28
  Style/Documentation:
14
29
  Enabled: false
15
30
 
31
+ Style/ExpandPathArguments:
32
+ Enabled: false
33
+
34
+ Style/Lambda:
35
+ Enabled: false
36
+
37
+ Style/MethodMissingSuper:
38
+ Enabled: false
39
+
16
40
  Style/MutableConstant:
17
41
  Enabled: true
18
42
 
19
- Style/SpaceBeforeBlockBraces:
20
- EnforcedStyle: space
21
-
22
- Style/SpaceInsideParens:
43
+ Style/MissingRespondToMissing:
23
44
  Enabled: false
24
45
 
25
46
  Style/StringLiterals:
data/.travis.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.8
4
- - 2.4.6
5
- - 2.5.5
6
- - 2.6.2
7
- before_install: gem install bundler -v 1.17.3
3
+ - 2.6.5
4
+ - 2.7.0
5
+ - 3.0.0
6
+ before_install: gem install bundler
7
+ script:
8
+ - bundle exec rspec
9
+ - bundle exec rubocop
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "hash_dot"
data/hash_dot.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler"
31
31
  spec.add_development_dependency "rake"
32
32
  spec.add_development_dependency "rspec"
33
- spec.add_development_dependency "json"
33
+ spec.add_development_dependency "json", '>= 2.5.1'
34
34
  spec.add_development_dependency "pry"
35
35
  spec.add_development_dependency "rubocop"
36
36
  end
data/lib/hash.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Hash
2
4
  class << self
3
5
  attr_accessor :use_dot_syntax
@@ -16,7 +18,7 @@ class Hash
16
18
  def method_missing(method, *args)
17
19
  return super(method, *args) unless to_dot?
18
20
 
19
- method, chain = method.to_s.split('.', 2).map(&:to_sym)
21
+ method, chain = method.to_s.split(".", 2).map(&:to_sym)
20
22
 
21
23
  return send(method).send(chain, *args) if chain
22
24
 
@@ -31,10 +33,12 @@ class Hash
31
33
  end
32
34
  end
33
35
 
34
- def respond_to?(method, include_all=false)
36
+ def respond_to?(method, include_all = false)
35
37
  return super(method, include_all) unless to_dot?
38
+
36
39
  prop = create_prop(method)
37
40
  return true if key?(prop)
41
+
38
42
  super(method, include_all)
39
43
  end
40
44
 
@@ -48,7 +52,7 @@ class Hash
48
52
  end
49
53
  when Hash
50
54
  dotify_hash(obj, use_default: use_default)
51
- # else no-op
55
+ # else no-op
52
56
  end
53
57
  end
54
58
 
data/lib/hash_dot.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "hash_dot/version"
2
4
  require_relative "symbol"
3
5
  require_relative "hash"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HashDot
2
- VERSION = "2.4.2".freeze
4
+ VERSION = "2.5.0"
3
5
  end
data/lib/symbol.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Symbol
2
4
  def chop
3
5
  to_s.chop.to_sym
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_dot
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Steel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-09 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 2.5.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: 2.5.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.0.3
142
+ rubygems_version: 3.2.3
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Use dot syntax with Ruby hashes.