fast_attributes-uuid 0.0.4 → 0.0.5

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12d3d7b7d5353c6b6a2d8380bdbe94e5da045b2c
4
- data.tar.gz: f59662c6292cea38b677f6defdea69ca9a0fb957
3
+ metadata.gz: 31ea45e99aaea18c327a316defad9cdd8586351b
4
+ data.tar.gz: b2bd2caf12b2d89e7fbd486f650c39ed6702ffab
5
5
  SHA512:
6
- metadata.gz: 6afae3334e2f2a45c33aea24a6c553ce6e55421ad693e21390c8937496003631147e6201df91446d6e1274e8c33c6e778dc57eb8067e7b9b110b544e650c3935
7
- data.tar.gz: 4f653549a7f566751daf64e14956b62fbbba1d206852d28fb6876d084a6b9d285f73999306cb572711f68ea47322a863d9f96ff8116988f66ec89dac71737b94
6
+ metadata.gz: 614232405960e00bb58c358bc8a3e5eeb54a4b48849b06d8449e00f7adb8856a6a06aaafa065bb4b934ce91bcf0ac0c40e3599d205d7e17bf5d52c5d35f6f285
7
+ data.tar.gz: e429757b3104a78b974e8330af6f1b82b9d4b90e578a9b6a9298f212319a7a0bb88f8980bfdffe20aef88c8eb371a74fd42209e098392111ad21b37510ef1a0c
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 1.9.2'
22
22
 
23
- spec.add_runtime_dependency 'fast_attributes', '~> 0.5.0'
23
+ spec.add_runtime_dependency 'fast_attributes', '~> 0.6.0'
24
24
  spec.add_runtime_dependency 'uuidtools', '~> 2.1.4'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.6'
@@ -1,5 +1,5 @@
1
1
  module FastAttributes
2
2
  module UUID
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
@@ -2,21 +2,25 @@ require 'spec_helper'
2
2
 
3
3
  describe FastAttributes::UUID do
4
4
  it 'adds UUID type to supported list' do
5
- expect(FastAttributes.type_casting[UUIDTools::UUID].template.gsub(/\s*/, '')).to eq(<<-EOS.gsub(/\s*/, '')
6
- case %s
5
+ expect(FastAttributes.type_casting[UUIDTools::UUID].compile_method_body('id', 'argument').gsub(/\s*/, '')).to eq(<<-EOS.gsub(/\s*/, '')
6
+ begin
7
+ case argument
7
8
  when nil
8
9
  nil
9
10
  when UUIDTools::UUID
10
- %s
11
+ argument
11
12
  else
12
- case %s.length
13
- when 36 then UUIDTools::UUID.parse(%s)
14
- when 32 then UUIDTools::UUID.parse_hexdigest(%s)
13
+ case argument.length
14
+ when 36 then UUIDTools::UUID.parse(argument)
15
+ when 32 then UUIDTools::UUID.parse_hexdigest(argument)
15
16
  when 0 then nil
16
- else UUIDTools::UUID.parse_raw(%s)
17
+ else UUIDTools::UUID.parse_raw(argument)
17
18
  end
18
19
  end
19
- EOS
20
+ rescue => e
21
+ raise FastAttributes::TypeCast::InvalidValueError, %(Invalid value "\#{argument}" for attribute "id" of type "UUIDTools::UUID")
22
+ end
23
+ EOS
20
24
  )
21
25
  end
22
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_attributes-uuid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kostiantyn Stepaniuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-16 00:00:00.000000000 Z
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_attributes
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.5.0
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: uuidtools
29
29
  requirement: !ruby/object:Gem::Requirement