casted_hash 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf3b3d257f7006192515041d52f399aca8090943
4
- data.tar.gz: ae3a58bcf07664a3403e66eb0db81ae761c7b871
3
+ metadata.gz: a75e1ca5209da87620971999bede83c599689a7f
4
+ data.tar.gz: 9dfa369c27920138f3bae6a523a2eccc886c66c2
5
5
  SHA512:
6
- metadata.gz: 5b51d3de96a7ed760fb02673dc6aba39677081f856075dd719cd1c8245e69c826f53e63fb7e6dc02cd1373692703054943b81dad2fbf30b4bc4ea0d61c85b3e4
7
- data.tar.gz: 24aa339f2d51e5679e81e6eaadfaa1fa98f601b3707de39e4a02a829a5df7c70ef19fcf586a2b23ed9afc8c436ef08cc618aac05b63db062e0ccbb726d11b1d5
6
+ metadata.gz: 3fb74c2c6fc7949c73c59593fb4b4657709fa50184b755593e85dcd8b1bd825e92cc395aebde8542b257cdc21ac69bc97b1f512fb10d7afb62e6114f55e2195f
7
+ data.tar.gz: 0323de581f4e49bd0d455b9a9bea600aaa8fd1dbd5e1880fed7472e134490fd7b6309dc0c8902ff2f4c77f79bfa7caea112f56c81bf33c6ff1cffca3dec92536
data/casted_hash.gemspec CHANGED
@@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
15
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
16
  spec.require_paths = ["lib"]
17
+ spec.required_ruby_version = '>= 2.2.0'
17
18
 
18
19
  spec.add_development_dependency "bundler", ">= 1.3"
19
20
  spec.add_development_dependency "rake"
data/lib/casted_hash.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class CastedHash < Hash
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
 
4
4
  def initialize(constructor = {}, cast_proc = nil)
5
5
  raise ArgumentError, "`cast_proc` required" unless cast_proc
@@ -20,6 +20,12 @@ describe CastedHash do
20
20
  assert_equal 2, @hash[:a]
21
21
  end
22
22
 
23
+ it "can check size without casting" do
24
+ hash = CastedHash.new({:a => 1, :b => 2}, lambda {|x| x + 10 })
25
+ assert hash.any?
26
+ assert_empty hash.casted
27
+ end
28
+
23
29
  it "casts when expected" do
24
30
  hash = CastedHash.new({:a => 1, :b => 2}, lambda {|x| x + 10 })
25
31
  assert !hash.casted?(:a)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casted_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Kaag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-26 00:00:00.000000000 Z
11
+ date: 2015-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 2.2.0
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - ">="
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  requirements: []
103
103
  rubyforge_project:
104
- rubygems_version: 2.2.2
104
+ rubygems_version: 2.4.5
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: A casted hash