dig_rb 1.0.0 → 1.0.1

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: 8119335fa948de9dfdfccbf17dd0bb995fa92d67
4
- data.tar.gz: a5fa30724dde8b5798924b74f46ab7b49ef6b885
3
+ metadata.gz: 26a6f11a1284fe0e4021be42459a910b60f9fd96
4
+ data.tar.gz: bc90fba08f43ae321baaa80617e9754302165532
5
5
  SHA512:
6
- metadata.gz: 1575d9074b230b488030453743e3344577ed1656c8e1c9867d437e3c011d4669ead57e0c4905454893a694119b4000eda29dcb21605e70241d1bbf8aad499a33
7
- data.tar.gz: 6f685adff1c006cfcfef66c2a013ee289787b62b2c1be9706e5d82eb379af6c2e44580502b2ef10cf4586e058c93d23842349f5e3696c4d08b50df88e70f9f4c
6
+ metadata.gz: 6451f94bfe7bb07964f47f80d760bd23c7e457ec94e9555662b4edd827e12d3415dab708c1f2e17edcffdaa4f2ecb91fb209cb696f73c9a13237e694a457ee1e
7
+ data.tar.gz: 802af9a9efb24dc898c4178c79ddc7e001ba3691592d7f7d7a41114f372961c35362a25f3087f3905a08ab27ff6a98c7a2696f769b2a7c9110da4260df7a8eb0
@@ -1,3 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
3
+ - 2.2.4
4
+ - 2.1.8
5
+ - 2.0.0-p648
6
+ - jruby-9.0.4.0
7
+ - jruby-1.7.23
data/README.md CHANGED
@@ -1,16 +1,20 @@
1
1
  # Dig_rb
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/dig_rb.svg)](https://badge.fury.io/rb/dig_rb) [![Build Status](https://travis-ci.org/jrochkind/dig_rb.svg?branch=master)](https://travis-ci.org/jrochkind/dig_rb)
4
+
3
5
  [Ruby 2.3.0 introduced #dig on Hash, Array, and Struct](https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/). With this gem, you can have dig on ruby pre 2.3.0, or any ruby lacking dig.
4
6
 
5
- If you are writing an app and want to use dig in it you should probably just upgrade to ruby 2.3.0. But if you are writing a gem and want it to work with both MRI 2.3.0 and others, this gem is for you. This gem only adds #dig methods if they aren't already defined, so it's safe to use in code that is for all rubies, if run on MRI 2.3.0 you'll still be using native #dig, otherwise dig_rb's implementation.
7
+ If you are writing an app and want to use dig in it you should probably just upgrade to ruby 2.3.0. But if you are writing a gem and want it to work with both MRI 2.3.0 and others (including JRuby 9.0.x), this gem is for you. This gem only adds #dig methods if they aren't already defined, so it's safe to use in code that is for all rubies, if run on MRI 2.3.0 you'll still be using native #dig, otherwise dig_rb's implementation.
6
8
 
7
- ## Will it work identically to MRI 2.3.0 dig?
9
+ ### Will it work identically to MRI 2.3.0 dig?
8
10
 
9
11
  Dig_rb is tested with:
10
12
 
11
13
  * Specs found in MRI repo for #dig in 2.3.0
12
14
  * [Ruby Spec Suite](https://github.com/ruby/spec/) specs found in repo for Array and Hash#dig
13
- * All examples in MRI 2.3.0 generated method API docs. (One example in MRI 2.3.0 is _wrong_ about exception class/method returned, dig_rb matches actual 2.3.0 behavior there, not documented example)
15
+ * All examples in MRI 2.3.0 generated method API docs. (One example in MRI 2.3.0 is _wrong_ about exception class and message returned, dig_rb matches actual 2.3.0 behavior there, not documented example)
16
+
17
+ [Our travis](https://travis-ci.org/jrochkind/dig_rb) runs tests on a variety of ruby platforms.
14
18
 
15
19
  If you find any weird edge cases that work differenty in MRI 2.3.0 than in ruby_dig, let me know in a GitHub Issue please.
16
20
 
@@ -50,7 +54,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
50
54
 
51
55
  ## Contributing
52
56
 
53
- 1. Fork it ( https://github.com/[my-github-username]/dig_rb/fork )
57
+ 1. Fork it ( https://github.com/jrochkind/dig_rb/fork )
54
58
  2. Create your feature branch (`git checkout -b my-new-feature`)
55
59
  3. Commit your changes (`git commit -am 'Add some feature'`)
56
60
  4. Push to the branch (`git push origin my-new-feature`)
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.9"
21
+ #spec.add_development_dependency "bundler", "~> 1.9"
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "minitest", "~> 5.8.0"
23
24
  end
@@ -1,4 +1,4 @@
1
- unless Array.respond_to?(:dig)
1
+ unless Array.instance_methods.include?(:dig)
2
2
  Array.class_eval do
3
3
  def dig(key, *args)
4
4
  value = self.at(key)
@@ -7,4 +7,4 @@ unless Array.respond_to?(:dig)
7
7
  value.dig(*args)
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -1,4 +1,4 @@
1
- unless Hash.respond_to?(:dig)
1
+ unless Hash.instance_methods.include?(:dig)
2
2
  Hash.class_eval do
3
3
  # Retrieves the value object corresponding to the each key objects repeatedly.
4
4
  #
@@ -12,4 +12,4 @@ unless Hash.respond_to?(:dig)
12
12
  value.dig(*args)
13
13
  end
14
14
  end
15
- end
15
+ end
@@ -1,5 +1,5 @@
1
1
  require 'ostruct'
2
- unless OpenStruct.respond_to?(:dig)
2
+ unless OpenStruct.instance_methods.include?(:dig)
3
3
  OpenStruct.class_eval do
4
4
  #
5
5
  # Retrieves the value object corresponding to the each +name+
@@ -23,4 +23,4 @@ unless OpenStruct.respond_to?(:dig)
23
23
  value.dig(*args)
24
24
  end
25
25
  end
26
- end
26
+ end
@@ -1,5 +1,4 @@
1
- require 'ostruct'
2
- unless Struct.respond_to?(:dig)
1
+ unless Struct.instance_methods.include?(:dig)
3
2
  Struct.class_eval do
4
3
 
5
4
  # Extracts the nested value specified by the sequence of <i>idx</i>
@@ -24,4 +23,4 @@ unless Struct.respond_to?(:dig)
24
23
  value.dig(*args)
25
24
  end
26
25
  end
27
- end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module DigRb
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dig_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-18 00:00:00.000000000 Z
11
+ date: 2016-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.9'
19
+ version: '10.0'
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: '1.9'
26
+ version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 5.8.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 5.8.0
41
41
  description:
42
42
  email:
43
43
  - jonathan@dnil.net
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.5
83
+ rubygems_version: 2.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Array/Hash/Struct#dig backfill for ruby