active_attr 0.12.0 → 0.13.0

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.

Potentially problematic release.


This version of active_attr might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02c6c69fe8a87196740e45c3e827e832b09a8eca
4
- data.tar.gz: ce44bea22a9b8d2dbc753bc9a81cee7f51b4c6da
3
+ metadata.gz: 51278f667fa7e613cd46655c1f19970f66740fb0
4
+ data.tar.gz: cb9db1fa72766751d76ed10ac783bb301f3f7ca8
5
5
  SHA512:
6
- metadata.gz: 9a13a61893450f32efa41744f7187e0cf4988359db4cf556de5175098fa9e357dd6744319e8fd43b786bcf4c9b156ea92aff74f9d26ccb1100c1821272e8a9b2
7
- data.tar.gz: 605675def174c8cd4d83d2b2b7bc9c99a57c625409cc6124f3bf163d234441c96f93cd71d78e542d4eccc52824dec4c3fae94e0d154573c088623af147797ce1
6
+ metadata.gz: 468c65ec0ee598cd5371e1fb176edb280e6ac06d8d81a66c7a3660062e431633e01f3e2ea597c6a115ab983bfc98e2d04c8b071d0792f744380bfc5048b4ddb9
7
+ data.tar.gz: c44da46b5e82fa1dbcd2b9ca698a4f800c5a488319b316cc2f63605449e123cb20d4bbdd64f4f6abe0f967997afe9cdce60cdfd611212937c323ef188549e108
@@ -7,10 +7,13 @@ rvm:
7
7
  - 2.0.0
8
8
  - 2.1.10
9
9
  - 2.2.10
10
- - 2.3.7
11
- - 2.4.4
12
- - 2.5.1
13
- before_install: gem install bundler
10
+ - 2.3.8
11
+ - 2.4.6
12
+ - 2.5.5
13
+ - 2.6.2
14
+ before_install:
15
+ - travis_retry gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
16
+ - travis_retry gem install bundler -v '< 2'
14
17
  bundler_args: --without development
15
18
  gemfile:
16
19
  - gemfiles/rails_3_0.gemfile
@@ -27,7 +30,9 @@ matrix:
27
30
  allow_failures:
28
31
  - gemfile: gemfiles/rails_head.gemfile
29
32
  exclude:
30
- - rvm: 2.5.1
33
+ - rvm: 2.5.5
34
+ gemfile: gemfiles/rails_3_0.gemfile
35
+ - rvm: 2.6.2
31
36
  gemfile: gemfiles/rails_3_0.gemfile
32
37
  - rvm: ree
33
38
  gemfile: gemfiles/rails_4_0.gemfile
@@ -81,3 +86,9 @@ matrix:
81
86
  gemfile: gemfiles/rails_head.gemfile
82
87
  - rvm: 2.1.10
83
88
  gemfile: gemfiles/rails_head.gemfile
89
+ - rvm: 2.2.10
90
+ gemfile: gemfiles/rails_head.gemfile
91
+ - rvm: 2.3.8
92
+ gemfile: gemfiles/rails_head.gemfile
93
+ - rvm: 2.4.6
94
+ gemfile: gemfiles/rails_head.gemfile
@@ -1,3 +1,7 @@
1
+ # ActiveAttr 0.13.0 (April 6, 2019) #
2
+
3
+ * ActiveAttr now supports Ruby 2.6
4
+
1
5
  # ActiveAttr 0.12.0 (August 6, 2018) #
2
6
 
3
7
  * #167 Changed Typecasting::BooleanTypecaster to cast strings starting
@@ -24,5 +24,5 @@ Gem::Specification.new do |gem|
24
24
  gem.add_development_dependency "minitest"
25
25
  gem.add_development_dependency "rake", ">= 0.9.0", "< 10.6"
26
26
  gem.add_development_dependency "rspec", "~> 3.0"
27
- gem.add_development_dependency "tzinfo"
27
+ gem.add_development_dependency "tzinfo", "< 2.0"
28
28
  end
@@ -32,10 +32,10 @@ module ActiveAttr
32
32
  elsif value.respond_to? :to_d
33
33
  value.to_d
34
34
  else
35
- BigDecimal.new value.to_s
35
+ BigDecimal(value.to_s)
36
36
  end
37
37
  rescue ArgumentError
38
- BigDecimal.new "0"
38
+ BigDecimal("0")
39
39
  end
40
40
  end
41
41
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveAttr
2
2
  # Complete version string
3
3
  # @since 0.1.0
4
- VERSION = "0.12.0"
4
+ VERSION = "0.13.0"
5
5
  end
@@ -100,7 +100,7 @@ module ActiveAttr
100
100
 
101
101
  it "a BigDecimal attribute returns a BigDecimal" do
102
102
  model.big_decimal = "1.1"
103
- model.big_decimal.should eql BigDecimal.new("1.1")
103
+ model.big_decimal.should eql BigDecimal("1.1")
104
104
  end
105
105
 
106
106
  it "a Boolean attribute returns a Boolean" do
@@ -112,12 +112,12 @@ module ActiveAttr
112
112
  end
113
113
 
114
114
  it "is false when the attribute is a zero BigDecimal" do
115
- model.value = BigDecimal.new("0.0")
115
+ model.value = BigDecimal("0.0")
116
116
  model.value?.should == false
117
117
  end
118
118
 
119
119
  it "is true when the attribute is a non-zero BigDecimal" do
120
- model.value = BigDecimal.new("0.1")
120
+ model.value = BigDecimal("0.1")
121
121
  model.value?.should == true
122
122
  end
123
123
 
@@ -137,12 +137,12 @@ module ActiveAttr
137
137
  end
138
138
 
139
139
  it "is false when the attribute is a negative zero BigDecimal" do
140
- model.value = BigDecimal.new("-0.0")
140
+ model.value = BigDecimal("-0.0")
141
141
  model.value?.should == false
142
142
  end
143
143
 
144
144
  it "is true when the attribute is a negative BigDecimal" do
145
- model.value = BigDecimal.new("-0.1")
145
+ model.value = BigDecimal("-0.1")
146
146
  model.value?.should == true
147
147
  end
148
148
 
@@ -8,32 +8,32 @@ module ActiveAttr
8
8
 
9
9
  describe "#call" do
10
10
  it "returns the original BigDecimal for a BigDecimal" do
11
- value = BigDecimal.new("2.0")
11
+ value = BigDecimal("2.0")
12
12
  typecaster.call(value).should equal value
13
13
  end
14
14
 
15
15
  it "casts nil to a zero BigDecimal" do
16
- typecaster.call(nil).should eql BigDecimal.new("0.0")
16
+ typecaster.call(nil).should eql BigDecimal("0.0")
17
17
  end
18
18
 
19
19
  it "casts a numeric String to a BigDecimal" do
20
- typecaster.call("2").should eql BigDecimal.new("2.0")
20
+ typecaster.call("2").should eql BigDecimal("2.0")
21
21
  end
22
22
 
23
23
  it "casts a alpha String to a zero BigDecimal" do
24
- typecaster.call("bob").should eql BigDecimal.new("0.0")
24
+ typecaster.call("bob").should eql BigDecimal("0.0")
25
25
  end
26
26
 
27
27
  it "casts a Rational to a BigDecimal" do
28
- typecaster.call(Rational(1, 2)).should eql BigDecimal.new("0.5")
28
+ typecaster.call(Rational(1, 2)).should eql BigDecimal("0.5")
29
29
  end
30
30
 
31
31
  it "casts a Float to a BigDecimal" do
32
- typecaster.call(1.2).should eql BigDecimal.new("1.2")
32
+ typecaster.call(1.2).should eql BigDecimal("1.2")
33
33
  end
34
34
 
35
35
  it "cases an Integer to a BigDecimal" do
36
- typecaster.call(2).should eql BigDecimal.new("2.0")
36
+ typecaster.call(2).should eql BigDecimal("2.0")
37
37
  end
38
38
  end
39
39
  end
@@ -94,11 +94,11 @@ module ActiveAttr
94
94
  end
95
95
 
96
96
  it "casts a zero BigDecimal to false" do
97
- typecaster.call(BigDecimal.new("0.0")).should equal false
97
+ typecaster.call(BigDecimal("0.0")).should equal false
98
98
  end
99
99
 
100
100
  it "casts a non-zero BigDecimal to true" do
101
- typecaster.call(BigDecimal.new("0.1")).should equal true
101
+ typecaster.call(BigDecimal("0.1")).should equal true
102
102
  end
103
103
 
104
104
  it "casts -1 to true" do
@@ -114,11 +114,11 @@ module ActiveAttr
114
114
  end
115
115
 
116
116
  it "casts a negative zero BigDecimal to false" do
117
- typecaster.call(BigDecimal.new("-0.0")).should equal false
117
+ typecaster.call(BigDecimal("-0.0")).should equal false
118
118
  end
119
119
 
120
120
  it "casts a negative BigDecimal to true" do
121
- typecaster.call(BigDecimal.new("-0.1")).should equal true
121
+ typecaster.call(BigDecimal("-0.1")).should equal true
122
122
  end
123
123
  end
124
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_attr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Griego
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-06 00:00:00.000000000 Z
12
+ date: 2019-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -137,16 +137,16 @@ dependencies:
137
137
  name: tzinfo
138
138
  requirement: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - ">="
140
+ - - "<"
141
141
  - !ruby/object:Gem::Version
142
- version: '0'
142
+ version: '2.0'
143
143
  type: :development
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ">="
147
+ - - "<"
148
148
  - !ruby/object:Gem::Version
149
- version: '0'
149
+ version: '2.0'
150
150
  description: Create plain old ruby models without reinventing the wheel.
151
151
  email:
152
152
  - cgriego@gmail.com