fabrication 2.7.2 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19952424220acd0d916eafbecf996fecc9870bd6
4
- data.tar.gz: 443657b59d5cabc84f349a2063882304cb0b7d74
3
+ metadata.gz: 2269a43451102e038d20407b145774ddc943a4d8
4
+ data.tar.gz: e0d028f064c38f45bb11a4905a1520e80e846bd7
5
5
  SHA512:
6
- metadata.gz: fe4bf4524f3c8a7cf1d0a331e03a09a26e54cc77198ad0ea2e0b87d57a95da9915288c0f6f7bd209f7beffea8ce75b0549cd058785989633ec37543865751e2f
7
- data.tar.gz: efd348378470208dd2b23539e97210024b34a16ceb3bba0c5584340adb136aeddb0353014d1633b8e59cae3ae9ead87aa3e049ef62471adb2fa9692da00f65de
6
+ metadata.gz: 6308d6d7b3d9e13e782e8c0122569d247a4c92751ccf15947ea991ef978213eb34c32d3da1fb29ee223b8f1d283f720c2895d8f42a60998ec99affd4698d2449
7
+ data.tar.gz: d73ee4e84aebda7d7d75f2948b684423fa097fa173ca7a03ab75b70457a28ad87df4dd921a9161d7ad10edbc58678d9d6408a1bb310045958becdab1b4e7ea5c
@@ -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.2, 1.9.3, and Rubinius.
9
+ Fabrication is tested against Ruby 1.9.3, 2.0.0, and Rubinius.
10
10
 
11
11
  [![Build Status](https://secure.travis-ci.org/paulelliott/fabrication.png)](http://travis-ci.org/paulelliott/fabrication)
12
12
  [![Code Climate](https://codeclimate.com/github/paulelliott/fabrication.png)](https://codeclimate.com/github/paulelliott/fabrication)
@@ -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
@@ -5,7 +5,6 @@ class Fabrication::Schematic::Definition
5
5
  Fabrication::Generator::DataMapper,
6
6
  Fabrication::Generator::Sequel,
7
7
  Fabrication::Generator::Mongoid,
8
- Fabrication::Generator::Keymaker,
9
8
  Fabrication::Generator::Base
10
9
  ]
11
10
 
@@ -1,3 +1,3 @@
1
1
  module Fabrication
2
- VERSION = '2.7.2'
2
+ VERSION = '2.8.0'
3
3
  end
@@ -1,15 +1,16 @@
1
1
  require 'rails/generators/base'
2
2
 
3
- module Fabrication::Generators
4
- class CucumberStepsGenerator < Rails::Generators::Base
3
+ module Fabrication
4
+ module Generators
5
+ class CucumberStepsGenerator < Rails::Generators::Base
5
6
 
6
- def generate
7
- template 'fabrication_steps.rb', "features/step_definitions/fabrication_steps.rb"
8
- end
7
+ def generate
8
+ template 'fabrication_steps.rb', "features/step_definitions/fabrication_steps.rb"
9
+ end
9
10
 
10
- def self.source_root
11
- @_fabrication_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
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.7.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-06-03 00:00:00.000000000 Z
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.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