fabrication 2.7.2 → 2.8.0
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/README.markdown +1 -1
- data/lib/fabrication.rb +4 -1
- data/lib/fabrication/generator/active_record.rb +2 -1
- data/lib/fabrication/schematic/definition.rb +0 -1
- data/lib/fabrication/version.rb +1 -1
- data/lib/rails/generators/fabrication/cucumber_steps/cucumber_steps_generator.rb +9 -8
- metadata +5 -19
- data/lib/fabrication/generator/keymaker.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2269a43451102e038d20407b145774ddc943a4d8
|
4
|
+
data.tar.gz: e0d028f064c38f45bb11a4905a1520e80e846bd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6308d6d7b3d9e13e782e8c0122569d247a4c92751ccf15947ea991ef978213eb34c32d3da1fb29ee223b8f1d283f720c2895d8f42a60998ec99affd4698d2449
|
7
|
+
data.tar.gz: d73ee4e84aebda7d7d75f2948b684423fa097fa173ca7a03ab75b70457a28ad87df4dd921a9161d7ad10edbc58678d9d6408a1bb310045958becdab1b4e7ea5c
|
data/README.markdown
CHANGED
@@ -6,7 +6,7 @@ Fabrication is an object generation framework for Ruby.
|
|
6
6
|
|
7
7
|
## Compatibility
|
8
8
|
|
9
|
-
Fabrication is tested against Ruby 1.9.
|
9
|
+
Fabrication is tested against Ruby 1.9.3, 2.0.0, and Rubinius.
|
10
10
|
|
11
11
|
[](http://travis-ci.org/paulelliott/fabrication)
|
12
12
|
[](https://codeclimate.com/github/paulelliott/fabrication)
|
data/lib/fabrication.rb
CHANGED
@@ -26,7 +26,6 @@ module Fabrication
|
|
26
26
|
autoload :DataMapper, 'fabrication/generator/data_mapper'
|
27
27
|
autoload :Mongoid, 'fabrication/generator/mongoid'
|
28
28
|
autoload :Sequel, 'fabrication/generator/sequel'
|
29
|
-
autoload :Keymaker, 'fabrication/generator/keymaker'
|
30
29
|
autoload :Base, 'fabrication/generator/base'
|
31
30
|
end
|
32
31
|
|
@@ -60,6 +59,10 @@ def Fabricate(name, overrides={}, &block)
|
|
60
59
|
end
|
61
60
|
|
62
61
|
class Fabricate
|
62
|
+
def self.times(count, name, overrides={}, &block)
|
63
|
+
count.times.map { Fabricate(name, overrides, &block) }
|
64
|
+
end
|
65
|
+
|
63
66
|
def self.attributes_for(name, overrides={}, &block)
|
64
67
|
Fabrication::Fabricator.to_attributes(name, overrides, &block)
|
65
68
|
end
|
@@ -15,7 +15,8 @@ class Fabrication::Generator::ActiveRecord < Fabrication::Generator::Base
|
|
15
15
|
protected
|
16
16
|
|
17
17
|
def self.without_protection?
|
18
|
-
Gem::Version.new(ActiveRecord::VERSION::STRING).between?(Gem::Version.new('3.1.0'), Gem::Version.new('3.9'))
|
18
|
+
@without_protection = Gem::Version.new(ActiveRecord::VERSION::STRING).between?(Gem::Version.new('3.1.0'), Gem::Version.new('3.9')) if @without_protection.nil?
|
19
|
+
@without_protection
|
19
20
|
end
|
20
21
|
|
21
22
|
def validate_instance
|
data/lib/fabrication/version.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'rails/generators/base'
|
2
2
|
|
3
|
-
module Fabrication
|
4
|
-
|
3
|
+
module Fabrication
|
4
|
+
module Generators
|
5
|
+
class CucumberStepsGenerator < Rails::Generators::Base
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
def generate
|
8
|
+
template 'fabrication_steps.rb', "features/step_definitions/fabrication_steps.rb"
|
9
|
+
end
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
def self.source_root
|
12
|
+
@_fabrication_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
13
|
+
end
|
12
14
|
end
|
13
|
-
|
14
15
|
end
|
15
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabrication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Elliott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: keymaker
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - '>='
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - '>='
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: mongoid
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,7 +224,6 @@ files:
|
|
238
224
|
- lib/fabrication/generator/active_record.rb
|
239
225
|
- lib/fabrication/generator/base.rb
|
240
226
|
- lib/fabrication/generator/data_mapper.rb
|
241
|
-
- lib/fabrication/generator/keymaker.rb
|
242
227
|
- lib/fabrication/generator/mongoid.rb
|
243
228
|
- lib/fabrication/generator/sequel.rb
|
244
229
|
- lib/fabrication/schematic/attribute.rb
|
@@ -260,7 +245,8 @@ files:
|
|
260
245
|
- README.markdown
|
261
246
|
- Rakefile
|
262
247
|
homepage: http://fabricationgem.org
|
263
|
-
licenses:
|
248
|
+
licenses:
|
249
|
+
- WTFPL
|
264
250
|
metadata: {}
|
265
251
|
post_install_message:
|
266
252
|
rdoc_options: []
|
@@ -278,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
278
264
|
version: '0'
|
279
265
|
requirements: []
|
280
266
|
rubyforge_project:
|
281
|
-
rubygems_version: 2.0.
|
267
|
+
rubygems_version: 2.0.3
|
282
268
|
signing_key:
|
283
269
|
specification_version: 4
|
284
270
|
summary: Fabrication provides a simple solution for test object generation.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class Fabrication::Generator::Keymaker < Fabrication::Generator::Base
|
2
|
-
|
3
|
-
def self.supports?(klass)
|
4
|
-
defined?(Keymaker) && klass.ancestors.include?(Keymaker::Node)
|
5
|
-
end
|
6
|
-
|
7
|
-
def persist
|
8
|
-
_instance.save
|
9
|
-
end
|
10
|
-
|
11
|
-
def validate_instance
|
12
|
-
_instance.valid?
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|