dm-sweatshop 1.1.0.rc2 → 1.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/dm-sweatshop.gemspec +10 -9
- data/lib/dm-sweatshop/support/class_attributes.rb +46 -0
- data/lib/dm-sweatshop/unique.rb +4 -8
- metadata +6 -5
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ source 'http://rubygems.org'
|
|
5
5
|
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
6
6
|
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
7
7
|
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
|
-
DM_VERSION = '~> 1.1.0.
|
8
|
+
DM_VERSION = '~> 1.1.0.rc3'
|
9
9
|
DO_VERSION = '~> 0.10.2'
|
10
10
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
11
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.0.
|
1
|
+
1.1.0.rc3
|
data/dm-sweatshop.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-sweatshop}
|
8
|
-
s.version = "1.1.0.
|
8
|
+
s.version = "1.1.0.rc3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ben Burkert"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-10}
|
13
13
|
s.description = %q{DataMapper plugin for building pseudo random models}
|
14
14
|
s.email = %q{ben [a] benburkert [d] com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
"dm-sweatshop.gemspec",
|
26
26
|
"lib/dm-sweatshop.rb",
|
27
27
|
"lib/dm-sweatshop/model.rb",
|
28
|
+
"lib/dm-sweatshop/support/class_attributes.rb",
|
28
29
|
"lib/dm-sweatshop/sweatshop.rb",
|
29
30
|
"lib/dm-sweatshop/unique.rb",
|
30
31
|
"spec/dm-sweatshop/model_spec.rb",
|
@@ -40,7 +41,7 @@ Gem::Specification.new do |s|
|
|
40
41
|
s.homepage = %q{http://github.com/datamapper/dm-sweatshop}
|
41
42
|
s.require_paths = ["lib"]
|
42
43
|
s.rubyforge_project = %q{datamapper}
|
43
|
-
s.rubygems_version = %q{1.
|
44
|
+
s.rubygems_version = %q{1.6.2}
|
44
45
|
s.summary = %q{DataMapper plugin for building pseudo random models}
|
45
46
|
s.test_files = [
|
46
47
|
"spec/dm-sweatshop/model_spec.rb",
|
@@ -53,27 +54,27 @@ Gem::Specification.new do |s|
|
|
53
54
|
s.specification_version = 3
|
54
55
|
|
55
56
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 1.1.0.
|
57
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
|
57
58
|
s.add_runtime_dependency(%q<randexp>, ["~> 0.1.5"])
|
58
59
|
s.add_runtime_dependency(%q<ParseTree>, ["~> 3.0.7"])
|
59
|
-
s.add_development_dependency(%q<dm-validations>, ["~> 1.1.0.
|
60
|
+
s.add_development_dependency(%q<dm-validations>, ["~> 1.1.0.rc3"])
|
60
61
|
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
61
62
|
s.add_development_dependency(%q<rake>, ["~> 0.8.7"])
|
62
63
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.1"])
|
63
64
|
else
|
64
|
-
s.add_dependency(%q<dm-core>, ["~> 1.1.0.
|
65
|
+
s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
|
65
66
|
s.add_dependency(%q<randexp>, ["~> 0.1.5"])
|
66
67
|
s.add_dependency(%q<ParseTree>, ["~> 3.0.7"])
|
67
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.
|
68
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.rc3"])
|
68
69
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
69
70
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
70
71
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
71
72
|
end
|
72
73
|
else
|
73
|
-
s.add_dependency(%q<dm-core>, ["~> 1.1.0.
|
74
|
+
s.add_dependency(%q<dm-core>, ["~> 1.1.0.rc3"])
|
74
75
|
s.add_dependency(%q<randexp>, ["~> 0.1.5"])
|
75
76
|
s.add_dependency(%q<ParseTree>, ["~> 3.0.7"])
|
76
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.
|
77
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.1.0.rc3"])
|
77
78
|
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
78
79
|
s.add_dependency(%q<rake>, ["~> 0.8.7"])
|
79
80
|
s.add_dependency(%q<rspec>, ["~> 1.3.1"])
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module DataMapper
|
2
|
+
class Sweatshop
|
3
|
+
module ClassAttributes
|
4
|
+
def self.reader(klass, *attributes)
|
5
|
+
attributes.each do |attribute|
|
6
|
+
klass.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
7
|
+
unless defined? @@#{attribute}
|
8
|
+
@@#{attribute} = nil
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.#{attribute}
|
12
|
+
@@#{attribute}
|
13
|
+
end
|
14
|
+
|
15
|
+
def #{attribute}
|
16
|
+
@@#{attribute}
|
17
|
+
end
|
18
|
+
RUBY
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.writer(klass, *attributes)
|
23
|
+
attributes.each do |attribute|
|
24
|
+
klass.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
|
25
|
+
unless defined? @@#{attribute}
|
26
|
+
@@#{attribute} = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.#{attribute}=(obj)
|
30
|
+
@@#{attribute} = obj
|
31
|
+
end
|
32
|
+
|
33
|
+
def #{attribute}=(obj)
|
34
|
+
@@#{attribute} = obj
|
35
|
+
end
|
36
|
+
RUBY
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.accessor(klass, *attributes)
|
41
|
+
self.reader(klass, *attributes)
|
42
|
+
self.writer(klass, *attributes)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/dm-sweatshop/unique.rb
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'active_support/core_ext/class/attribute_accessors'
|
3
|
-
rescue LoadError
|
4
|
-
require 'extlib/class'
|
5
|
-
end
|
1
|
+
require 'dm-sweatshop/support/class_attributes'
|
6
2
|
|
7
3
|
module DataMapper
|
8
4
|
class Sweatshop
|
@@ -69,9 +65,9 @@ module DataMapper
|
|
69
65
|
puts "DataMapper::Sweatshop::Unique - ParseTree could not be loaded, anonymous uniques will not be allowed"
|
70
66
|
end
|
71
67
|
|
72
|
-
|
73
|
-
|
74
|
-
|
68
|
+
ClassAttributes.accessor(self, :count_map)
|
69
|
+
ClassAttributes.accessor(self, :unique_map)
|
70
|
+
ClassAttributes.accessor(self, :parser)
|
75
71
|
|
76
72
|
# Use the sexp representation of the block as a unique key for the block
|
77
73
|
# If you copy and paste a block, it will still have the same key
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dm-sweatshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 1.1.0.
|
5
|
+
version: 1.1.0.rc3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ben Burkert
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-10 00:00:00 -08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.1.0.
|
23
|
+
version: 1.1.0.rc3
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: *id001
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 1.1.0.
|
56
|
+
version: 1.1.0.rc3
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: *id004
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- dm-sweatshop.gemspec
|
109
109
|
- lib/dm-sweatshop.rb
|
110
110
|
- lib/dm-sweatshop/model.rb
|
111
|
+
- lib/dm-sweatshop/support/class_attributes.rb
|
111
112
|
- lib/dm-sweatshop/sweatshop.rb
|
112
113
|
- lib/dm-sweatshop/unique.rb
|
113
114
|
- spec/dm-sweatshop/model_spec.rb
|
@@ -143,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
144
|
requirements: []
|
144
145
|
|
145
146
|
rubyforge_project: datamapper
|
146
|
-
rubygems_version: 1.
|
147
|
+
rubygems_version: 1.6.2
|
147
148
|
signing_key:
|
148
149
|
specification_version: 3
|
149
150
|
summary: DataMapper plugin for building pseudo random models
|