fast_attributes-uuid 0.0.3 → 0.0.4

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: b42720ee74e41d2002286c0bfd2c55027be88aa0
4
- data.tar.gz: eebdea2bf33e7375b479e027c824ffcdda31749b
3
+ metadata.gz: 12d3d7b7d5353c6b6a2d8380bdbe94e5da045b2c
4
+ data.tar.gz: f59662c6292cea38b677f6defdea69ca9a0fb957
5
5
  SHA512:
6
- metadata.gz: 706e77af5b687694d795b0b9c43932dcd998ff3d7880e5b3243b73ce4de312708b2408db12ea734267b69ce1eccab6538f279e7f0b80633d63cb8c14109ac85e
7
- data.tar.gz: 5ca890cc1f01f1cf3a3f86656eabefcc0fd56dc95f2b004caacd3b9b50cb78ad010e97c6507e9d743d18fb8d281f32d9b80e8d31ccdc1389f2db09ff11cb668e
6
+ metadata.gz: 6afae3334e2f2a45c33aea24a6c553ce6e55421ad693e21390c8937496003631147e6201df91446d6e1274e8c33c6e778dc57eb8067e7b9b110b544e650c3935
7
+ data.tar.gz: 4f653549a7f566751daf64e14956b62fbbba1d206852d28fb6876d084a6b9d285f73999306cb572711f68ea47322a863d9f96ff8116988f66ec89dac71737b94
@@ -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.3.0'
23
+ spec.add_runtime_dependency 'fast_attributes', '~> 0.5.0'
24
24
  spec.add_runtime_dependency 'uuidtools', '~> 2.1.4'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.6'
@@ -6,12 +6,11 @@ module FastAttributes
6
6
  end
7
7
 
8
8
  set_type_casting UUIDTools::UUID, <<-EOS.gsub(/^\s*/, '')
9
- _value = %s
10
- case value.length
11
- when 36 then UUIDTools::UUID.parse(_value)
12
- when 32 then UUIDTools::UUID.parse_hexdigest(_value)
9
+ case %s.length
10
+ when 36 then UUIDTools::UUID.parse(%s)
11
+ when 32 then UUIDTools::UUID.parse_hexdigest(%s)
13
12
  when 0 then nil
14
- else UUIDTools::UUID.parse_raw(_value)
13
+ else UUIDTools::UUID.parse_raw(%s)
15
14
  end
16
15
  EOS
17
16
  end
@@ -1,5 +1,5 @@
1
1
  module FastAttributes
2
2
  module UUID
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
@@ -2,23 +2,22 @@ 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).to eq({
6
- String => 'String(%s)',
7
- Integer => 'Integer(%s)',
8
- Array => 'Array(%s)',
9
- Date => 'Date.parse(%s)',
10
- Time => 'Time.parse(%s)',
11
- DateTime => 'DateTime.parse(%s)',
12
- UUIDTools::UUID => <<-EOS.gsub(/^\s*/, '')
13
- _value = %s
14
- case value.length
15
- when 36 then UUIDTools::UUID.parse(_value)
16
- when 32 then UUIDTools::UUID.parse_hexdigest(_value)
17
- when 0 then nil
18
- else UUIDTools::UUID.parse_raw(_value)
5
+ expect(FastAttributes.type_casting[UUIDTools::UUID].template.gsub(/\s*/, '')).to eq(<<-EOS.gsub(/\s*/, '')
6
+ case %s
7
+ when nil
8
+ nil
9
+ when UUIDTools::UUID
10
+ %s
11
+ else
12
+ case %s.length
13
+ when 36 then UUIDTools::UUID.parse(%s)
14
+ when 32 then UUIDTools::UUID.parse_hexdigest(%s)
15
+ when 0 then nil
16
+ else UUIDTools::UUID.parse_raw(%s)
17
+ end
19
18
  end
20
19
  EOS
21
- })
20
+ )
22
21
  end
23
22
 
24
23
  it 'attribute parses UUID value' do
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.3
4
+ version: 0.0.4
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-04 00:00:00.000000000 Z
11
+ date: 2014-07-16 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.3.0
19
+ version: 0.5.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.3.0
26
+ version: 0.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: uuidtools
29
29
  requirement: !ruby/object:Gem::Requirement