lean-attributes 0.3.0 → 0.3.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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmE0YWM3ZjBjMDJhYzBkMzNmMmIxMjgyM2FjM2U2ZDhjYmVkMTIxZg==
4
+ N2I3NGVhOGJiNDk5OGI3YjNiNTRiMGJmY2M0MTk3YmFmOTY4OGNkZg==
5
5
  data.tar.gz: !binary |-
6
- YWIyODY5MTE5MTYxNzJkMDA0NDY1M2Q1ZTIwODU0Y2JkZDkwZGZmYQ==
6
+ YjMzYzg1MTk5NWRlYjcyNWUwNTgyMDVhMDQ0MTE5N2Y3YmYxYTY5Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2Q0ODkzNGVlNmZmZjMzMmM2OWY4YzM3MWQzYTRlMTg0ZGEyNGJiMTMwYmJh
10
- ZjU3MDdmZjBhZjkyZDg0NzUwMDUyODU3YjNiNjI5MWU4NmYxYmI0M2FjMDNh
11
- Yzg3MTJmNDhjMGM1Y2JiODBmNmFhZDkxOWE2YWFiMWZjODZiMWY=
9
+ MDJlYzk5NTU3M2QyMjkzMTEyODFmMzEyMWQ3NTUyMTE2MDAwYzk5MmU5NWQ2
10
+ ZDU3ZDNkZTkxZGY0NGY4NzBmYjYzYWZhZGU0MjQ4YWQ2YzNlMjJkYTIzMzQ0
11
+ N2IzNDViNWM4NmE2NzdhYmUwNzBjOTdkMjlhZTc2Nzc4NTc1ZTc=
12
12
  data.tar.gz: !binary |-
13
- MWM5ZGIzYjM3MzU1OWNlYWNkYjg2ZmRhZDk4MjE3MTM3M2M0MzFiNTNkMmE1
14
- YWQ3MDkxMTllNTNkNTM2ZDdiZGVhYWY3MGZmMzEwMTZlMjhhNDVhMzdhOWFk
15
- MDI2YTAxNjU1ZThkN2Y1ZTg0MzBmNTViYmQxZTU2ZjBiOTc3YWQ=
13
+ ZWUwOTM2NzMxZTAwM2VmZmUyNzQ0NzYyNjdkZDNmNmNkM2MzYjQxMDUyYzcy
14
+ YjkwYzY4NzUxOGYwZGI3MWEwZTJkYmYwMWMzMjhiMmExMTMyYzgyZjQxYTA5
15
+ ODhkOWJlMDMwNzhiYTZmY2QwNDc2OWI0NDU5ZWI4OWYzNGUwMTU=
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased][unreleased]
6
6
 
7
+ ## [0.3.1] - 2016-05-17
8
+ ### Fixed
9
+ - Fixes a bug where values for custom types would be unnecessarily coerced irrespective of whether they were already of the expected type or not
10
+
7
11
  ## [0.3.0] - 2016-03-07
8
12
  ### Added
9
13
  - Adds benchmarks for ActiveAttr
data/README.md CHANGED
@@ -13,7 +13,7 @@ Lean::Attributes is inspired by gems like [Virtus](https://github.com/solnic/vir
13
13
  ## Installation
14
14
  Add this line to your Gemfile:
15
15
  ```ruby
16
- gem 'lean-attributes', '~> 0.2'
16
+ gem 'lean-attributes', '~> 0.3'
17
17
  ```
18
18
 
19
19
  And then execute:
@@ -35,7 +35,8 @@ module Lean
35
35
  #
36
36
  # @see Attribute#coercion_method
37
37
  def self.method_body_for_type(type)
38
- METHOD_BODIES[type] || "#{type}.new(value)"
38
+ METHOD_BODIES[type] ||
39
+ "value.is_a?(#{type}) ? value : #{type}.new(value)"
39
40
  end
40
41
  end
41
42
  end
@@ -1,5 +1,5 @@
1
1
  module Lean
2
2
  module Attributes
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lean-attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - R. Elliott Mason
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake