rails_templater 0.0.1 → 0.0.2

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.
@@ -1,3 +1,3 @@
1
1
  module RailsTemplater
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,14 @@
1
+ require 'generators/factory_girl'
2
+
3
+ module FactoryGirl
4
+ module Generators
5
+ class ModelGenerator < Base
6
+ argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
7
+ class_option :dir, :type => :string, :default => "spec/factories", :desc => "The directory where the factories should go"
8
+
9
+ def create_fixture_file
10
+ template 'fixtures.rb', File.join(options[:dir], "#{table_name}.rb")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ # Read about factories at http://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :<%= singular_name %> do
5
+ <% for attribute in attributes -%>
6
+ <%= attribute.name %> <%= attribute.default.inspect %>
7
+ <% end -%>
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require 'rails/generators/named_base'
2
+
3
+ module FactoryGirl
4
+ module Generators
5
+ class Base < Rails::Generators::NamedBase #:nodoc:
6
+ def self.source_root
7
+ @_factory_girl_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'factory_girl', generator_name, 'templates'))
8
+ end
9
+ end
10
+ end
11
+ end
@@ -14,6 +14,4 @@ get "http://html5shiv.googlecode.com/svn/trunk/html5.js", "public/javascripts/ht
14
14
 
15
15
  git :init
16
16
 
17
- append_file '.gitignore', load_template('gitignore','git')
18
-
19
- gem 'rails3-generators'
17
+ append_file '.gitignore', load_template('gitignore','git')
@@ -1,5 +1,5 @@
1
1
  gem 'mongoid', '2.0.0.beta.20'
2
- gem 'bson_ext', '~> 1.1.2'
2
+ gem 'bson_ext', '~> 1.1'
3
3
 
4
4
  post_bundler_strategies << lambda do
5
5
  generate 'mongoid:config'
@@ -17,5 +17,7 @@ execute_post_bundler_strategies
17
17
 
18
18
  environment load_snippet('generators', 'rails')
19
19
 
20
+ directory File.join(File.dirname(__FILE__),'generators'), 'lib/generators'
21
+
20
22
  git :add => "."
21
23
  git :commit => "-m 'Initial commit'"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kevin Faustino
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-13 00:00:00 -05:00
17
+ date: 2011-01-23 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -83,6 +83,9 @@ files:
83
83
  - lib/rails_templater/cli.rb
84
84
  - lib/rails_templater/version.rb
85
85
  - lib/template/core_extensions.rb
86
+ - lib/template/generators/factory_girl.rb
87
+ - lib/template/generators/factory_girl/model/model_generator.rb
88
+ - lib/template/generators/factory_girl/model/templates/fixtures.rb
86
89
  - lib/template/recipes/cucumber.rb
87
90
  - lib/template/recipes/default.rb
88
91
  - lib/template/recipes/design.rb