hashrocket-hashrocket-terraformation 0.0.0
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/LICENSE +1 -0
- data/README.rdoc +14 -0
- data/Rakefile +30 -0
- data/bin/terrarails +94 -0
- data/rails_generators/terracontroller/USAGE +26 -0
- data/rails_generators/terracontroller/templates/controller_spec.rb.erb +20 -0
- data/rails_generators/terracontroller/templates/view.builder.erb +2 -0
- data/rails_generators/terracontroller/templates/view.erb +2 -0
- data/rails_generators/terracontroller/templates/view.haml.erb +2 -0
- data/rails_generators/terracontroller/templates/view.rjs.erb +1 -0
- data/rails_generators/terracontroller/templates/view.rss.builder.erb +18 -0
- data/rails_generators/terracontroller/templates/view_spec.rb.erb +15 -0
- data/rails_generators/terracontroller/terracontroller_generator.rb +44 -0
- data/rails_generators/terraformation/USAGE +2 -0
- data/rails_generators/terraformation/templates/application.html.haml.erb +25 -0
- data/rails_generators/terraformation/templates/blueprint/ie.css +22 -0
- data/rails_generators/terraformation/templates/blueprint/print.css +29 -0
- data/rails_generators/terraformation/templates/blueprint/screen.css +226 -0
- data/rails_generators/terraformation/templates/clear_test_default.rake +3 -0
- data/rails_generators/terraformation/templates/cucumber +8 -0
- data/rails_generators/terraformation/templates/cucumber.rake +15 -0
- data/rails_generators/terraformation/templates/gitignore +11 -0
- data/rails_generators/terraformation/templates/jquery.js +19 -0
- data/rails_generators/terraformation/templates/null_gitignore +2 -0
- data/rails_generators/terraformation/templates/paths.rb +23 -0
- data/rails_generators/terraformation/templates/rcov.opts +2 -0
- data/rails_generators/terraformation/templates/rspec.rake +149 -0
- data/rails_generators/terraformation/templates/spec.opts +2 -0
- data/rails_generators/terraformation/templates/spec_helper.rb +12 -0
- data/rails_generators/terraformation/terraformation_generator.rb +86 -0
- data/rails_generators/terraforming.rb +51 -0
- data/rails_generators/terrahelper/USAGE +9 -0
- data/rails_generators/terrahelper/templates/helper.rb.erb +10 -0
- data/rails_generators/terrahelper/templates/helper_spec.rb.erb +13 -0
- data/rails_generators/terrahelper/terrahelper_generator.rb +27 -0
- data/rails_generators/terramodel/USAGE +11 -0
- data/rails_generators/terramodel/templates/model_exemplar.rb.erb +5 -0
- data/rails_generators/terramodel/templates/model_factory.rb.erb +5 -0
- data/rails_generators/terramodel/templates/model_spec.rb.erb +17 -0
- data/rails_generators/terramodel/terramodel_generator.rb +54 -0
- data/rails_generators/terraresource/USAGE +20 -0
- data/rails_generators/terraresource/terraresource_generator.rb +93 -0
- data/rails_generators/terrascaffold/USAGE +2 -0
- data/rails_generators/terrascaffold/templates/controller.rb.erb +85 -0
- data/rails_generators/terrascaffold/templates/controller_spec.rb.erb +173 -0
- data/rails_generators/terrascaffold/templates/partial_form.html.haml.erb +7 -0
- data/rails_generators/terrascaffold/templates/view_edit.html.haml.erb +8 -0
- data/rails_generators/terrascaffold/templates/view_edit.html_spec.rb.erb +23 -0
- data/rails_generators/terrascaffold/templates/view_index.html.haml.erb +18 -0
- data/rails_generators/terrascaffold/templates/view_index.html_spec.rb.erb +25 -0
- data/rails_generators/terrascaffold/templates/view_new.html.haml.erb +7 -0
- data/rails_generators/terrascaffold/templates/view_new.html_spec.rb.erb +23 -0
- data/rails_generators/terrascaffold/templates/view_show.html.haml.erb +8 -0
- data/rails_generators/terrascaffold/templates/view_show.html_spec.rb.erb +21 -0
- data/rails_generators/terrascaffold/terrascaffold_generator.rb +97 -0
- metadata +121 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../terraforming'
|
2
|
+
|
3
|
+
class TerrascaffoldGenerator < Rails::Generator::NamedBase
|
4
|
+
include Terraforming
|
5
|
+
|
6
|
+
default_options :skip_migration => false
|
7
|
+
|
8
|
+
attr_reader :controller_class_path,
|
9
|
+
:controller_class_name,
|
10
|
+
:controller_file_name
|
11
|
+
|
12
|
+
def initialize(runtime_args, runtime_options = {})
|
13
|
+
super
|
14
|
+
|
15
|
+
@controller_name = @name.pluralize
|
16
|
+
|
17
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
18
|
+
@controller_class_name_without_nesting, @controller_file_name = inflect_names(base_name)
|
19
|
+
|
20
|
+
if @controller_class_nesting.empty?
|
21
|
+
@controller_class_name = @controller_class_name_without_nesting
|
22
|
+
else
|
23
|
+
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
def manifest
|
29
|
+
record do |m|
|
30
|
+
|
31
|
+
m.class_collisions(controller_class_path, "#{controller_class_name}Controller")
|
32
|
+
m.class_collisions(class_path, "#{class_name}")
|
33
|
+
|
34
|
+
m.directory(File.join('app/controllers', controller_class_path))
|
35
|
+
m.directory(File.join('app/views', controller_class_path, controller_file_name))
|
36
|
+
m.directory(File.join('spec/controllers', controller_class_path))
|
37
|
+
m.directory File.join('spec/views', controller_class_path, controller_file_name)
|
38
|
+
|
39
|
+
m.template 'controller_spec.rb.erb',
|
40
|
+
File.join('spec/controllers', controller_class_path, "#{controller_file_name}_controller_spec.rb")
|
41
|
+
|
42
|
+
m.template 'controller.rb.erb',
|
43
|
+
File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
|
44
|
+
|
45
|
+
for action in scaffold_views
|
46
|
+
m.template "view_#{action}.html_spec.rb.erb",
|
47
|
+
File.join('spec/views', controller_class_path, controller_file_name, "#{action}.html_spec.rb")
|
48
|
+
if defined?(Haml)
|
49
|
+
m.template(
|
50
|
+
"view_#{action}.html.haml.erb",
|
51
|
+
File.join('app/views', controller_class_path, controller_file_name, "#{action}.html.haml")
|
52
|
+
)
|
53
|
+
else
|
54
|
+
m.template(
|
55
|
+
"scaffold:view_#{action}.html.erb",
|
56
|
+
File.join('app/views', controller_class_path, controller_file_name, "#{action}.html.erb")
|
57
|
+
)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if defined?(Haml)
|
61
|
+
m.template(
|
62
|
+
"partial_form.html.haml.erb",
|
63
|
+
File.join('app/views', controller_class_path, controller_file_name, "_form.html.haml")
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
m.dependency 'terramodel', [name] + args, :collision => 'skip'
|
68
|
+
|
69
|
+
m.route_resources controller_file_name
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
protected
|
75
|
+
|
76
|
+
def banner
|
77
|
+
"Usage: #{$0} terrascaffold ModelName [field:type field:type]"
|
78
|
+
end
|
79
|
+
|
80
|
+
def add_options!(opt)
|
81
|
+
opt.separator ''
|
82
|
+
opt.separator 'Options:'
|
83
|
+
opt.on("--skip-migration",
|
84
|
+
"Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
|
85
|
+
opt.on("--[no-]exemplar", "Create Object Daddy Exemplar") { |v| options[:exemplar] = v }
|
86
|
+
opt.on("--[no-]factory", "Create Factory Girl Factory") { |v| options[:factory] = v }
|
87
|
+
end
|
88
|
+
|
89
|
+
def scaffold_views
|
90
|
+
%w[ index show new edit ]
|
91
|
+
end
|
92
|
+
|
93
|
+
def model_name
|
94
|
+
class_name.demodulize
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hashrocket-hashrocket-terraformation
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- a team of ravenous rocketeers
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-04 00:00:00 -08:00
|
13
|
+
default_executable: terrarails
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: info@hashrocket.com
|
18
|
+
executables:
|
19
|
+
- terrarails
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- LICENSE
|
25
|
+
files:
|
26
|
+
- LICENSE
|
27
|
+
- README.rdoc
|
28
|
+
- Rakefile
|
29
|
+
- bin/terrarails
|
30
|
+
- rails_generators/terracontroller
|
31
|
+
- rails_generators/terracontroller/USAGE
|
32
|
+
- rails_generators/terracontroller/templates
|
33
|
+
- rails_generators/terracontroller/templates/controller_spec.rb.erb
|
34
|
+
- rails_generators/terracontroller/templates/view.builder.erb
|
35
|
+
- rails_generators/terracontroller/templates/view.erb
|
36
|
+
- rails_generators/terracontroller/templates/view.haml.erb
|
37
|
+
- rails_generators/terracontroller/templates/view.rjs.erb
|
38
|
+
- rails_generators/terracontroller/templates/view.rss.builder.erb
|
39
|
+
- rails_generators/terracontroller/templates/view_spec.rb.erb
|
40
|
+
- rails_generators/terracontroller/terracontroller_generator.rb
|
41
|
+
- rails_generators/terraformation
|
42
|
+
- rails_generators/terraformation/USAGE
|
43
|
+
- rails_generators/terraformation/templates
|
44
|
+
- rails_generators/terraformation/templates/application.html.haml.erb
|
45
|
+
- rails_generators/terraformation/templates/blueprint
|
46
|
+
- rails_generators/terraformation/templates/blueprint/ie.css
|
47
|
+
- rails_generators/terraformation/templates/blueprint/print.css
|
48
|
+
- rails_generators/terraformation/templates/blueprint/screen.css
|
49
|
+
- rails_generators/terraformation/templates/clear_test_default.rake
|
50
|
+
- rails_generators/terraformation/templates/cucumber
|
51
|
+
- rails_generators/terraformation/templates/cucumber.rake
|
52
|
+
- rails_generators/terraformation/templates/gitignore
|
53
|
+
- rails_generators/terraformation/templates/jquery.js
|
54
|
+
- rails_generators/terraformation/templates/null_gitignore
|
55
|
+
- rails_generators/terraformation/templates/paths.rb
|
56
|
+
- rails_generators/terraformation/templates/rcov.opts
|
57
|
+
- rails_generators/terraformation/templates/rspec.rake
|
58
|
+
- rails_generators/terraformation/templates/spec.opts
|
59
|
+
- rails_generators/terraformation/templates/spec_helper.rb
|
60
|
+
- rails_generators/terraformation/terraformation_generator.rb
|
61
|
+
- rails_generators/terraforming.rb
|
62
|
+
- rails_generators/terrahelper
|
63
|
+
- rails_generators/terrahelper/USAGE
|
64
|
+
- rails_generators/terrahelper/templates
|
65
|
+
- rails_generators/terrahelper/templates/helper.rb.erb
|
66
|
+
- rails_generators/terrahelper/templates/helper_spec.rb.erb
|
67
|
+
- rails_generators/terrahelper/terrahelper_generator.rb
|
68
|
+
- rails_generators/terramodel
|
69
|
+
- rails_generators/terramodel/USAGE
|
70
|
+
- rails_generators/terramodel/templates
|
71
|
+
- rails_generators/terramodel/templates/model_exemplar.rb.erb
|
72
|
+
- rails_generators/terramodel/templates/model_factory.rb.erb
|
73
|
+
- rails_generators/terramodel/templates/model_spec.rb.erb
|
74
|
+
- rails_generators/terramodel/terramodel_generator.rb
|
75
|
+
- rails_generators/terraresource
|
76
|
+
- rails_generators/terraresource/USAGE
|
77
|
+
- rails_generators/terraresource/templates
|
78
|
+
- rails_generators/terraresource/terraresource_generator.rb
|
79
|
+
- rails_generators/terrascaffold
|
80
|
+
- rails_generators/terrascaffold/USAGE
|
81
|
+
- rails_generators/terrascaffold/templates
|
82
|
+
- rails_generators/terrascaffold/templates/controller.rb.erb
|
83
|
+
- rails_generators/terrascaffold/templates/controller_spec.rb.erb
|
84
|
+
- rails_generators/terrascaffold/templates/partial_form.html.haml.erb
|
85
|
+
- rails_generators/terrascaffold/templates/view_edit.html.haml.erb
|
86
|
+
- rails_generators/terrascaffold/templates/view_edit.html_spec.rb.erb
|
87
|
+
- rails_generators/terrascaffold/templates/view_index.html.haml.erb
|
88
|
+
- rails_generators/terrascaffold/templates/view_index.html_spec.rb.erb
|
89
|
+
- rails_generators/terrascaffold/templates/view_new.html.haml.erb
|
90
|
+
- rails_generators/terrascaffold/templates/view_new.html_spec.rb.erb
|
91
|
+
- rails_generators/terrascaffold/templates/view_show.html.haml.erb
|
92
|
+
- rails_generators/terrascaffold/templates/view_show.html_spec.rb.erb
|
93
|
+
- rails_generators/terrascaffold/terrascaffold_generator.rb
|
94
|
+
has_rdoc: false
|
95
|
+
homepage: http://github.com/hashrocket/terraformation
|
96
|
+
post_install_message:
|
97
|
+
rdoc_options: []
|
98
|
+
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: "0"
|
106
|
+
version:
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
112
|
+
version:
|
113
|
+
requirements: []
|
114
|
+
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 1.2.0
|
117
|
+
signing_key:
|
118
|
+
specification_version: 2
|
119
|
+
summary: Terraform your app with style
|
120
|
+
test_files: []
|
121
|
+
|