Hello community, here is the log from the commit of package rubygem-hashie for openSUSE:Factory checked in at 2016-10-10 16:23:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-hashie (Old) and /work/SRC/openSUSE:Factory/.rubygem-hashie.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-hashie" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-hashie/rubygem-hashie.changes 2016-05-29 03:12:46.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-hashie.new/rubygem-hashie.changes 2016-10-10 16:23:29.000000000 +0200 @@ -1,0 +2,33 @@ +Sat Sep 17 04:35:31 UTC 2016 - [email protected] + +- updated to version 3.4.6 + see installed CHANGELOG.md + + [3.4.6]: https://github.com/intridea/hashie/compare/v3.4.5...v3.4.6 + + ### Fixed + + * [#368](https://github.com/intridea/hashie/pull/368): Since `hashie/mash` can be required alone, require its dependencies - [@jrafanie](https://github.com/jrafanie). + + ## [3.4.5] - 2016-09-16 + + [3.4.5]: https://github.com/intridea/hashie/compare/v3.4.4...v3.4.5 + + ### Added + + * [#337](https://github.com/intridea/hashie/pull/337), [#331](https://github.com/intridea/hashie/issues/331): `Hashie::Mash#load` accepts a `Pathname` object - [@gipcompany](https://github.com/gipcompany). + + ### Deprecated + + * [#366](https://github.com/intridea/hashie/pull/366): Hashie is no longer tested on Ruby < 2 - [@dblock](https://github.com/dblock). + + ### Fixed + + * [#358](https://github.com/intridea/hashie/pull/358): Fixed support for Array#dig - [@modosc](https://github.com/modosc). + * [#365](https://github.com/intridea/hashie/pull/365): Ensured ActiveSupport::HashWithIndifferentAccess is defined before use in #deep_locate - [@mikejarema](https://github.com/mikejarema). + + ### Miscellanous + + * [#366](https://github.com/intridea/hashie/pull/366): Added Danger, PR linter - [@dblock](https://github.com/dblock). + +------------------------------------------------------------------- Old: ---- hashie-3.4.4.gem New: ---- hashie-3.4.6.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-hashie.spec ++++++ --- /var/tmp/diff_new_pack.KUhpau/_old 2016-10-10 16:23:32.000000000 +0200 +++ /var/tmp/diff_new_pack.KUhpau/_new 2016-10-10 16:23:32.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-hashie -Version: 3.4.4 +Version: 3.4.6 Release: 0 %define mod_name hashie %define mod_full_name %{mod_name}-%{version} ++++++ hashie-3.4.4.gem -> hashie-3.4.6.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2016-04-29 18:33:16.000000000 +0200 +++ new/CHANGELOG.md 2016-09-16 19:43:04.000000000 +0200 @@ -6,6 +6,33 @@ [semver]: http://semver.org/spec/v2.0.0.html +[3.4.6]: https://github.com/intridea/hashie/compare/v3.4.5...v3.4.6 + +### Fixed + +* [#368](https://github.com/intridea/hashie/pull/368): Since `hashie/mash` can be required alone, require its dependencies - [@jrafanie](https://github.com/jrafanie). + +## [3.4.5] - 2016-09-16 + +[3.4.5]: https://github.com/intridea/hashie/compare/v3.4.4...v3.4.5 + +### Added + +* [#337](https://github.com/intridea/hashie/pull/337), [#331](https://github.com/intridea/hashie/issues/331): `Hashie::Mash#load` accepts a `Pathname` object - [@gipcompany](https://github.com/gipcompany). + +### Deprecated + +* [#366](https://github.com/intridea/hashie/pull/366): Hashie is no longer tested on Ruby < 2 - [@dblock](https://github.com/dblock). + +### Fixed + +* [#358](https://github.com/intridea/hashie/pull/358): Fixed support for Array#dig - [@modosc](https://github.com/modosc). +* [#365](https://github.com/intridea/hashie/pull/365): Ensured ActiveSupport::HashWithIndifferentAccess is defined before use in #deep_locate - [@mikejarema](https://github.com/mikejarema). + +### Miscellanous + +* [#366](https://github.com/intridea/hashie/pull/366): Added Danger, PR linter - [@dblock](https://github.com/dblock). + ## [3.4.4] - 2016-04-29 [3.4.4]: https://github.com/intridea/hashie/compare/v3.4.3...v3.4.4 @@ -17,8 +44,8 @@ ### Fixed * [#240](https://github.com/intridea/hashie/pull/240): Fixed nesting twice with Clash keys - [@bartoszkopinski](https://github.com/bartoszkopinski). -* [#317](https://github.com/intridea/hashie/pull/317): Ensure `Hashie::Extensions::MethodQuery` methods return boolean values - [@michaelherold](https://github.com/michaelherold). -* [#319](https://github.com/intridea/hashie/pull/319): Fix a regression from 3.4.1 where `Hashie::Extensions::DeepFind` is no longer indifference-aware - [@michaelherold](https://github.com/michaelherold). +* [#317](https://github.com/intridea/hashie/pull/317): Ensured `Hashie::Extensions::MethodQuery` methods return boolean values - [@michaelherold](https://github.com/michaelherold). +* [#319](https://github.com/intridea/hashie/pull/319): Fixed a regression from 3.4.1 where `Hashie::Extensions::DeepFind` is no longer indifference-aware - [@michaelherold](https://github.com/michaelherold). * [#322](https://github.com/intridea/hashie/pull/322): Fixed `reverse_merge` issue with `Mash` subclasses - [@marshall-lee](https://github.com/marshall-lee). * [#346](https://github.com/intridea/hashie/pull/346): Fixed `merge` breaking indifferent access - [@docwhat](https://github.com/docwhat), [@michaelherold](https://github.com/michaelherold). * [#350](https://github.com/intridea/hashie/pull/350): Fixed from string translations used with `IgnoreUndeclared` - [@marshall-lee](https://github.com/marshall-lee). @@ -88,10 +115,10 @@ ### Fixed * [#247](https://github.com/intridea/hashie/pull/247): Fixed #stringify_keys and #symbolize_keys collision with ActiveSupport - [@bartoszkopinski](https://github.com/bartoszkopinski). -* [#256](https://github.com/intridea/hashie/pull/256): Inherit key coercions - [@Erol](https://github.com/Erol). +* [#256](https://github.com/intridea/hashie/pull/256): Inherited key coercions - [@Erol](https://github.com/Erol). * [#259](https://github.com/intridea/hashie/pull/259): Fixed handling of default proc values in Mash - [@Erol](https://github.com/Erol). * [#261](https://github.com/intridea/hashie/pull/261): Fixed bug where Dash.property modifies argument object - [@d-tw](https://github.com/d-tw). -* [#269](https://github.com/intridea/hashie/pull/269): Add #extractable_options? so ActiveSupport Array#extract_options! can extract it - [@ridiculous](https://github.com/ridiculous). +* [#269](https://github.com/intridea/hashie/pull/269): Added #extractable_options? so ActiveSupport Array#extract_options! can extract it - [@ridiculous](https://github.com/ridiculous). ## [3.3.2] - 2014-11-26 @@ -105,7 +132,7 @@ ### Fixed -* [#221](https://github.com/intridea/hashie/pull/221): Reduce amount of allocated objects on calls with suffixes in Hashie::Mash - [@kubum](https://github.com/kubum). +* [#221](https://github.com/intridea/hashie/pull/221): Reduced amount of allocated objects on calls with suffixes in Hashie::Mash - [@kubum](https://github.com/kubum). * [#224](https://github.com/intridea/hashie/pull/224): Merging Hashie::Mash now correctly only calls the block on duplicate values - [@amysutedja](https://github.com/amysutedja). * [#228](https://github.com/intridea/hashie/pull/228): Made Hashie::Extensions::Parsers::YamlErbParser pass template filename to ERB - [@jperville](https://github.com/jperville). @@ -118,17 +145,17 @@ * [#183](https://github.com/intridea/hashie/pull/183): Added Mash#load with YAML file support - [@gregory](https://github.com/gregory). * [#189](https://github.com/intridea/hashie/pull/189): Added Rash#fetch - [@medcat](https://github.com/medcat). * [#204](https://github.com/intridea/hashie/pull/204): Added Hashie::Extensions::MethodOverridingWriter and MethodAccessWithOverride - [@michaelherold](https://github.com/michaelherold). -* [#205](http://github.com/intridea/hashie/pull/205): Added Hashie::Extensions::Mash::SafeAssignment - [@michaelherold](https://github.com/michaelherold). -* [#209](http://github.com/intridea/hashie/pull/209): Added Hashie::Extensions::DeepFind - [@michaelherold](https://github.com/michaelherold). +* [#205](https://github.com/intridea/hashie/pull/205): Added Hashie::Extensions::Mash::SafeAssignment - [@michaelherold](https://github.com/michaelherold). +* [#209](https://github.com/intridea/hashie/pull/209): Added Hashie::Extensions::DeepFind - [@michaelherold](https://github.com/michaelherold). ### Fixed * [#69](https://github.com/intridea/hashie/pull/69): Fixed regression in assigning multiple properties in Hashie::Trash - [@michaelherold](https://github.com/michaelherold), [@einzige](https://github.com/einzige), [@dblock](https://github.com/dblock). -* [#195](https://github.com/intridea/hashie/pull/195): Ensure that the same object is returned after injecting IndifferentAccess - [@michaelherold](https://github.com/michaelherold). +* [#195](https://github.com/intridea/hashie/pull/195): Ensured that the same object is returned after injecting IndifferentAccess - [@michaelherold](https://github.com/michaelherold). * [#201](https://github.com/intridea/hashie/pull/201): Hashie::Trash transforms can be inherited - [@fobocaster](https://github.com/fobocaster). * [#200](https://github.com/intridea/hashie/pull/200): Improved coercion: primitives and error handling - [@maxlinc](https://github.com/maxlinc). -* [#206](http://github.com/intridea/hashie/pull/206): Fixed stack overflow from repetitively including coercion in subclasses - [@michaelherold](https://github.com/michaelherold). -* [#207](http://github.com/intridea/hashie/pull/207): Fixed inheritance of transformations in Trash - [@fobocaster](https://github.com/fobocaster). +* [#206](https://github.com/intridea/hashie/pull/206): Fixed stack overflow from repetitively including coercion in subclasses - [@michaelherold](https://github.com/michaelherold). +* [#207](https://github.com/intridea/hashie/pull/207): Fixed inheritance of transformations in Trash - [@fobocaster](https://github.com/fobocaster). ## [3.2.0] - 2014-07-10 @@ -172,7 +199,7 @@ [3.0.0]: https://github.com/intridea/hashie/compare/v2.1.2...v3.0.0 -**Note:** This version introduces several backward incompatible API changes. See [UPGRADING](UPGRADING.md) for details. +Note: This version introduces several backward incompatible API changes. See [UPGRADING](UPGRADING.md) for details. ### Added @@ -213,7 +240,7 @@ ### Added -* [#134](https://github.com/intridea/hashie/pull/134): Add deep_fetch extension for nested access - [@tylerdooling](https://github.com/tylerdooling). +* [#134](https://github.com/intridea/hashie/pull/134): Added deep_fetch extension for nested access - [@tylerdooling](https://github.com/tylerdooling). ### Changed @@ -249,7 +276,7 @@ ### Fixed -* [#96](https://github.com/intridea/hashie/pull/96): Make coercion work better with non-symbol keys in Hashie::Mash - [@wapcaplet](https://github.com/wapcaplet). +* [#96](https://github.com/intridea/hashie/pull/96): Made coercion work better with non-symbol keys in Hashie::Mash - [@wapcaplet](https://github.com/wapcaplet). ## [2.0.4] - 2013-04-24 @@ -257,7 +284,7 @@ ### Fixed -* [#94](https://github.com/intridea/hashie/pull/94): Make #fetch method consistent with normal Hash - [@markiz](https://github.com/markiz). +* [#94](https://github.com/intridea/hashie/pull/94): Made #fetch method consistent with normal Hash - [@markiz](https://github.com/markiz). ### Miscellaneous @@ -269,7 +296,7 @@ ### Fixed -* [#68](https://github.com/intridea/hashie/pull/68): Fix #replace - [@jimeh](https://github.com/jimeh). +* [#68](https://github.com/intridea/hashie/pull/68): Fixed #replace - [@jimeh](https://github.com/jimeh). * [#88](https://github.com/intridea/hashie/pull/88): Hashie::Mash.new(abc: true).respond_to?(:abc?) works - [@7even](https://github.com/7even). ## [2.0.2] - 2013-02-26 @@ -278,7 +305,7 @@ ### Fixed -* [#85](https://github.com/intridea/hashie/pull/85): adding symbolize_keys back to to_hash - [@cromulus](https://github.com/cromulus). +* [#85](https://github.com/intridea/hashie/pull/85): Added symbolize_keys back to to_hash - [@cromulus](https://github.com/cromulus). ## [2.0.1] - 2013-02-26 @@ -286,11 +313,11 @@ ### Removed -* [#81](https://github.com/intridea/hashie/pull/81): remove Mash#object_id override - [@matschaffer](https://github.com/matschaffer). +* [#81](https://github.com/intridea/hashie/pull/81): Removed Mash#object_id override - [@matschaffer](https://github.com/matschaffer). ### Miscellaneous -* Gem cleanup: removed VERSION, Gemfile.lock [@jch](https://github.com/jch), [@mbleigh](https://github.com/mbleigh). +* Gem cleanup: removed VERSION, Gemfile.lock - [@jch](https://github.com/jch), [@mbleigh](https://github.com/mbleigh). ## [2.0.0] - 2013-02-16 @@ -304,14 +331,14 @@ ### Changed * [#28](https://github.com/intridea/hashie/pull/28): Hashie::Extensions::Coercion coerce_keys takes arguments - [@mattfawcett](https://github.com/mattfawcett). -* [#77](https://github.com/intridea/hashie/pull/77): Remove id, type, and object_id as special allowable keys [@jch](https://github.com/jch). +* [#77](https://github.com/intridea/hashie/pull/77): Removed id, type, and object_id as special allowable keys - [@jch](https://github.com/jch). ### Fixed -* [#27](https://github.com/intridea/hashie/pull/27): Initialized with merge coerces values - [@mattfawcett](https://github.com/mattfawcett). +* [#27](https://github.com/intridea/hashie/pull/27): Initialize with merge coerces values - [@mattfawcett](https://github.com/mattfawcett). * [#39](https://github.com/intridea/hashie/pull/39): Trash removes translated values on initialization - [@sleverbor](https://github.com/sleverbor). * [#49](https://github.com/intridea/hashie/pull/49): Hashie::Hash inherits from ::Hash to avoid ambiguity - [@meh](https://github.com/meh), [@orend](https://github.com/orend). -* [#62](https://github.com/intridea/hashie/pull/62): update respond_to? method signature to match ruby core definition - [@dlupu](https://github.com/dlupu). +* [#62](https://github.com/intridea/hashie/pull/62): Updated respond_to? method signature to match ruby core definition - [@dlupu](https://github.com/dlupu). * [#63](https://github.com/intridea/hashie/pull/63): Dash defaults are dup'ed before assigned - [@ohrite](https://github.com/ohrite). * [#66](https://github.com/intridea/hashie/pull/66): Mash#fetch works with symbol or string keys - [@arthwood](https://github.com/arthwood). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2016-04-29 18:33:16.000000000 +0200 +++ new/README.md 2016-09-16 19:43:04.000000000 +0200 @@ -20,7 +20,7 @@ ## Upgrading -You're reading the documentation for the stable release of Hashie, 3.4.4. Please read [UPGRADING](UPGRADING.md) when upgrading from a previous version. +You're reading the documentation for the stable release of Hashie, 3.4.6. Please read [UPGRADING](UPGRADING.md) when upgrading from a previous version. ## Hash Extensions @@ -490,6 +490,13 @@ mash.development.api_key? # => true ``` +You can also load with a `Pathname` object: + +```ruby +mash = Mash.load(Pathname 'settings/twitter.yml') +mash.development.api_key # => 'localhost' +``` + You can access a Mash from another class: ```ruby Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/array.rb new/lib/hashie/array.rb --- old/lib/hashie/array.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/hashie/array.rb 2016-09-16 19:43:04.000000000 +0200 @@ -0,0 +1,14 @@ +require 'hashie/extensions/array/pretty_inspect' +require 'hashie/extensions/ruby_version_check' + +module Hashie + class Array < ::Array + include Hashie::Extensions::Array::PrettyInspect + include Hashie::Extensions::RubyVersionCheck + with_minimum_ruby('2.3.0') do + def dig(*indexes) + super(*indexes.map { |idx| Integer(idx) }) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/extensions/array/pretty_inspect.rb new/lib/hashie/extensions/array/pretty_inspect.rb --- old/lib/hashie/extensions/array/pretty_inspect.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/hashie/extensions/array/pretty_inspect.rb 2016-09-16 19:43:04.000000000 +0200 @@ -0,0 +1,19 @@ +module Hashie + module Extensions + module Array + module PrettyInspect + def self.included(base) + base.send :alias_method, :array_inspect, :inspect + base.send :alias_method, :inspect, :hashie_inspect + end + + def hashie_inspect + ret = "#<#{self.class} [" + ret << to_a.map(&:inspect).join(', ') + ret << ']>' + ret + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/extensions/deep_locate.rb new/lib/hashie/extensions/deep_locate.rb --- old/lib/hashie/extensions/deep_locate.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/lib/hashie/extensions/deep_locate.rb 2016-09-16 19:43:04.000000000 +0200 @@ -64,7 +64,7 @@ private def self._construct_key_comparator(search_key, object) - search_key = search_key.to_s if defined?(::ActiveSupport) && object.is_a?(::ActiveSupport::HashWithIndifferentAccess) + search_key = search_key.to_s if defined?(::ActiveSupport::HashWithIndifferentAccess) && object.is_a?(::ActiveSupport::HashWithIndifferentAccess) search_key = search_key.to_s if object.respond_to?(:indifferent_access?) && object.indifferent_access? lambda do |non_callable_object| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/extensions/parsers/yaml_erb_parser.rb new/lib/hashie/extensions/parsers/yaml_erb_parser.rb --- old/lib/hashie/extensions/parsers/yaml_erb_parser.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/lib/hashie/extensions/parsers/yaml_erb_parser.rb 2016-09-16 19:43:04.000000000 +0200 @@ -6,7 +6,7 @@ class YamlErbParser def initialize(file_path) @content = File.read(file_path) - @file_path = file_path + @file_path = file_path.is_a?(Pathname) ? file_path.to_s : file_path end def perform diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/extensions/ruby_version_check.rb new/lib/hashie/extensions/ruby_version_check.rb --- old/lib/hashie/extensions/ruby_version_check.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/hashie/extensions/ruby_version_check.rb 2016-09-16 19:43:04.000000000 +0200 @@ -0,0 +1,15 @@ +module Hashie + module Extensions + module RubyVersionCheck + def self.included(base) + base.extend ClassMethods + end + + module ClassMethods + def with_minimum_ruby(version) + yield if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(version) + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/mash.rb new/lib/hashie/mash.rb --- old/lib/hashie/mash.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/lib/hashie/mash.rb 2016-09-16 19:43:04.000000000 +0200 @@ -1,4 +1,5 @@ require 'hashie/hash' +require 'hashie/array' module Hashie # Mash allows you to create pseudo-objects that have method-like @@ -56,6 +57,7 @@ # class Mash < Hash include Hashie::Extensions::PrettyInspect + include Hashie::Extensions::RubyVersionCheck ALLOWED_SUFFIXES = %w(? ! = _) @@ -250,7 +252,7 @@ self.class.new(other_hash).merge(self) end - if RUBY_VERSION >= '2.3.0' + with_minimum_ruby('2.3.0') do def dig(*keys) super(*keys.map { |key| convert_key(key) }) end @@ -287,6 +289,8 @@ self.class.new(val) when Array val.map { |e| convert_value(e) } + when ::Array + Array.new(val.map { |e| convert_value(e) }) else val end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie/version.rb new/lib/hashie/version.rb --- old/lib/hashie/version.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/lib/hashie/version.rb 2016-09-16 19:43:04.000000000 +0200 @@ -1,3 +1,3 @@ module Hashie - VERSION = '3.4.4' + VERSION = '3.4.6' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/hashie.rb new/lib/hashie.rb --- old/lib/hashie.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/lib/hashie.rb 2016-09-16 19:43:04.000000000 +0200 @@ -7,6 +7,7 @@ autoload :Mash, 'hashie/mash' autoload :Trash, 'hashie/trash' autoload :Rash, 'hashie/rash' + autoload :Array, 'hashie/array' module Extensions autoload :Coercion, 'hashie/extensions/coercion' @@ -27,6 +28,7 @@ autoload :KeyConversion, 'hashie/extensions/key_conversion' autoload :MethodAccessWithOverride, 'hashie/extensions/method_access' autoload :StrictKeyAccess, 'hashie/extensions/strict_key_access' + autoload :RubyVersionCheck, 'hashie/extensions/ruby_version_check' module Parsers autoload :YamlErbParser, 'hashie/extensions/parsers/yaml_erb_parser' @@ -41,6 +43,10 @@ module Mash autoload :SafeAssignment, 'hashie/extensions/mash/safe_assignment' end + + module Array + autoload :PrettyInspect, 'hashie/extensions/array/pretty_inspect' + end end class << self diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2016-04-29 18:33:16.000000000 +0200 +++ new/metadata 2016-09-16 19:43:04.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: hashie version: !ruby/object:Gem::Version - version: 3.4.4 + version: 3.4.6 platform: ruby authors: - Michael Bleigh @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2016-04-29 00:00:00.000000000 Z +date: 2016-09-16 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake @@ -70,8 +70,10 @@ - UPGRADING.md - hashie.gemspec - lib/hashie.rb +- lib/hashie/array.rb - lib/hashie/clash.rb - lib/hashie/dash.rb +- lib/hashie/extensions/array/pretty_inspect.rb - lib/hashie/extensions/coercion.rb - lib/hashie/extensions/dash/coercion.rb - lib/hashie/extensions/dash/indifferent_access.rb @@ -88,6 +90,7 @@ - lib/hashie/extensions/method_access.rb - lib/hashie/extensions/parsers/yaml_erb_parser.rb - lib/hashie/extensions/pretty_inspect.rb +- lib/hashie/extensions/ruby_version_check.rb - lib/hashie/extensions/strict_key_access.rb - lib/hashie/extensions/stringify_keys.rb - lib/hashie/extensions/symbolize_keys.rb @@ -96,6 +99,7 @@ - lib/hashie/rash.rb - lib/hashie/trash.rb - lib/hashie/version.rb +- spec/hashie/array_spec.rb - spec/hashie/clash_spec.rb - spec/hashie/dash_spec.rb - spec/hashie/extensions/autoload_spec.rb @@ -124,6 +128,7 @@ - spec/hashie/version_spec.rb - spec/spec_helper.rb - spec/support/module_context.rb +- spec/support/ruby_version_check.rb homepage: https://github.com/intridea/hashie licenses: - MIT @@ -144,11 +149,12 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.4.6 +rubygems_version: 2.5.1 signing_key: specification_version: 4 summary: Your friendly neighborhood hash library. test_files: +- spec/hashie/array_spec.rb - spec/hashie/clash_spec.rb - spec/hashie/dash_spec.rb - spec/hashie/extensions/autoload_spec.rb @@ -177,3 +183,4 @@ - spec/hashie/version_spec.rb - spec/spec_helper.rb - spec/support/module_context.rb +- spec/support/ruby_version_check.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/hashie/array_spec.rb new/spec/hashie/array_spec.rb --- old/spec/hashie/array_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/hashie/array_spec.rb 2016-09-16 19:43:04.000000000 +0200 @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Array do + with_minimum_ruby('2.3.0') do + describe '#dig' do + let(:array) { Hashie::Array.new([:a, :b, :c]) } + + it 'works with a string index' do + expect(array.dig('0')).to eq(:a) + end + + it 'works with a numeric index' do + expect(array.dig(1)).to eq(:b) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/hashie/mash_spec.rb new/spec/hashie/mash_spec.rb --- old/spec/hashie/mash_spec.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/spec/hashie/mash_spec.rb 2016-09-16 19:43:04.000000000 +0200 @@ -687,14 +687,21 @@ end end - if RUBY_VERSION >= '2.3.0' + with_minimum_ruby('2.3.0') do describe '#dig' do subject { described_class.new(a: { b: 1 }) } - it 'accepts both string and symbol as key' do expect(subject.dig(:a, :b)).to eq(1) expect(subject.dig('a', 'b')).to eq(1) end + + context 'with numeric key' do + subject { described_class.new('1' => { b: 1 }) } + it 'accepts a numeric value as key' do + expect(subject.dig(1, :b)).to eq(1) + expect(subject.dig('1', :b)).to eq(1) + end + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/hashie/parsers/yaml_erb_parser_spec.rb new/spec/hashie/parsers/yaml_erb_parser_spec.rb --- old/spec/hashie/parsers/yaml_erb_parser_spec.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/spec/hashie/parsers/yaml_erb_parser_spec.rb 2016-09-16 19:43:04.000000000 +0200 @@ -2,28 +2,45 @@ describe Hashie::Extensions::Parsers::YamlErbParser do describe '.perform' do - let(:config) do - <<-EOF + context 'a file' do + let(:config) do + <<-EOF --- foo: verbatim bar: <%= "erb" %> baz: "<%= __FILE__ %>" - EOF - end - let(:path) { 'template.yml' } + EOF + end + let(:path) { 'template.yml' } + + subject { described_class.new(path).perform } - subject { described_class.new(path).perform } + before do + expect(File).to receive(:read).with(path).and_return(config) + end - before do - expect(File).to receive(:read).with(path).and_return(config) + it { is_expected.to be_a(Hash) } + + it 'parses YAML after interpolating ERB' do + expect(subject['foo']).to eq 'verbatim' + expect(subject['bar']).to eq 'erb' + expect(subject['baz']).to eq path + end end - it { is_expected.to be_a(Hash) } + context 'Pathname' do + let(:tempfile) do + file = Tempfile.new(['foo', '.yml']) + file.write("---\nfoo: hello\n") + file.rewind + file + end + + subject { described_class.new(Pathname tempfile.path) } - it 'parses YAML after interpolating ERB' do - expect(subject['foo']).to eq 'verbatim' - expect(subject['bar']).to eq 'erb' - expect(subject['baz']).to eq path + it '"#perform" can be done in case of path is a Pathname object.' do + expect(subject.perform).to eq 'foo' => 'hello' + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb --- old/spec/spec_helper.rb 2016-04-29 18:33:16.000000000 +0200 +++ new/spec/spec_helper.rb 2016-09-16 19:43:04.000000000 +0200 @@ -8,8 +8,10 @@ require 'rspec' require 'hashie' require 'rspec/pending_for' +require './spec/support/ruby_version_check' RSpec.configure do |config| + config.extend RubyVersionCheck config.expect_with :rspec do |expect| expect.syntax = :expect end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spec/support/ruby_version_check.rb new/spec/support/ruby_version_check.rb --- old/spec/support/ruby_version_check.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/spec/support/ruby_version_check.rb 2016-09-16 19:43:04.000000000 +0200 @@ -0,0 +1,5 @@ +module RubyVersionCheck + def with_minimum_ruby(version) + yield if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(version) + end +end
