dm-sweatshop 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Rakefile +3 -2
- data/VERSION +1 -1
- data/dm-sweatshop.gemspec +8 -7
- data/lib/dm-sweatshop/model.rb +9 -9
- data/lib/dm-sweatshop/sweatshop.rb +10 -10
- metadata +7 -7
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -12,14 +12,15 @@ begin
|
|
12
12
|
gem.email = 'ben [a] benburkert [d] com'
|
13
13
|
gem.homepage = 'http://github.com/datamapper/%s' % gem.name
|
14
14
|
gem.authors = [ 'Ben Burkert' ]
|
15
|
+
gem.has_rdoc = 'yard'
|
15
16
|
|
16
17
|
gem.rubyforge_project = 'datamapper'
|
17
18
|
|
18
|
-
gem.add_dependency 'dm-core', '~> 1.0.
|
19
|
+
gem.add_dependency 'dm-core', '~> 1.0.2'
|
19
20
|
gem.add_dependency 'randexp', '~> 0.1.5'
|
20
21
|
|
21
22
|
gem.add_development_dependency 'rspec', '~> 1.3'
|
22
|
-
gem.add_development_dependency 'dm-validations', '~> 1.0.
|
23
|
+
gem.add_development_dependency 'dm-validations', '~> 1.0.2'
|
23
24
|
end
|
24
25
|
|
25
26
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/dm-sweatshop.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{dm-sweatshop}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ben Burkert"]
|
@@ -41,6 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
"tasks/yard.rake",
|
42
42
|
"tasks/yardstick.rake"
|
43
43
|
]
|
44
|
+
s.has_rdoc = %q{yard}
|
44
45
|
s.homepage = %q{http://github.com/datamapper/dm-sweatshop}
|
45
46
|
s.rdoc_options = ["--charset=UTF-8"]
|
46
47
|
s.require_paths = ["lib"]
|
@@ -59,21 +60,21 @@ Gem::Specification.new do |s|
|
|
59
60
|
s.specification_version = 3
|
60
61
|
|
61
62
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
62
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.
|
63
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.2"])
|
63
64
|
s.add_runtime_dependency(%q<randexp>, ["~> 0.1.5"])
|
64
65
|
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
|
65
|
-
s.add_development_dependency(%q<dm-validations>, ["~> 1.0.
|
66
|
+
s.add_development_dependency(%q<dm-validations>, ["~> 1.0.2"])
|
66
67
|
else
|
67
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
68
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.2"])
|
68
69
|
s.add_dependency(%q<randexp>, ["~> 0.1.5"])
|
69
70
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
70
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.0.
|
71
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.0.2"])
|
71
72
|
end
|
72
73
|
else
|
73
|
-
s.add_dependency(%q<dm-core>, ["~> 1.0.
|
74
|
+
s.add_dependency(%q<dm-core>, ["~> 1.0.2"])
|
74
75
|
s.add_dependency(%q<randexp>, ["~> 0.1.5"])
|
75
76
|
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
76
|
-
s.add_dependency(%q<dm-validations>, ["~> 1.0.
|
77
|
+
s.add_dependency(%q<dm-validations>, ["~> 1.0.2"])
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|
data/lib/dm-sweatshop/model.rb
CHANGED
@@ -11,7 +11,7 @@ module DataMapper
|
|
11
11
|
# @param name [Symbol, String] Name of the fixture
|
12
12
|
# @param blk [Proc] A proc that returns fixture attributes
|
13
13
|
#
|
14
|
-
# @
|
14
|
+
# @return nil
|
15
15
|
#
|
16
16
|
# @api public
|
17
17
|
def fixture(name = default_fauxture_name, &blk)
|
@@ -32,7 +32,7 @@ module DataMapper
|
|
32
32
|
#
|
33
33
|
# @api public
|
34
34
|
#
|
35
|
-
# @
|
35
|
+
# @return [DataMapper::Resource] added instance
|
36
36
|
def generate(name = default_fauxture_name, attributes = {})
|
37
37
|
name, attributes = default_fauxture_name, name if name.is_a? Hash
|
38
38
|
Sweatshop.create(self, name, attributes)
|
@@ -48,7 +48,7 @@ module DataMapper
|
|
48
48
|
#
|
49
49
|
# @api public
|
50
50
|
#
|
51
|
-
# @
|
51
|
+
# @return [DataMapper::Resource] added instance
|
52
52
|
def generate!(name = default_fauxture_name, attributes = {})
|
53
53
|
name, attributes = default_fauxture_name, name if name.is_a? Hash
|
54
54
|
Sweatshop.create!(self, name, attributes)
|
@@ -60,8 +60,8 @@ module DataMapper
|
|
60
60
|
#
|
61
61
|
# @param name [Symbol] name of the fauxture to use
|
62
62
|
#
|
63
|
-
# @
|
64
|
-
# @
|
63
|
+
# @return [Hash] existing instance of a model from the model map
|
64
|
+
# @raise NoFixtureExist when requested fixture does not exist in the model map
|
65
65
|
#
|
66
66
|
# @api public
|
67
67
|
def generate_attributes(name = default_fauxture_name)
|
@@ -78,7 +78,7 @@ module DataMapper
|
|
78
78
|
#
|
79
79
|
# @api private
|
80
80
|
#
|
81
|
-
# @
|
81
|
+
# @return [DataMapper::Resource] added instance
|
82
82
|
def make(name = default_fauxture_name, attributes = {})
|
83
83
|
name, attributes = default_fauxture_name, name if name.is_a? Hash
|
84
84
|
Sweatshop.make(self, name, attributes)
|
@@ -88,8 +88,8 @@ module DataMapper
|
|
88
88
|
#
|
89
89
|
# @param name [Symbol] name of the fauxture to pick
|
90
90
|
#
|
91
|
-
# @
|
92
|
-
# @
|
91
|
+
# @return [DataMapper::Resource] existing instance of a model from the record map
|
92
|
+
# @raise DataMapper::Sweatshop::NoFixtureExist when requested fixture does not exist in the record map
|
93
93
|
#
|
94
94
|
# @api public
|
95
95
|
def pick(name = default_fauxture_name)
|
@@ -98,7 +98,7 @@ module DataMapper
|
|
98
98
|
|
99
99
|
# Default fauxture name. Usually :default.
|
100
100
|
#
|
101
|
-
# @
|
101
|
+
# @return [Symbol] default fauxture name
|
102
102
|
# @api public
|
103
103
|
def default_fauxture_name
|
104
104
|
:default
|
@@ -28,7 +28,7 @@ module DataMapper
|
|
28
28
|
#
|
29
29
|
# @api private
|
30
30
|
#
|
31
|
-
# @
|
31
|
+
# @return [Array] model map
|
32
32
|
def self.add(klass, name, &proc)
|
33
33
|
self.model_map[klass][name.to_sym] << proc
|
34
34
|
end
|
@@ -41,7 +41,7 @@ module DataMapper
|
|
41
41
|
#
|
42
42
|
# @api private
|
43
43
|
#
|
44
|
-
# @
|
44
|
+
# @return [DataMapper::Resource] added instance
|
45
45
|
def self.record(klass, name, instance)
|
46
46
|
self.record_map[klass][name.to_sym] << instance
|
47
47
|
instance
|
@@ -56,7 +56,7 @@ module DataMapper
|
|
56
56
|
#
|
57
57
|
# @api private
|
58
58
|
#
|
59
|
-
# @
|
59
|
+
# @return [DataMapper::Resource] added instance
|
60
60
|
def self.create!(klass, name, attributes = {})
|
61
61
|
record(klass, name, klass.create!(attributes(klass, name).merge(attributes)))
|
62
62
|
end
|
@@ -70,7 +70,7 @@ module DataMapper
|
|
70
70
|
#
|
71
71
|
# @api private
|
72
72
|
#
|
73
|
-
# @
|
73
|
+
# @return [DataMapper::Resource] added instance
|
74
74
|
def self.create(klass, name, attributes = {})
|
75
75
|
record(klass, name, klass.create(attributes(klass, name).merge(attributes)))
|
76
76
|
end
|
@@ -84,7 +84,7 @@ module DataMapper
|
|
84
84
|
#
|
85
85
|
# @api private
|
86
86
|
#
|
87
|
-
# @
|
87
|
+
# @return [DataMapper::Resource] added instance
|
88
88
|
def self.make(klass, name, attributes = {})
|
89
89
|
record(klass, name, klass.new(attributes(klass, name).merge(attributes)))
|
90
90
|
end
|
@@ -94,8 +94,8 @@ module DataMapper
|
|
94
94
|
# @param klass [Class, DataMapper::Resource]
|
95
95
|
# @param name [Symbol]
|
96
96
|
#
|
97
|
-
# @
|
98
|
-
# @
|
97
|
+
# @return [DataMapper::Resource] existing instance of a model from the record map
|
98
|
+
# @raise DataMapper::Sweatshop::NoFixtureExist when requested fixture does not exist in the record map
|
99
99
|
#
|
100
100
|
# @api private
|
101
101
|
def self.pick(klass, name)
|
@@ -107,8 +107,8 @@ module DataMapper
|
|
107
107
|
# @param klass [Class, DataMapper::Resource]
|
108
108
|
# @param name [Symbol]
|
109
109
|
#
|
110
|
-
# @
|
111
|
-
# @
|
110
|
+
# @return [Hash] existing instance of a model from the model map
|
111
|
+
# @raise NoFixtureExist when requested fixture does not exist in the model map
|
112
112
|
#
|
113
113
|
# @api private
|
114
114
|
def self.attributes(klass, name)
|
@@ -127,7 +127,7 @@ module DataMapper
|
|
127
127
|
#
|
128
128
|
# @param hash [Hash]
|
129
129
|
#
|
130
|
-
# @
|
130
|
+
# @return [Hash] existing instance of a model from the model map
|
131
131
|
#
|
132
132
|
# @api private
|
133
133
|
def self.expand_callable_values(hash)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ben Burkert
|
@@ -28,8 +28,8 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 1
|
30
30
|
- 0
|
31
|
-
-
|
32
|
-
version: 1.0.
|
31
|
+
- 2
|
32
|
+
version: 1.0.2
|
33
33
|
type: :runtime
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
@@ -72,8 +72,8 @@ dependencies:
|
|
72
72
|
segments:
|
73
73
|
- 1
|
74
74
|
- 0
|
75
|
-
-
|
76
|
-
version: 1.0.
|
75
|
+
- 2
|
76
|
+
version: 1.0.2
|
77
77
|
type: :development
|
78
78
|
version_requirements: *id004
|
79
79
|
description: DataMapper plugin for building pseudo random models
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- tasks/spec.rake
|
110
110
|
- tasks/yard.rake
|
111
111
|
- tasks/yardstick.rake
|
112
|
-
has_rdoc:
|
112
|
+
has_rdoc: yard
|
113
113
|
homepage: http://github.com/datamapper/dm-sweatshop
|
114
114
|
licenses: []
|
115
115
|
|