rails3-generators 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,10 @@
2
2
  * Write some documentation. (In both the github wiki and the source code)
3
3
  * Remove generators that exist in other libraries
4
4
 
5
+ == 0.17.4
6
+ * optimize
7
+ * Allow use of both FactoryGirl 1 and 2. (Louis T.)
8
+
5
9
  == 0.17.3
6
10
  * optimize
7
11
  * Update FactoryGirl generator to use version 2.0.0 syntax (Kevin Faustino)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails3-generators (0.17.0.beta.1)
4
+ rails3-generators (0.17.3)
5
5
  railties (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -34,18 +34,19 @@ GEM
34
34
  activemodel (= 3.0.3)
35
35
  activesupport (= 3.0.3)
36
36
  activesupport (3.0.3)
37
- arel (2.0.6)
37
+ arel (2.0.7)
38
38
  builder (2.1.2)
39
39
  erubis (2.6.6)
40
40
  abstract (>= 1.0.0)
41
- haml (3.0.24)
41
+ factory_girl (1.3.3)
42
+ haml (3.0.25)
42
43
  haml-rails (0.3.4)
43
44
  actionpack (~> 3.0)
44
45
  activesupport (~> 3.0)
45
46
  haml (~> 3.0)
46
47
  railties (~> 3.0)
47
48
  i18n (0.5.0)
48
- mail (2.2.12)
49
+ mail (2.2.15)
49
50
  activesupport (>= 2.3.6)
50
51
  i18n (>= 0.4.0)
51
52
  mime-types (~> 1.16)
@@ -55,7 +56,7 @@ GEM
55
56
  rack (1.2.1)
56
57
  rack-mount (0.6.13)
57
58
  rack (>= 1.0.0)
58
- rack-test (0.5.6)
59
+ rack-test (0.5.7)
59
60
  rack (>= 1.0)
60
61
  rails (3.0.3)
61
62
  actionmailer (= 3.0.3)
@@ -75,15 +76,15 @@ GEM
75
76
  thor (0.14.6)
76
77
  treetop (1.4.9)
77
78
  polyglot (>= 0.3.1)
78
- tzinfo (0.3.23)
79
+ tzinfo (0.3.24)
79
80
 
80
81
  PLATFORMS
81
82
  ruby
82
83
 
83
84
  DEPENDENCIES
84
85
  bundler (>= 1.0.0)
86
+ factory_girl
85
87
  haml-rails
86
88
  rails (>= 3.0.0)
87
89
  rails3-generators!
88
- railties (>= 3.0.0)
89
90
  test-unit
@@ -2,7 +2,7 @@
2
2
 
3
3
  Rails 3 compatible generators for gems that don't have them yet
4
4
 
5
- == install
5
+ == Install
6
6
 
7
7
  gem install rails3-generators
8
8
 
@@ -10,6 +10,8 @@ and add the following to your project's Gemfile
10
10
 
11
11
  gem 'rails3-generators'
12
12
 
13
+ == Notes/Use
14
+
13
15
  Activate individual generators in your *config/application.rb* file, like so:
14
16
 
15
17
  config.generators do |g|
@@ -18,8 +20,6 @@ Activate individual generators in your *config/application.rb* file, like so:
18
20
 
19
21
  Now a factory_girl fixture will be generated by default whenever a model is generated.
20
22
 
21
- == notes
22
-
23
23
  The Haml generators have moved to {the haml-rails gem}[http://github.com/indirect/haml-rails].
24
24
 
25
25
  The jQuery generators have moved to {the jquery-rails gem}[http://github.com/indirect/jquery-rails].
@@ -43,19 +43,11 @@ To avoid overriding the rails built-in Erb template generators this project uses
43
43
  == Contributors
44
44
 
45
45
  DataMapper: José Valim
46
-
47
46
  Factory Girl: Paul Barry
48
-
49
47
  Authlogic: Jeff Tucker
50
-
51
48
  Mongomapper: Jai-Gouk Kim
52
-
53
49
  MongoMapper: Kristian Mandrup (for 0.8) - needs testing
54
-
55
- Mongoid: Kristian Mandrup (for 2.0.beta) - needs testing
56
-
57
50
  Shoulda: Peter Haza
58
-
59
51
  SimpleForm: Peter Gumeson
60
52
 
61
53
  and more[http://github.com/indirect/rails3-generators/contributors]
@@ -7,7 +7,18 @@ module FactoryGirl
7
7
  class_option :dir, :type => :string, :default => "test/factories", :desc => "The directory where the factories should go"
8
8
 
9
9
  def create_fixture_file
10
- template 'fixtures.rb', File.join(options[:dir], "#{table_name}.rb")
10
+ version = nil
11
+ begin
12
+ require 'factory_girl/version'
13
+ version = FactoryGirl::VERSION.to_i
14
+ rescue LoadError
15
+ require 'factory_girl'
16
+ version = Factory::VERSION.to_i
17
+ rescue Object => e
18
+ raise "Please install Factory_girl or add it to your Gemfile"
19
+ end
20
+
21
+ template "fixtures.#{version}.rb", File.join(options[:dir], "#{table_name}.rb")
11
22
  end
12
23
  end
13
24
  end
@@ -0,0 +1,7 @@
1
+ # Read about factories at http://github.com/thoughtbot/factory_girl
2
+
3
+ Factory.define :<%= singular_name %> do |f|
4
+ <% for attribute in attributes -%>
5
+ f.<%= attribute.name %> <%= attribute.default.inspect %>
6
+ <% end -%>
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Rails3
2
2
  module Generators
3
- VERSION = "0.17.3"
3
+ VERSION = "0.17.4"
4
4
  end
5
5
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency "test-unit"
20
20
  s.add_development_dependency "haml-rails"
21
21
  s.add_development_dependency "rails", ">= 3.0.0"
22
+ s.add_development_dependency "factory_girl"
22
23
 
23
24
  s.files = `git ls-files`.split("\n")
24
25
  s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 17
8
- - 3
9
- version: 0.17.3
8
+ - 4
9
+ version: 0.17.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jose Valim
@@ -24,7 +24,7 @@ autorequire:
24
24
  bindir: bin
25
25
  cert_chain: []
26
26
 
27
- date: 2011-01-28 00:00:00 -05:00
27
+ date: 2011-02-02 00:00:00 -05:00
28
28
  default_executable:
29
29
  dependencies:
30
30
  - !ruby/object:Gem::Dependency
@@ -98,6 +98,19 @@ dependencies:
98
98
  version: 3.0.0
99
99
  type: :development
100
100
  version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: factory_girl
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ version: "0"
112
+ type: :development
113
+ version_requirements: *id006
101
114
  description: "Rails 3 compatible generators for gems that don't have them yet "
102
115
  email: andre@arko.net
103
116
  executables: []
@@ -139,7 +152,8 @@ files:
139
152
  - lib/generators/erubis/scaffold/templates/show.html.erb
140
153
  - lib/generators/factory_girl.rb
141
154
  - lib/generators/factory_girl/model/model_generator.rb
142
- - lib/generators/factory_girl/model/templates/fixtures.rb
155
+ - lib/generators/factory_girl/model/templates/fixtures.1.rb
156
+ - lib/generators/factory_girl/model/templates/fixtures.2.rb
143
157
  - lib/generators/formtastic.rb
144
158
  - lib/generators/formtastic/scaffold/scaffold_generator.rb
145
159
  - lib/generators/formtastic/scaffold/templates/_form.html.erb.erb
@@ -216,7 +230,7 @@ homepage: https://github.com/indirect/rails3-generators
216
230
  licenses: []
217
231
 
218
232
  post_install_message: "\n\
219
- rails3-generators-0.17.3\n\n\
233
+ rails3-generators-0.17.4\n\n\
220
234
  Be sure to check out the wiki, https://wiki.github.com/indirect/rails3-generators/,\n\
221
235
  for information about recent changes to this project.\n\n\
222
236
  Machinist generators have been removed. Please update your project to use Machinist 2 (https://github.com/notahat/machinist) which contains its own generators.\n\n\