fabrication 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fabrication.rb +13 -4
- data/lib/fabrication/cucumber/step_fabricator.rb +2 -2
- data/lib/fabrication/fabricator.rb +5 -50
- data/lib/fabrication/generator/active_record.rb +1 -1
- data/lib/fabrication/generator/base.rb +15 -15
- data/lib/fabrication/generator/data_mapper.rb +14 -0
- data/lib/fabrication/generator/mongoid.rb +5 -5
- data/lib/fabrication/generator/sequel.rb +1 -1
- data/lib/fabrication/{attribute.rb → schematic/attribute.rb} +1 -1
- data/lib/fabrication/{schematic.rb → schematic/definition.rb} +10 -4
- data/lib/fabrication/schematic/manager.rb +59 -0
- data/lib/fabrication/support.rb +1 -1
- data/lib/fabrication/transform.rb +16 -3
- data/lib/fabrication/version.rb +1 -1
- data/lib/rails/generators/fabrication/cucumber_steps/templates/fabrication_steps.rb +1 -1
- metadata +85 -39
data/lib/fabrication.rb
CHANGED
@@ -5,11 +5,15 @@ module Fabrication
|
|
5
5
|
autoload :UnknownFabricatorError, 'fabrication/errors/unknown_fabricator_error'
|
6
6
|
autoload :MisplacedFabricateError, 'fabrication/errors/misplaced_fabricate_error'
|
7
7
|
|
8
|
-
|
8
|
+
module Schematic
|
9
|
+
autoload :Attribute, 'fabrication/schematic/attribute'
|
10
|
+
autoload :Definition, 'fabrication/schematic/definition'
|
11
|
+
autoload :Manager, 'fabrication/schematic/manager'
|
12
|
+
end
|
13
|
+
|
9
14
|
autoload :Config, 'fabrication/config'
|
10
15
|
autoload :Fabricator, 'fabrication/fabricator'
|
11
16
|
autoload :Sequencer, 'fabrication/sequencer'
|
12
|
-
autoload :Schematic, 'fabrication/schematic'
|
13
17
|
autoload :Support, 'fabrication/support'
|
14
18
|
autoload :Transform, 'fabrication/transform'
|
15
19
|
|
@@ -19,13 +23,14 @@ module Fabrication
|
|
19
23
|
|
20
24
|
module Generator
|
21
25
|
autoload :ActiveRecord, 'fabrication/generator/active_record'
|
26
|
+
autoload :DataMapper, 'fabrication/generator/data_mapper'
|
22
27
|
autoload :Mongoid, 'fabrication/generator/mongoid'
|
23
28
|
autoload :Sequel, 'fabrication/generator/sequel'
|
24
29
|
autoload :Base, 'fabrication/generator/base'
|
25
30
|
end
|
26
31
|
|
27
32
|
def self.clear_definitions
|
28
|
-
|
33
|
+
@schematics = nil
|
29
34
|
Sequencer.sequences.clear
|
30
35
|
end
|
31
36
|
|
@@ -41,10 +46,14 @@ module Fabrication
|
|
41
46
|
@initializing
|
42
47
|
end
|
43
48
|
|
49
|
+
def self.schematics
|
50
|
+
@schematics ||= Fabrication::Schematic::Manager.new
|
51
|
+
end
|
52
|
+
|
44
53
|
end
|
45
54
|
|
46
55
|
def Fabricator(name, options={}, &block)
|
47
|
-
Fabrication
|
56
|
+
Fabrication.schematics.register(name, options, &block)
|
48
57
|
end
|
49
58
|
|
50
59
|
def Fabricate(name, overrides={}, &block)
|
@@ -12,7 +12,7 @@ module Fabrication
|
|
12
12
|
def from_table(table, extra={})
|
13
13
|
hashes = singular? ? [table.rows_hash] : table.hashes
|
14
14
|
hashes.map do |hash|
|
15
|
-
transformed_hash = Fabrication::Transform.
|
15
|
+
transformed_hash = Fabrication::Transform.apply_to(@model, parameterize_hash(hash))
|
16
16
|
make(transformed_hash.merge(extra))
|
17
17
|
end.tap {|o| remember(o) }
|
18
18
|
end
|
@@ -54,7 +54,7 @@ module Fabrication
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def schematic
|
57
|
-
Fabrication
|
57
|
+
Fabrication.schematics[@fabricator]
|
58
58
|
end
|
59
59
|
|
60
60
|
def dehumanize(string)
|
@@ -1,55 +1,10 @@
|
|
1
1
|
class Fabrication::Fabricator
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
schematic = schematics[name] = schematic_for(name, options, &block)
|
9
|
-
Array(aliases).each do |as|
|
10
|
-
schematics[as.to_sym] = schematic
|
11
|
-
end
|
12
|
-
schematic
|
13
|
-
end
|
14
|
-
|
15
|
-
def generate(name, options={}, overrides={}, &block)
|
16
|
-
Fabrication::Support.find_definitions if schematics.empty?
|
17
|
-
raise Fabrication::UnknownFabricatorError, "No Fabricator defined for '#{name}'" unless schematics.has_key?(name)
|
18
|
-
schematics[name].generate(options, overrides, &block)
|
19
|
-
end
|
20
|
-
|
21
|
-
def schematics
|
22
|
-
@schematics ||= {}
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def class_name_for(name, parent, options)
|
28
|
-
options[:class_name] ||
|
29
|
-
(parent && parent.klass.name) ||
|
30
|
-
options[:from] ||
|
31
|
-
name
|
32
|
-
end
|
33
|
-
|
34
|
-
def schematic_for(name, options, &block)
|
35
|
-
parent = schematics[options[:from]]
|
36
|
-
class_name = class_name_for(name, parent, options)
|
37
|
-
klass = Fabrication::Support.class_for(class_name)
|
38
|
-
raise Fabrication::UnfabricatableError, "No class found for '#{name}'" unless klass
|
39
|
-
if parent
|
40
|
-
parent.merge(&block).tap { |s| s.klass = klass }
|
41
|
-
else
|
42
|
-
Fabrication::Schematic.new(klass, &block)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
3
|
+
def self.generate(name, options={}, overrides={}, &block)
|
4
|
+
Fabrication::Support.find_definitions if Fabrication.schematics.empty?
|
5
|
+
schematic = Fabrication.schematics[name]
|
6
|
+
raise Fabrication::UnknownFabricatorError, "No Fabricator defined for '#{name}'" unless schematic
|
7
|
+
schematic.generate(options, overrides, &block)
|
46
8
|
end
|
47
9
|
|
48
10
|
end
|
49
|
-
|
50
|
-
# Adds support for reload! in the Rails 2.3.x console
|
51
|
-
if defined? ActionController::Dispatcher and ActionController::Dispatcher.respond_to? :reload_application
|
52
|
-
ActionController::Dispatcher.to_prepare :fabrication do
|
53
|
-
Fabrication.clear_definitions
|
54
|
-
end
|
55
|
-
end
|
@@ -1,25 +1,25 @@
|
|
1
1
|
class Fabrication::Generator::Base
|
2
2
|
|
3
|
-
def self.supports?(
|
3
|
+
def self.supports?(__klass); true end
|
4
4
|
|
5
5
|
def generate(options={:save => true}, attributes=[], callbacks={})
|
6
6
|
if callbacks[:on_init]
|
7
|
-
self.
|
7
|
+
self.__instance = __klass.new(*callbacks[:on_init].call)
|
8
8
|
else
|
9
|
-
self.
|
9
|
+
self.__instance = __klass.new
|
10
10
|
end
|
11
11
|
|
12
12
|
process_attributes(attributes)
|
13
13
|
|
14
|
-
callbacks[:after_build].each { |callback| callback.call(
|
14
|
+
callbacks[:after_build].each { |callback| callback.call(__instance) } if callbacks[:after_build]
|
15
15
|
after_generation(options)
|
16
|
-
callbacks[:after_create].each { |callback| callback.call(
|
16
|
+
callbacks[:after_create].each { |callback| callback.call(__instance) } if callbacks[:after_create] && options[:save]
|
17
17
|
|
18
|
-
|
18
|
+
__instance
|
19
19
|
end
|
20
20
|
|
21
21
|
def initialize(klass)
|
22
|
-
self.
|
22
|
+
self.__klass = klass
|
23
23
|
end
|
24
24
|
|
25
25
|
def association?(method_name); false end
|
@@ -32,13 +32,13 @@ class Fabrication::Generator::Base
|
|
32
32
|
count = options[:count] || 0
|
33
33
|
|
34
34
|
# copy the original getter
|
35
|
-
|
35
|
+
__instance.instance_variable_set("@__#{method_name}_original", __instance.method(method_name))
|
36
36
|
|
37
37
|
# store the block for lazy generation
|
38
|
-
|
38
|
+
__instance.instance_variable_set("@__#{method_name}_block", block)
|
39
39
|
|
40
40
|
# redefine the getter
|
41
|
-
|
41
|
+
__instance.instance_eval %<
|
42
42
|
def #{method_name}
|
43
43
|
original_value = @__#{method_name}_original.call
|
44
44
|
if @__#{method_name}_block
|
@@ -62,21 +62,21 @@ class Fabrication::Generator::Base
|
|
62
62
|
|
63
63
|
protected
|
64
64
|
|
65
|
-
attr_accessor :
|
65
|
+
attr_accessor :__klass, :__instance
|
66
66
|
|
67
67
|
def after_generation(options)
|
68
|
-
|
68
|
+
__instance.save! if options[:save] && __instance.respond_to?(:save!)
|
69
69
|
end
|
70
70
|
|
71
71
|
def assign(method_name, options, raw_value=nil)
|
72
72
|
if options.has_key?(:count)
|
73
73
|
value = (1..options[:count]).map do |i|
|
74
|
-
block_given? ? yield(
|
74
|
+
block_given? ? yield(__instance, i) : raw_value
|
75
75
|
end
|
76
76
|
else
|
77
|
-
value = block_given? ? yield(
|
77
|
+
value = block_given? ? yield(__instance) : raw_value
|
78
78
|
end
|
79
|
-
|
79
|
+
__instance.send("#{method_name}=", value)
|
80
80
|
end
|
81
81
|
|
82
82
|
def post_initialize; end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Fabrication::Generator::DataMapper < Fabrication::Generator::Base
|
2
|
+
|
3
|
+
class << self
|
4
|
+
def supports?(klass)
|
5
|
+
defined?(DataMapper) && klass.ancestors.include?(DataMapper::Hook)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
|
11
|
+
def after_generation(options)
|
12
|
+
__instance.save if options[:save] && __instance.respond_to?(:save)
|
13
|
+
end
|
14
|
+
end
|
@@ -6,16 +6,16 @@ class Fabrication::Generator::Mongoid < Fabrication::Generator::Base
|
|
6
6
|
def assign(method_name, options, raw_value=nil)
|
7
7
|
if options.has_key?(:count)
|
8
8
|
value = (1..options[:count]).map do |i|
|
9
|
-
block_given? ? yield(
|
9
|
+
block_given? ? yield(__instance, i) : raw_value
|
10
10
|
end
|
11
11
|
else
|
12
|
-
value = block_given? ? yield(
|
12
|
+
value = block_given? ? yield(__instance) : raw_value
|
13
13
|
end
|
14
14
|
|
15
|
-
if
|
16
|
-
|
15
|
+
if Mongoid.allow_dynamic_fields && !__instance.respond_to?("#{method_name}=")
|
16
|
+
__instance[method_name] = value
|
17
17
|
else
|
18
|
-
|
18
|
+
__instance.send("#{method_name}=", value)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -1,7 +1,8 @@
|
|
1
|
-
class Fabrication::Schematic
|
1
|
+
class Fabrication::Schematic::Definition
|
2
2
|
|
3
3
|
GENERATORS = [
|
4
4
|
Fabrication::Generator::ActiveRecord,
|
5
|
+
Fabrication::Generator::DataMapper,
|
5
6
|
Fabrication::Generator::Sequel,
|
6
7
|
Fabrication::Generator::Mongoid,
|
7
8
|
Fabrication::Generator::Base
|
@@ -74,7 +75,7 @@ class Fabrication::Schematic
|
|
74
75
|
clone.tap do |schematic|
|
75
76
|
schematic.instance_eval(&block) if block_given?
|
76
77
|
overrides.each do |name, value|
|
77
|
-
schematic.append_or_update_attribute(Fabrication::Attribute.new(name.to_sym, nil, value))
|
78
|
+
schematic.append_or_update_attribute(Fabrication::Schematic::Attribute.new(name.to_sym, nil, value))
|
78
79
|
end
|
79
80
|
end
|
80
81
|
end
|
@@ -89,7 +90,7 @@ class Fabrication::Schematic
|
|
89
90
|
value = args.first
|
90
91
|
end
|
91
92
|
|
92
|
-
append_or_update_attribute(Fabrication::Attribute.new(method_name, params, value))
|
93
|
+
append_or_update_attribute(Fabrication::Schematic::Attribute.new(method_name, params, value))
|
93
94
|
end
|
94
95
|
|
95
96
|
def on_init(&block)
|
@@ -122,7 +123,12 @@ class Fabrication::Schematic
|
|
122
123
|
def to_hash(object)
|
123
124
|
(defined?(HashWithIndifferentAccess) ? HashWithIndifferentAccess.new : {}).tap do |hash|
|
124
125
|
attributes.map do |attribute|
|
125
|
-
|
126
|
+
value = object.send(attribute.name)
|
127
|
+
if value.respond_to? :id
|
128
|
+
hash["#{attribute.name}_id"] = value.id
|
129
|
+
else
|
130
|
+
hash[attribute.name] = value
|
131
|
+
end
|
126
132
|
end
|
127
133
|
end
|
128
134
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
class Fabrication::Schematic::Manager
|
2
|
+
|
3
|
+
def clear
|
4
|
+
schematics.clear
|
5
|
+
end
|
6
|
+
|
7
|
+
def empty?
|
8
|
+
schematics.empty?
|
9
|
+
end
|
10
|
+
|
11
|
+
def register(name, options, &block)
|
12
|
+
name = name.to_sym
|
13
|
+
raise_if_registered(name)
|
14
|
+
store(name, Array(options.delete(:aliases)), options, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def [](name)
|
18
|
+
schematics[name.to_sym]
|
19
|
+
end
|
20
|
+
|
21
|
+
def schematics
|
22
|
+
@schematics ||= {}
|
23
|
+
end
|
24
|
+
|
25
|
+
protected
|
26
|
+
|
27
|
+
def raise_if_registered(name)
|
28
|
+
if self[name]
|
29
|
+
raise Fabrication::DuplicateFabricatorError, "'#{name}' is already defined"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def store(name, aliases, options, &block)
|
34
|
+
schematic = schematics[name] = schematic_for(name, options, &block)
|
35
|
+
aliases.each { |as| schematics[as.to_sym] = schematic }
|
36
|
+
end
|
37
|
+
|
38
|
+
def resolve_class(name, parent, options)
|
39
|
+
Fabrication::Support.class_for(
|
40
|
+
options[:class_name] ||
|
41
|
+
(parent && parent.klass.name) ||
|
42
|
+
options[:from] ||
|
43
|
+
name
|
44
|
+
).tap do |klass|
|
45
|
+
raise Fabrication::UnfabricatableError, "No class found for '#{name}'" unless klass
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def schematic_for(name, options, &block)
|
50
|
+
parent = schematics[options[:from]]
|
51
|
+
klass = resolve_class(name, parent, options)
|
52
|
+
|
53
|
+
if parent
|
54
|
+
parent.merge(&block).tap { |s| s.klass = klass }
|
55
|
+
else
|
56
|
+
Fabrication::Schematic::Definition.new(klass, &block)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/fabrication/support.rb
CHANGED
@@ -2,21 +2,34 @@ class Fabrication::Transform
|
|
2
2
|
|
3
3
|
class << self
|
4
4
|
|
5
|
-
def
|
6
|
-
Fabrication::Support.find_definitions if Fabrication
|
7
|
-
attributes_hash.inject({}) {|h,(k,v)| h.update(k =>
|
5
|
+
def apply_to(schematic, attributes_hash)
|
6
|
+
Fabrication::Support.find_definitions if Fabrication.schematics.empty?
|
7
|
+
attributes_hash.inject({}) {|h,(k,v)| h.update(k => apply_transform(schematic, k, v)) }
|
8
8
|
end
|
9
9
|
|
10
10
|
def clear_all
|
11
11
|
@transforms = nil
|
12
|
+
@overrides = nil
|
12
13
|
end
|
13
14
|
|
14
15
|
def define(attribute, transform)
|
15
16
|
transforms[attribute] = transform
|
16
17
|
end
|
17
18
|
|
19
|
+
def only_for(schematic, attribute, transform)
|
20
|
+
overrides[schematic] = (overrides[schematic] || {}).merge!(attribute => transform)
|
21
|
+
end
|
22
|
+
|
18
23
|
private
|
19
24
|
|
25
|
+
def overrides
|
26
|
+
@overrides ||= {}
|
27
|
+
end
|
28
|
+
|
29
|
+
def apply_transform(schematic, attribute, value)
|
30
|
+
overrides.fetch(schematic, transforms)[attribute].call(value)
|
31
|
+
end
|
32
|
+
|
20
33
|
def transforms
|
21
34
|
@transforms ||= Hash.new(lambda {|value| value})
|
22
35
|
end
|
data/lib/fabrication/version.rb
CHANGED
@@ -41,5 +41,5 @@ end
|
|
41
41
|
|
42
42
|
Then /^I should see the following (.*) in the database:$/ do |model_name, table|
|
43
43
|
klass = Fabrication::Cucumber::StepFabricator.new(model_name).klass
|
44
|
-
klass.where(table.rows_hash).count.should == 1
|
44
|
+
klass.where(table.rows_hash.symbolize_keys).count.should == 1
|
45
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fabrication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &70248489649880 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70248489649880
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bson_ext
|
27
|
-
requirement: &
|
27
|
+
requirement: &70248489648640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70248489648640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: cucumber
|
38
|
-
requirement: &
|
38
|
+
requirement: &70248489647020 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,65 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70248489647020
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sqlite3
|
49
|
+
requirement: &70248489646320 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70248489646320
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: dm-active_model
|
60
|
+
requirement: &70248489645760 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70248489645760
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: dm-core
|
71
|
+
requirement: &70248489644760 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70248489644760
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: dm-migrations
|
82
|
+
requirement: &70248489643740 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70248489643740
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: dm-sqlite-adapter
|
93
|
+
requirement: &70248489629400 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70248489629400
|
47
102
|
- !ruby/object:Gem::Dependency
|
48
103
|
name: turnip
|
49
|
-
requirement: &
|
104
|
+
requirement: &70248489628020 !ruby/object:Gem::Requirement
|
50
105
|
none: false
|
51
106
|
requirements:
|
52
107
|
- - ! '>='
|
@@ -54,10 +109,10 @@ dependencies:
|
|
54
109
|
version: '0.3'
|
55
110
|
type: :development
|
56
111
|
prerelease: false
|
57
|
-
version_requirements: *
|
112
|
+
version_requirements: *70248489628020
|
58
113
|
- !ruby/object:Gem::Dependency
|
59
114
|
name: ffaker
|
60
|
-
requirement: &
|
115
|
+
requirement: &70248489627440 !ruby/object:Gem::Requirement
|
61
116
|
none: false
|
62
117
|
requirements:
|
63
118
|
- - ! '>='
|
@@ -65,10 +120,10 @@ dependencies:
|
|
65
120
|
version: '0'
|
66
121
|
type: :development
|
67
122
|
prerelease: false
|
68
|
-
version_requirements: *
|
123
|
+
version_requirements: *70248489627440
|
69
124
|
- !ruby/object:Gem::Dependency
|
70
125
|
name: fuubar
|
71
|
-
requirement: &
|
126
|
+
requirement: &70248489626520 !ruby/object:Gem::Requirement
|
72
127
|
none: false
|
73
128
|
requirements:
|
74
129
|
- - ! '>='
|
@@ -76,10 +131,10 @@ dependencies:
|
|
76
131
|
version: '0'
|
77
132
|
type: :development
|
78
133
|
prerelease: false
|
79
|
-
version_requirements: *
|
134
|
+
version_requirements: *70248489626520
|
80
135
|
- !ruby/object:Gem::Dependency
|
81
136
|
name: fuubar-cucumber
|
82
|
-
requirement: &
|
137
|
+
requirement: &70248489626020 !ruby/object:Gem::Requirement
|
83
138
|
none: false
|
84
139
|
requirements:
|
85
140
|
- - ! '>='
|
@@ -87,10 +142,10 @@ dependencies:
|
|
87
142
|
version: '0'
|
88
143
|
type: :development
|
89
144
|
prerelease: false
|
90
|
-
version_requirements: *
|
145
|
+
version_requirements: *70248489626020
|
91
146
|
- !ruby/object:Gem::Dependency
|
92
147
|
name: mongoid
|
93
|
-
requirement: &
|
148
|
+
requirement: &70248489625400 !ruby/object:Gem::Requirement
|
94
149
|
none: false
|
95
150
|
requirements:
|
96
151
|
- - ! '>='
|
@@ -98,10 +153,10 @@ dependencies:
|
|
98
153
|
version: '0'
|
99
154
|
type: :development
|
100
155
|
prerelease: false
|
101
|
-
version_requirements: *
|
156
|
+
version_requirements: *70248489625400
|
102
157
|
- !ruby/object:Gem::Dependency
|
103
158
|
name: pry
|
104
|
-
requirement: &
|
159
|
+
requirement: &70248489624900 !ruby/object:Gem::Requirement
|
105
160
|
none: false
|
106
161
|
requirements:
|
107
162
|
- - ! '>='
|
@@ -109,10 +164,10 @@ dependencies:
|
|
109
164
|
version: '0'
|
110
165
|
type: :development
|
111
166
|
prerelease: false
|
112
|
-
version_requirements: *
|
167
|
+
version_requirements: *70248489624900
|
113
168
|
- !ruby/object:Gem::Dependency
|
114
169
|
name: rake
|
115
|
-
requirement: &
|
170
|
+
requirement: &70248489624300 !ruby/object:Gem::Requirement
|
116
171
|
none: false
|
117
172
|
requirements:
|
118
173
|
- - ! '>='
|
@@ -120,10 +175,10 @@ dependencies:
|
|
120
175
|
version: '0'
|
121
176
|
type: :development
|
122
177
|
prerelease: false
|
123
|
-
version_requirements: *
|
178
|
+
version_requirements: *70248489624300
|
124
179
|
- !ruby/object:Gem::Dependency
|
125
180
|
name: rspec
|
126
|
-
requirement: &
|
181
|
+
requirement: &70248489623680 !ruby/object:Gem::Requirement
|
127
182
|
none: false
|
128
183
|
requirements:
|
129
184
|
- - ! '>='
|
@@ -131,21 +186,10 @@ dependencies:
|
|
131
186
|
version: '0'
|
132
187
|
type: :development
|
133
188
|
prerelease: false
|
134
|
-
version_requirements: *
|
189
|
+
version_requirements: *70248489623680
|
135
190
|
- !ruby/object:Gem::Dependency
|
136
191
|
name: sequel
|
137
|
-
requirement: &
|
138
|
-
none: false
|
139
|
-
requirements:
|
140
|
-
- - ! '>='
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: '0'
|
143
|
-
type: :development
|
144
|
-
prerelease: false
|
145
|
-
version_requirements: *70293264098720
|
146
|
-
- !ruby/object:Gem::Dependency
|
147
|
-
name: sqlite3
|
148
|
-
requirement: &70293264097860 !ruby/object:Gem::Requirement
|
192
|
+
requirement: &70248489623160 !ruby/object:Gem::Requirement
|
149
193
|
none: false
|
150
194
|
requirements:
|
151
195
|
- - ! '>='
|
@@ -153,7 +197,7 @@ dependencies:
|
|
153
197
|
version: '0'
|
154
198
|
type: :development
|
155
199
|
prerelease: false
|
156
|
-
version_requirements: *
|
200
|
+
version_requirements: *70248489623160
|
157
201
|
description: Fabrication is an object generation framework for ActiveRecord, Mongoid,
|
158
202
|
and Sequel. It has a sensible syntax and lazily generates ActiveRecord associations!
|
159
203
|
email:
|
@@ -162,7 +206,6 @@ executables: []
|
|
162
206
|
extensions: []
|
163
207
|
extra_rdoc_files: []
|
164
208
|
files:
|
165
|
-
- lib/fabrication/attribute.rb
|
166
209
|
- lib/fabrication/config.rb
|
167
210
|
- lib/fabrication/cucumber/step_fabricator.rb
|
168
211
|
- lib/fabrication/errors/duplicate_fabricator_error.rb
|
@@ -172,9 +215,12 @@ files:
|
|
172
215
|
- lib/fabrication/fabricator.rb
|
173
216
|
- lib/fabrication/generator/active_record.rb
|
174
217
|
- lib/fabrication/generator/base.rb
|
218
|
+
- lib/fabrication/generator/data_mapper.rb
|
175
219
|
- lib/fabrication/generator/mongoid.rb
|
176
220
|
- lib/fabrication/generator/sequel.rb
|
177
|
-
- lib/fabrication/schematic.rb
|
221
|
+
- lib/fabrication/schematic/attribute.rb
|
222
|
+
- lib/fabrication/schematic/definition.rb
|
223
|
+
- lib/fabrication/schematic/manager.rb
|
178
224
|
- lib/fabrication/sequencer.rb
|
179
225
|
- lib/fabrication/support.rb
|
180
226
|
- lib/fabrication/syntax/make.rb
|