ruby_quirks 0.0.1 → 0.0.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTA0MGEzMzc4YmViYmRiNTEwODIyZWQzNjEzMDViNTBlYzRmOTY0MQ==
4
+ ODk1YzYxYTE4NWQ0NmUxNWYwYzI0NjhkMmNlMzE4OTVkM2MzN2ZlYw==
5
5
  data.tar.gz: !binary |-
6
- ZTIxMGU5MGQ5OGUyYzQ2MjRmMjA5ZDg3YzE4YWQ1NTFlYWZhOGRhOQ==
6
+ NTIyODJjNTA5OTg1YmVjMjE2YjRlOWJmZWUwZGVmN2RlMGNmMmI2OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTVhOTFkNTBlYjYxYTI5MjUwYmU4MjBmYjU0NGMwNzE2MDkxNmQ4OWY4MTM2
10
- NDJkNTE0NDBmMWMzZmNhMWJhM2VkZmRlNWZhNjYwMDUzMjYwZDA2NjhkZWE0
11
- OGE2YjRmYjk2NWY5NjBjMjNhMjc3MGJiM2I0Y2ZlODY4ODJiNTY=
9
+ ZTZmNDZjNzUyMDJmZGVjZTc0MjQ4NTMwNzczOTNlMjE5ZjEwMGJmMGM1Y2Vm
10
+ ZWZjN2JkODc0ZjE1ZWIxZDViZDEyZWQxNzA0M2M3NDIxMjA4ZGYzNmFjNzgx
11
+ ZjVmZTA1MTJhNDFjNTBjYzI1OWI3MjE0YTZiOTVjNDJhNWFjMWE=
12
12
  data.tar.gz: !binary |-
13
- YTk3N2ZjYzkzZDlkZTIyNzRmZTA1YTY1Nzk1MGZjYWI5NDJkNmMzNzI3OGNk
14
- ZWE2YjA1N2JkMDE4MDU2MjNiZTRiODYzYjE3ZjE0M2YyNWVhOTY1MjczZWUw
15
- ZTg0NGU5MTY2YzhhYjZiNGE3ZjM1MjQwYTFiMWZmNmEzM2Q1YmI=
13
+ NDFiNzdhNmUxZTZiMWVlMzEzMzJkMzMxYTllMTdkZTc3Y2ZiMjMzOTQzMDQ5
14
+ NzJkMWRiY2Y1MWIzNmI4NTg3YmQ5NDE5ODEzNDNiNzljMTE2YTM5ZGNlMjM0
15
+ ZTg4MDI4YjI2NjFjZGJhOTk5OTUxYWU4NzZlYTU5NDcxNzQ0YmQ=
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  Ruby Quirks
2
2
  ===========
3
3
 
4
- [![Build Status](https://travis-ci.org/StreetEasy/ruby_quirks.svg?branch=master)](https://travis-ci.org/StreetEasy/ruby_quirks) ![Gem Version](https://badge.fury.io/rb/ruby_quirks.svg)
5
- ###### *For Ruby 1.9.3, 2.0.0, 2.1.0*
4
+ [![Build Status](https://travis-ci.org/delner/ruby_quirks.svg?branch=master)](https://travis-ci.org/delner/ruby_quirks) ![Gem Version](https://badge.fury.io/rb/ruby_quirks.svg)
5
+ ###### *For Ruby 1.9.3, 2.0.x, 2.1.x, 2.2.x*
6
6
 
7
7
  ### Introduction
8
8
 
@@ -11,5 +11,24 @@ Ruby Quirks
11
11
  ### Hotfixes
12
12
 
13
13
  #### Hash#reject and Hash#select returns Hash for subclasses of Hash
14
- **Ruby versions: 2.2.0+**
15
- **Description:
14
+
15
+ - **For Ruby versions:** 2.2.0+
16
+ - **Description:** Calling `#reject` or `#select` against an instance of a class that inherits from `Hash` will return an object of type `Hash`, rather than an object of the same type that `#reject` or `#select` was called against. e.g. This broke Rails' `HashWithIndifferentAccess`. See [this question](http://stackoverflow.com/questions/33638665/ruby-2-2-hashreject-returning-hash-for-inheriting-classes) for more details.
17
+ - **What this hotfix does:** It overrides `#reject` and `#select` of implementing classes to use `#dup` to return an object of the same type. This effectively replicates pre-2.2 behavior of `Hash`.
18
+ - **How to implement:** Include the `RubyQuirks::Hash::EnumByDup` in your class that inherits from `Hash`
19
+ - **Example:**
20
+
21
+ module CustomHash < Hash
22
+ include RubyQuirks::Hash::EnumByDup
23
+ end
24
+
25
+ ### Changelog
26
+
27
+ #### Version 0.0.2
28
+
29
+ - Fixed: Namespace not loading (whoops!)
30
+
31
+ #### Version 0.0.1
32
+
33
+ - Initial version of Ruby Quirks
34
+ - Added: `RubyQuirks::Hash::EnumByDup`
data/lib/ruby_quirks.rb CHANGED
@@ -1 +1,3 @@
1
+ require 'ruby_quirks/version'
2
+
1
3
  require 'ruby_quirks/hash'
@@ -1,3 +1,3 @@
1
1
  module RubyQuirks
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/ruby_quirks.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.version = RubyQuirks::VERSION
9
9
  s.authors = ["David Elner"]
10
10
  s.email = ["david@streeteasy.com"]
11
- s.homepage = "http://streeteasy.com"
11
+ s.homepage = "https://github.com/delner/ruby_quirks"
12
12
  s.summary = "Hotfixes and common idioms for the Ruby language."
13
13
  s.description = "Hotfixes and common idioms for the Ruby language."
14
14
  s.license = "MIT"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_quirks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Elner
@@ -72,7 +72,7 @@ files:
72
72
  - ruby_quirks.gemspec
73
73
  - spec/ruby_quirks/hash/enum_by_dup_spec.rb
74
74
  - spec/spec_helper.rb
75
- homepage: http://streeteasy.com
75
+ homepage: https://github.com/delner/ruby_quirks
76
76
  licenses:
77
77
  - MIT
78
78
  metadata: {}