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 +4 -4
- data/fast_attributes-uuid.gemspec +1 -1
- data/lib/fast_attributes/uuid/version.rb +1 -1
- data/spec/fast_attributes/uuid_spec.rb +12 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31ea45e99aaea18c327a316defad9cdd8586351b
|
4
|
+
data.tar.gz: b2bd2caf12b2d89e7fbd486f650c39ed6702ffab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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'
|
@@ -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].
|
6
|
-
|
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
|
-
|
11
|
+
argument
|
11
12
|
else
|
12
|
-
case
|
13
|
-
when 36 then UUIDTools::UUID.parse(
|
14
|
-
when 32 then UUIDTools::UUID.parse_hexdigest(
|
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(
|
17
|
+
else UUIDTools::UUID.parse_raw(argument)
|
17
18
|
end
|
18
19
|
end
|
19
|
-
|
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
|
+
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-
|
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.
|
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.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: uuidtools
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|