scaffoldhub 0.0.3 → 0.0.4
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.
- data/Gemfile.lock +4 -4
- data/lib/generators/active_record/scaffoldhub_generator.rb +10 -0
- data/lib/scaffoldhub.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
scaffoldhub (0.0.
|
|
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.
|
|
52
|
-
rack-mount (0.6.
|
|
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.
|
|
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
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:
|
|
4
|
+
hash: 23
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
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-
|
|
18
|
+
date: 2011-03-24 00:00:00 -04:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|