acts_as_uuid 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,10 +8,13 @@ Inspired by https://github.com/jashmenn/activeuuid and the lack of PostgreSQL ge
8
8
 
9
9
  Add this to your `Gemfile`:
10
10
 
11
- `gem "acts_as_uuid"`
11
+ gem "uuid"
12
+ gem "acts_as_uuid"
12
13
 
13
14
  You can now set the type `uuid` for an attribute in your models.
14
15
 
16
+ NB: We don't depend on uuid gem because you can use any gem that provides `UUID.generate`, such as the [cuuid](http://github.com/EmberAds/cuuid) gem.
17
+
15
18
  ## Example: Adding a UUID primary key to your models
16
19
 
17
20
  ### Step 1a: For new models
@@ -20,5 +20,5 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # specify any dependencies here; for example:
22
22
  s.add_development_dependency "rspec"
23
- s.add_runtime_dependency "uuid"
23
+ # runtime dependency of something that conforms to UUID.generate - be that uuid or cuuid gem
24
24
  end
@@ -1,3 +1,7 @@
1
+ unless defined?(UUID) && UUID.respond_to?(:generate)
2
+ raise "UUID.generate needs to be provided for acts_as_uuid to work. Try requiring the UUID or CUUID gem."
3
+ end
4
+
1
5
  module ActsAsUUID
2
6
  def self.included klass
3
7
  klass.before_validation :generate_uuid
@@ -1,3 +1,3 @@
1
1
  module ActsAsUuid
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,60 +1,40 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: acts_as_uuid
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Cristiano Betta
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-02-01 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :development
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: uuid
36
23
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
38
25
  none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- type: :runtime
47
- version_requirements: *id002
48
- description: "Allows ActiveRecord to use (native) UUIDs, even as primary keys. Currently only works with PostgreSQL. "
49
- email:
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: ! 'Allows ActiveRecord to use (native) UUIDs, even as primary keys. Currently
31
+ only works with PostgreSQL. '
32
+ email:
50
33
  - cristiano@emberads.com
51
34
  executables: []
52
-
53
35
  extensions: []
54
-
55
36
  extra_rdoc_files: []
56
-
57
- files:
37
+ files:
58
38
  - .gitignore
59
39
  - Gemfile
60
40
  - LICENSE
@@ -69,37 +49,29 @@ files:
69
49
  - spec/spec_helper.rb
70
50
  homepage: https://github.com/EmberAds/acts_as_uuid
71
51
  licenses: []
72
-
73
52
  post_install_message:
74
53
  rdoc_options: []
75
-
76
- require_paths:
54
+ require_paths:
77
55
  - lib
78
- required_ruby_version: !ruby/object:Gem::Requirement
56
+ required_ruby_version: !ruby/object:Gem::Requirement
79
57
  none: false
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- hash: 3
84
- segments:
85
- - 0
86
- version: "0"
87
- required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
63
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
96
68
  requirements: []
97
-
98
69
  rubyforge_project: acts_as_uuid
99
- rubygems_version: 1.8.15
70
+ rubygems_version: 1.8.21
100
71
  signing_key:
101
72
  specification_version: 3
102
73
  summary: Allows ActiveRecord to use (native) UUIDs
103
- test_files:
74
+ test_files:
104
75
  - spec/acts_as_uuid/acts_as_uuid.rb
105
76
  - spec/spec_helper.rb
77
+ has_rdoc: