hash_at_path 0.1.5 → 0.1.6

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
- SHA1:
3
- metadata.gz: 26693c09d948e6a93da8583d20d8d6e9497601ea
4
- data.tar.gz: 8d65f436207117e4d02514bbca08d64506ffff77
2
+ SHA256:
3
+ metadata.gz: 4d9f5b0a2917bdf1119fcbde29bc0553d0b129d05cd37a8300e5444d647877be
4
+ data.tar.gz: ff184eb411d56d2075557fa35ef47c2c110d05a2735ea4cde1405eb484d7bc9b
5
5
  SHA512:
6
- metadata.gz: 932438e198e00d32537ff2310a50e8095bd87e8eb6f57b54ddca4de82fe8acf64fa7b0cd409871f80081464aef78e55b591427c89d112f53000531bc77dd5b7c
7
- data.tar.gz: 49b8c7191b94e3d6a593f95273dbc655c2f7ca8feafd457e37f78d0c8234754908f51b75c23e97603528a6168bb2886ca4a5b3c7003fcc85c355a6109a1bcf30
6
+ metadata.gz: 6b9ffdfd6f03a658740e170eb474bfe49973b29be63ec5de545a8f797d6cd8b354c8a6527816cd0d8473ac9b0e00772893067c21ccf0a9fa1962eca8d199ddde
7
+ data.tar.gz: 5c33bba88b68c4d908459af8d112b5f8022cd0ec3b7482e05c3c10015fd6653229cf50cebce6cf76099c4e6e7b565d4f7fd74cfeb7262553e0bd5ed903a15f27
@@ -1,8 +1,10 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.2.2
5
- - 2.1.0
6
- - rbx-2
4
+ - 2.4.1
5
+ - 2.3.4
7
6
  - jruby-head
8
7
  - ruby-head
8
+ before_install: # For jruby-head to work.
9
+ - gem install bundler
10
+ - gem update bundler
@@ -1,25 +1,26 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'hash_at_path/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "hash_at_path"
8
+ spec.name = 'hash_at_path'
8
9
  spec.version = HashAtPath::VERSION
9
- spec.authors = ["chadfennell"]
10
- spec.email = ["libsys@gmail.com"]
10
+ spec.authors = ['chadfennell']
11
+ spec.email = ['libsys@gmail.com']
11
12
 
12
- spec.summary = %q{Extends Hash with xpath like syntax for retrieving hash values.}
13
- spec.homepage = "https://github.com/UMNLibraries/hash_at_path"
14
- spec.license = "MIT"
13
+ spec.summary = 'Extends Hash with xpath like syntax for retrieving hash values.'
14
+ spec.homepage = 'https://github.com/UMNLibraries/hash_at_path'
15
+ spec.license = 'MIT'
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
+ spec.bindir = 'exe'
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
20
21
 
21
22
  spec.required_ruby_version = '>= 2.1'
22
23
 
23
- spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "rspec", "~> 3.1"
24
+ spec.add_development_dependency 'rake', '>= 12.3.3'
25
+ spec.add_development_dependency 'rspec', '~> 3.1'
25
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HashAtPath
2
4
  class Path
3
5
  class << self
@@ -7,18 +9,19 @@ module HashAtPath
7
9
  end
8
10
 
9
11
  def replace_predicates(path_string)
10
- path_string.gsub!(/first\(\)/, "0")
11
- path_string.gsub!(/last\(\)/, "-1")
12
+ path_string = path_string.gsub(/first\(\)/, '0')
13
+ path_string = path_string.gsub(/last\(\)/, '-1')
12
14
  path_string
13
15
  end
14
16
 
15
17
  # Extracts paths and predicates from the provide full path
16
18
  def extract_path_data(path_string)
17
19
  results = array_wrap(path_string.scan(/([^\[]*)(\[)*(\d|\-\d|\*)*(\])*/i))
18
- results.map {|match| {:path => match[0], :predicate => match[2]}}
20
+ results.map { |match| { path: match[0], predicate: match[2] } }
19
21
  end
20
22
 
21
23
  private
24
+
22
25
  # Stolen from activesupport/lib/active_support/core_ext/array/wrap.rb
23
26
  def array_wrap(object)
24
27
  if object.nil?
@@ -31,4 +34,4 @@ module HashAtPath
31
34
  end
32
35
  end
33
36
  end
34
- end
37
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HashAtPath
2
- VERSION = "0.1.5"
4
+ VERSION = '0.1.6'
3
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hash_at_path
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - chadfennell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2020-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: 12.3.3
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: 12.3.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,8 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubyforge_project:
82
- rubygems_version: 2.5.1
81
+ rubygems_version: 3.0.6
83
82
  signing_key:
84
83
  specification_version: 4
85
84
  summary: Extends Hash with xpath like syntax for retrieving hash values.