scaffoldhub 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- scaffoldhub (0.0.2)
4
+ scaffoldhub (0.0.3)
5
5
  rails
6
6
 
7
7
  GEM
@@ -48,8 +48,8 @@ GEM
48
48
  mime-types (1.16)
49
49
  mocha (0.9.12)
50
50
  polyglot (0.3.1)
51
- rack (1.2.1)
52
- rack-mount (0.6.13)
51
+ rack (1.2.2)
52
+ rack-mount (0.6.14)
53
53
  rack (>= 1.0.0)
54
54
  rack-test (0.5.7)
55
55
  rack (>= 1.0)
@@ -78,7 +78,7 @@ GEM
78
78
  thor (0.14.6)
79
79
  treetop (1.4.9)
80
80
  polyglot (>= 0.3.1)
81
- tzinfo (0.3.24)
81
+ tzinfo (0.3.25)
82
82
 
83
83
  PLATFORMS
84
84
  ruby
@@ -11,10 +11,20 @@ module ActiveRecord
11
11
  class_option :scaffold, :default => 'default', :banner => "SCAFFOLD_NAME", :type => :string, :desc => "Scaffold to use"
12
12
  class_option :local, :default => false, :banner => "LOCAL SCAFFOLD", :type => :boolean, :desc => "Use a local scaffold, not scaffoldhub.org"
13
13
 
14
+ class_option :migration, :type => :boolean
15
+ class_option :timestamps, :type => :boolean
16
+ class_option :parent, :type => :string, :desc => "The parent class for the generated model"
17
+
14
18
  def create_model_file
15
19
  model_template = find_template_file('active_record', 'templates/model.rb')
16
20
  template model_template.src, File.join('app/models', class_path, "#{file_name}.rb") if model_template
17
21
  end
18
22
 
23
+ def create_migration_file
24
+ return unless options[:migration] && options[:parent].nil?
25
+ migration_template = find_template_file('active_record', 'templates/migration.rb')
26
+ migration_template migration_template.src, "db/migrate/create_#{table_name}.rb" if migration_template
27
+ end
28
+
19
29
  end
20
30
  end
data/lib/scaffoldhub.rb CHANGED
@@ -5,5 +5,5 @@ require 'scaffoldhub/template_file'
5
5
  require 'scaffoldhub/helper'
6
6
 
7
7
  module Scaffoldhub
8
- VERSION = '0.0.3'
8
+ VERSION = '0.0.4'
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffoldhub
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Shaughnessy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-12 23:00:00 -05:00
18
+ date: 2011-03-24 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency