technicalpickles-shoulda_generator 0.1.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.
Files changed (33) hide show
  1. data/Manifest +32 -0
  2. data/README.markdown +81 -0
  3. data/Rakefile +10 -0
  4. data/rails_generators/shoulda_model/USAGE +27 -0
  5. data/rails_generators/shoulda_model/shoulda_model_generator.rb +53 -0
  6. data/rails_generators/shoulda_model/templates/factory.rb +5 -0
  7. data/rails_generators/shoulda_model/templates/fixtures.yml +19 -0
  8. data/rails_generators/shoulda_model/templates/migration.rb +16 -0
  9. data/rails_generators/shoulda_model/templates/model.rb +2 -0
  10. data/rails_generators/shoulda_model/templates/unit_test.rb +7 -0
  11. data/rails_generators/shoulda_scaffold/USAGE +25 -0
  12. data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +107 -0
  13. data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +22 -0
  14. data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +29 -0
  15. data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +226 -0
  16. data/rails_generators/shoulda_scaffold/templates/controller.rb +72 -0
  17. data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +8 -0
  18. data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +12 -0
  19. data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +22 -0
  20. data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +23 -0
  21. data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +8 -0
  22. data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +12 -0
  23. data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +66 -0
  24. data/rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb +13 -0
  25. data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +7 -0
  26. data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +9 -0
  27. data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +18 -0
  28. data/rails_generators/shoulda_scaffold/templates/haml/layout.html.haml +15 -0
  29. data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +7 -0
  30. data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +10 -0
  31. data/rails_generators/shoulda_scaffold/templates/helper.rb +2 -0
  32. data/shoulda_generator.gemspec +32 -0
  33. metadata +97 -0
data/Manifest ADDED
@@ -0,0 +1,32 @@
1
+ rails_generators/shoulda_model/shoulda_model_generator.rb
2
+ rails_generators/shoulda_model/templates/factory.rb
3
+ rails_generators/shoulda_model/templates/fixtures.yml
4
+ rails_generators/shoulda_model/templates/migration.rb
5
+ rails_generators/shoulda_model/templates/model.rb
6
+ rails_generators/shoulda_model/templates/unit_test.rb
7
+ rails_generators/shoulda_model/USAGE
8
+ rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
9
+ rails_generators/shoulda_scaffold/templates/blueprint/ie.css
10
+ rails_generators/shoulda_scaffold/templates/blueprint/print.css
11
+ rails_generators/shoulda_scaffold/templates/blueprint/screen.css
12
+ rails_generators/shoulda_scaffold/templates/controller.rb
13
+ rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
14
+ rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
15
+ rails_generators/shoulda_scaffold/templates/erb/index.html.erb
16
+ rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
17
+ rails_generators/shoulda_scaffold/templates/erb/new.html.erb
18
+ rails_generators/shoulda_scaffold/templates/erb/show.html.erb
19
+ rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
20
+ rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
21
+ rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
22
+ rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
23
+ rails_generators/shoulda_scaffold/templates/haml/index.html.haml
24
+ rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
25
+ rails_generators/shoulda_scaffold/templates/haml/new.html.haml
26
+ rails_generators/shoulda_scaffold/templates/haml/show.html.haml
27
+ rails_generators/shoulda_scaffold/templates/helper.rb
28
+ rails_generators/shoulda_scaffold/USAGE
29
+ Rakefile
30
+ README.markdown
31
+ shoulda_generator.gemspec
32
+ Manifest
data/README.markdown ADDED
@@ -0,0 +1,81 @@
1
+ # shoulda generators
2
+
3
+ One night at a Boston Ruby hackfest, I finally got sick of using the Rails default generators, and have to hack them to meet my needs and tastes. This includes:
4
+
5
+ * [shoulda](http://thoughtbot.com/projects/shoulda)
6
+ * [factory_girl](http://github.com/thoughtbot/factory_girl)
7
+ * [haml](http://haml.hamptoncatlin.com/)
8
+ * [blueprint](http://code.google.com/p/blueprintcss/)
9
+
10
+
11
+ The next morning, I was struck awake at 5am with the inspiration to start implementing it.
12
+
13
+ ## what you get
14
+
15
+ ### shoulda\_model
16
+
17
+ * works the same as the 'model' generator
18
+ * a new model
19
+ * a migration for the model
20
+ * a factory using [factory_girl](http://github.com/thoughtbot/factory_girl)
21
+ * a [shoulda](http://thoughtbot.com/projects/shoulda) unit test with a few simple 'should's
22
+
23
+ #### Prereqs:
24
+
25
+ * [shoulda](http://thoughtbot.com/projects/shoulda) installed as a plugin
26
+ * [factory_girl](http://github.com/thoughtbot/factory_girl) gem installed
27
+
28
+ In `test/test_helper.rb`, include this:
29
+
30
+ require 'factory_girl'
31
+ Dir[File.join(RAILS_ROOT, 'test', 'factories', '*')].each do |file|
32
+ require file
33
+ end
34
+
35
+ ### shoulda\_haml\_scaffold
36
+
37
+ * everything included in shoulda_model
38
+ * a controller (sans unnecessary comments)
39
+ * templates built written in [haml](http://haml.hamptoncatlin.com/)
40
+ * a layout written in [haml](http://haml.hamptoncatlin.com/) and styled with [blueprint](http://code.google.com/p/blueprintcss/)
41
+ * a helper
42
+ * a shoulda functional test which uses the factory_girl factory
43
+
44
+ Prereqs:
45
+
46
+ * [shoulda](http://thoughtbot.com/projects/shoulda) installed as a plugin
47
+ * [factory_girl](http://github.com/thoughtbot/factory_girl) gem installed
48
+ * [haml](http://haml.hamptoncatlin.com/) gem installed on the system, and the project has been hamlified using `haml --rails` on the project
49
+ * the code snippet above for `test/test_helper.rb`
50
+
51
+ ## getting it
52
+
53
+ You can install it as a plugin for the time being. I plan on having a gem soon enough.
54
+
55
+ With Rails 2.1, you can do:
56
+
57
+ $ script/plugin install git://github.com/technicalpickles/shoulda-generators.git
58
+
59
+ ... or better yet, use piston 1.9.x...
60
+
61
+ $ piston install git://github.com/technicalpickles/shoulda-generators.git vendor/plugins/shoulda-generators
62
+
63
+ ## using it
64
+
65
+ Usage is the same as the default Rails generators.
66
+
67
+ $ script/generate shoulda_model post title:string body:text published:boolean
68
+ $ script/generate shoulda_scaffold post title:string body:text published:boolean
69
+
70
+ ## developing it
71
+
72
+ Make a checkout somewhere:
73
+
74
+ $ git clone git://github.com/technicalpickles/shoulda-generators.git
75
+
76
+ Add symlinks so that Rails will pickup the generators from your checkout:
77
+
78
+ $ mkdir -p ~/.rails/generators
79
+ $ ln -s shoulda-generators/*_generator ~/.rails/generators
80
+
81
+ Send pull requests to me, and I'll take a look at them.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'rake'
2
+ require 'echoe'
3
+
4
+ Echoe.new('shoulda_generator') do |p|
5
+ p.author = 'Josh Nichols'
6
+ p.email = 'josh@technicalpickles.com'
7
+ p.summary = 'Generators which create tests using shoulda'
8
+ p.url = 'http://github.com/technicalpickles/shoulda_generator'
9
+ p.version = '0.1.0'
10
+ end
@@ -0,0 +1,27 @@
1
+ Description:
2
+ Stubs out a new model. Pass the model name, either CamelCased or
3
+ under_scored, and an optional list of attribute pairs as arguments.
4
+
5
+ Attribute pairs are column_name:sql_type arguments specifying the
6
+ model's attributes. Timestamps are added by default, so you don't have to
7
+ specify them by hand as 'created_at:datetime updated_at:datetime'.
8
+
9
+ You don't have to think up every attribute up front, but it helps to
10
+ sketch out a few so you can start working with the model immediately.
11
+
12
+ This generates a model class in app/models, a unit test in test/unit,
13
+ a test fixture in test/fixtures/singular_name.yml, and a migration in
14
+ db/migrate.
15
+
16
+ Examples:
17
+ `./script/generate shoulda_model account`
18
+
19
+ creates an Account model, test, fixture, and migration:
20
+ Model: app/models/account.rb
21
+ Test: test/unit/account_test.rb
22
+ Factory: test/factories/accounts.rb
23
+ Migration: db/migrate/XXX_add_accounts.rb
24
+
25
+ `./script/generate model post title:string body:text published:boolean`
26
+
27
+ creates a Post model with a string title, text body, and published flag.
@@ -0,0 +1,53 @@
1
+ class ShouldaModelGenerator < Rails::Generator::NamedBase
2
+ default_options :skip_timestamps => false, :skip_migration => false, :skip_factory => false
3
+
4
+ def manifest
5
+ record do |m|
6
+ # Check for class naming collisions.
7
+ m.class_collisions class_path, class_name, "#{class_name}Test"
8
+
9
+ # Model, test, and fixture directories.
10
+ m.directory File.join('app/models', class_path)
11
+ m.directory File.join('test/unit', class_path)
12
+ m.directory File.join('test/factories', class_path)
13
+
14
+ # Model class, unit test, and fixtures.
15
+ m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
16
+ m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
17
+
18
+ unless options[:skip_factory]
19
+ m.template 'factory.rb', File.join('test/factories', class_path, "#{file_name}.rb")
20
+ end
21
+
22
+ unless options[:skip_migration]
23
+ m.migration_template 'migration.rb', 'db/migrate', :assigns => {
24
+ :migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
25
+ }, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
26
+ end
27
+ end
28
+ end
29
+
30
+ def factory_line(attribute)
31
+ unless attribute.name == 'name'
32
+ "#{file_name}.#{attribute.name} '#{attribute.default}'"
33
+ else
34
+ "#{file_name}.add_attribute '#{attribute.name}', '#{attribute.default}'"
35
+ end
36
+ end
37
+
38
+ protected
39
+ def banner
40
+ "Usage: #{$0} #{spec.name} ModelName [field:type, field:type]"
41
+ end
42
+
43
+ def add_options!(opt)
44
+ opt.separator ''
45
+ opt.separator 'Options:'
46
+ opt.on("--skip-timestamps",
47
+ "Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
48
+ opt.on("--skip-migration",
49
+ "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
50
+ opt.on("--skip-fixture",
51
+ "Don't generation a fixture file for this model") { |v| options[:skip_fixture] = v}
52
+ end
53
+ end
@@ -0,0 +1,5 @@
1
+ Factory.define :<%= file_name %> do |<%= file_name %>|
2
+ <% for attribute in attributes -%>
3
+ <%= factory_line(attribute) %>
4
+ <% end -%>
5
+ end
@@ -0,0 +1,19 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ <% unless attributes.empty? -%>
4
+ one:
5
+ <% for attribute in attributes -%>
6
+ <%= attribute.name %>: <%= attribute.default %>
7
+ <% end -%>
8
+
9
+ two:
10
+ <% for attribute in attributes -%>
11
+ <%= attribute.name %>: <%= attribute.default %>
12
+ <% end -%>
13
+ <% else -%>
14
+ # one:
15
+ # column: value
16
+ #
17
+ # two:
18
+ # column: value
19
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ class <%= migration_name %> < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :<%= table_name %> do |t|
4
+ <% for attribute in attributes -%>
5
+ t.<%= attribute.type %> :<%= attribute.name %>
6
+ <% end -%>
7
+ <% unless options[:skip_timestamps] %>
8
+ t.timestamps
9
+ <% end -%>
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :<%= table_name %>
15
+ end
16
+ end
@@ -0,0 +1,2 @@
1
+ class <%= class_name %> < ActiveRecord::Base
2
+ end
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class <%= class_name %>Test < ActiveSupport::TestCase
4
+ <% for attribute in attributes -%>
5
+ should_have_db_column :<%= attribute.name %>
6
+ <% end -%>
7
+ end
@@ -0,0 +1,25 @@
1
+ Description:
2
+ Scaffolds an entire resource, from model and migration to controller and
3
+ views, along with a full test suite. The resource is ready to use as a
4
+ starting point for your restful, resource-oriented application.
5
+
6
+ Pass the name of the model, either CamelCased or under_scored, as the first
7
+ argument, and an optional list of attribute pairs.
8
+
9
+ Attribute pairs are column_name:sql_type arguments specifying the
10
+ model's attributes. Timestamps are added by default, so you don't have to
11
+ specify them by hand as 'created_at:datetime updated_at:datetime'.
12
+
13
+ You don't have to think up every attribute up front, but it helps to
14
+ sketch out a few so you can start working with the resource immediately.
15
+
16
+ For example, `scaffold post title:string body:text published:boolean`
17
+ gives you a model with those three attributes, a controller that handles
18
+ the create/show/update/destroy, forms to create and edit your posts, and
19
+ an index that lists them all, as well as a map.resources :posts
20
+ declaration in config/routes.rb.
21
+
22
+ Examples:
23
+ `./script/generate scaffold post` # no attributes, view will be anemic
24
+ `./script/generate scaffold post title:string body:text published:boolean`
25
+ `./script/generate scaffold purchase order_id:integer amount:decimal`
@@ -0,0 +1,107 @@
1
+ class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
2
+ default_options :skip_timestamps => false, :skip_migration => false, :skip_layout => true, :templating => 'haml', :functional_test_style => 'should_be_restful'
3
+
4
+ attr_reader :controller_name,
5
+ :controller_class_path,
6
+ :controller_file_path,
7
+ :controller_class_nesting,
8
+ :controller_class_nesting_depth,
9
+ :controller_class_name,
10
+ :controller_underscore_name,
11
+ :controller_singular_name,
12
+ :controller_plural_name
13
+ alias_method :controller_file_name, :controller_underscore_name
14
+ alias_method :controller_table_name, :controller_plural_name
15
+
16
+ def initialize(runtime_args, runtime_options = {})
17
+ super
18
+
19
+ @controller_name = @name.pluralize
20
+
21
+ base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
22
+ @controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
23
+ @controller_singular_name=base_name.singularize
24
+ if @controller_class_nesting.empty?
25
+ @controller_class_name = @controller_class_name_without_nesting
26
+ else
27
+ @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
28
+ end
29
+ end
30
+
31
+ def manifest
32
+ record do |m|
33
+ # Check for class naming collisions.
34
+ m.class_collisions(controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}Helper")
35
+ m.class_collisions(class_path, "#{class_name}")
36
+
37
+ # Controller, helper, views, and test directories.
38
+ m.directory(File.join('app/models', class_path))
39
+ m.directory(File.join('app/controllers', controller_class_path))
40
+ m.directory(File.join('app/helpers', controller_class_path))
41
+ m.directory(File.join('app/views', controller_class_path, controller_file_name))
42
+ m.directory(File.join('app/views/layouts', controller_class_path))
43
+ m.directory(File.join('test/functional', controller_class_path))
44
+ m.directory(File.join('test/unit', class_path))
45
+
46
+ m.directory('public/stylesheets/blueprint')
47
+
48
+ for view in scaffold_views
49
+ m.template(
50
+ "#{templating}/#{view}.html.#{templating}",
51
+ File.join('app/views', controller_class_path, controller_file_name, "#{view}.html.#{templating}")
52
+ )
53
+ end
54
+
55
+ # Layout and stylesheet.
56
+ m.template("#{templating}/layout.html.#{templating}", File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.#{templating}"))
57
+
58
+ %w(print screen ie).each do |stylesheet|
59
+ m.template("blueprint/#{stylesheet}.css", "public/stylesheets/blueprint/#{stylesheet}.css")
60
+ end
61
+
62
+ m.template(
63
+ 'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
64
+ )
65
+
66
+ m.template("functional_test/#{functional_test_style}.rb", File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
67
+ m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
68
+
69
+ m.route_resources controller_file_name
70
+
71
+ m.dependency 'shoulda_model', [name] + @args, :collision => :skip
72
+ end
73
+ end
74
+
75
+ def templating
76
+ options[:templating]
77
+ end
78
+
79
+ def functional_test_style
80
+ options[:functional_test_style]
81
+ end
82
+
83
+ protected
84
+ # Override with your own usage banner.
85
+ def banner
86
+ "Usage: #{$0} scaffold ModelName [field:type, field:type]"
87
+ end
88
+
89
+ def add_options!(opt)
90
+ opt.separator ''
91
+ opt.separator 'Options:'
92
+ opt.on("--skip-timestamps",
93
+ "Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
94
+ opt.on("--skip-migration",
95
+ "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
96
+ opt.on("--templating [erb|haml]", "Specify the templating to use (haml by default)") { |v| options[:templating] = v }
97
+ opt.on("--functional-test-style [basic|should_be_restful]", "Specify the style of the functional test (should_be_restful by default)") { |v| options[:functional_test_style] = v }
98
+ end
99
+
100
+ def scaffold_views
101
+ %w[ index show new edit _form ]
102
+ end
103
+
104
+ def model_name
105
+ class_name.demodulize
106
+ end
107
+ end
@@ -0,0 +1,22 @@
1
+ /* -----------------------------------------------------------------------
2
+
3
+ Blueprint CSS Framework 0.7.1
4
+ http://blueprintcss.googlecode.com
5
+
6
+ * Copyright (c) 2007-2008. See LICENSE for more info.
7
+ * See README for instructions on how to use Blueprint.
8
+ * For credits and origins, see AUTHORS.
9
+ * This is a compressed file. See the sources in the 'src' directory.
10
+
11
+ ----------------------------------------------------------------------- */
12
+
13
+ /* ie.css */
14
+ body {text-align:center;}
15
+ .container {text-align:left;}
16
+ * html .column {overflow-x:hidden;}
17
+ * html legend {margin:-18px -8px 16px 0;padding:0;}
18
+ ol {margin-left:2em;}
19
+ sup {vertical-align:text-top;}
20
+ sub {vertical-align:text-bottom;}
21
+ html>body p code {*white-space:normal;}
22
+ hr {margin:-8px auto 11px;}
@@ -0,0 +1,29 @@
1
+ /* -----------------------------------------------------------------------
2
+
3
+ Blueprint CSS Framework 0.7.1
4
+ http://blueprintcss.googlecode.com
5
+
6
+ * Copyright (c) 2007-2008. See LICENSE for more info.
7
+ * See README for instructions on how to use Blueprint.
8
+ * For credits and origins, see AUTHORS.
9
+ * This is a compressed file. See the sources in the 'src' directory.
10
+
11
+ ----------------------------------------------------------------------- */
12
+
13
+ /* print.css */
14
+ body {line-height:1.5;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;color:#000;background:none;font-size:10pt;}
15
+ .container {background:none;}
16
+ hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
17
+ hr.space {background:#fff;color:#fff;}
18
+ h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
19
+ code {font:.9em "Courier New", Monaco, Courier, monospace;}
20
+ img {float:left;margin:1.5em 1.5em 1.5em 0;}
21
+ a img {border:none;}
22
+ p img.top {margin-top:0;}
23
+ blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
24
+ .small {font-size:.9em;}
25
+ .large {font-size:1.1em;}
26
+ .quiet {color:#999;}
27
+ .hide {display:none;}
28
+ a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
29
+ a:link:after, a:visited:after {content:" (" attr(href) ") ";font-size:90%;}
@@ -0,0 +1,226 @@
1
+ /* -----------------------------------------------------------------------
2
+
3
+ Blueprint CSS Framework 0.7.1
4
+ http://blueprintcss.googlecode.com
5
+
6
+ * Copyright (c) 2007-2008. See LICENSE for more info.
7
+ * See README for instructions on how to use Blueprint.
8
+ * For credits and origins, see AUTHORS.
9
+ * This is a compressed file. See the sources in the 'src' directory.
10
+
11
+ ----------------------------------------------------------------------- */
12
+
13
+ /* reset.css */
14
+ html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
15
+ body {line-height:1.5;}
16
+ table {border-collapse:separate;border-spacing:0;}
17
+ caption, th, td {text-align:left;font-weight:normal;}
18
+ table, td, th {vertical-align:middle;}
19
+ blockquote:before, blockquote:after, q:before, q:after {content:"";}
20
+ blockquote, q {quotes:"" "";}
21
+ a img {border:none;}
22
+
23
+ /* typography.css */
24
+ body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;}
25
+ h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
26
+ h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
27
+ h2 {font-size:2em;margin-bottom:0.75em;}
28
+ h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
29
+ h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;height:1.25em;}
30
+ h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
31
+ h6 {font-size:1em;font-weight:bold;}
32
+ h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
33
+ p {margin:0 0 1.5em;}
34
+ p img {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
35
+ p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
36
+ a:focus, a:hover {color:#000;}
37
+ a {color:#009;text-decoration:underline;}
38
+ blockquote {margin:1.5em;color:#666;font-style:italic;}
39
+ strong {font-weight:bold;}
40
+ em, dfn {font-style:italic;}
41
+ dfn {font-weight:bold;}
42
+ sup, sub {line-height:0;}
43
+ abbr, acronym {border-bottom:1px dotted #666;}
44
+ address {margin:0 0 1.5em;font-style:italic;}
45
+ del {color:#666;}
46
+ pre, code {margin:1.5em 0;white-space:pre;}
47
+ pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
48
+ li ul, li ol {margin:0 1.5em;}
49
+ ul, ol {margin:0 1.5em 1.5em 1.5em;}
50
+ ul {list-style-type:disc;}
51
+ ol {list-style-type:decimal;}
52
+ dl {margin:0 0 1.5em 0;}
53
+ dl dt {font-weight:bold;}
54
+ dd {margin-left:1.5em;}
55
+ table {margin-bottom:1.4em;width:100%;}
56
+ th {font-weight:bold;background:#C3D9FF;}
57
+ th, td {padding:4px 10px 4px 5px;}
58
+ tr.even td {background:#E5ECF9;}
59
+ tfoot {font-style:italic;}
60
+ caption {background:#eee;}
61
+ .small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
62
+ .large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
63
+ .hide {display:none;}
64
+ .quiet {color:#666;}
65
+ .loud {color:#000;}
66
+ .highlight {background:#ff0;}
67
+ .added {background:#060;color:#fff;}
68
+ .removed {background:#900;color:#fff;}
69
+ .first {margin-left:0;padding-left:0;}
70
+ .last {margin-right:0;padding-right:0;}
71
+ .top {margin-top:0;padding-top:0;}
72
+ .bottom {margin-bottom:0;padding-bottom:0;}
73
+
74
+ /* grid.css */
75
+ .container {width:950px;margin:0 auto;}
76
+ .showgrid {background:url(src/grid.png);}
77
+ body {margin:1.5em 0;}
78
+ div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
79
+ div.last {margin-right:0;}
80
+ .span-1 {width:30px;}
81
+ .span-2 {width:70px;}
82
+ .span-3 {width:110px;}
83
+ .span-4 {width:150px;}
84
+ .span-5 {width:190px;}
85
+ .span-6 {width:230px;}
86
+ .span-7 {width:270px;}
87
+ .span-8 {width:310px;}
88
+ .span-9 {width:350px;}
89
+ .span-10 {width:390px;}
90
+ .span-11 {width:430px;}
91
+ .span-12 {width:470px;}
92
+ .span-13 {width:510px;}
93
+ .span-14 {width:550px;}
94
+ .span-15 {width:590px;}
95
+ .span-16 {width:630px;}
96
+ .span-17 {width:670px;}
97
+ .span-18 {width:710px;}
98
+ .span-19 {width:750px;}
99
+ .span-20 {width:790px;}
100
+ .span-21 {width:830px;}
101
+ .span-22 {width:870px;}
102
+ .span-23 {width:910px;}
103
+ .span-24, div.span-24 {width:950px;margin:0;}
104
+ .append-1 {padding-right:40px;}
105
+ .append-2 {padding-right:80px;}
106
+ .append-3 {padding-right:120px;}
107
+ .append-4 {padding-right:160px;}
108
+ .append-5 {padding-right:200px;}
109
+ .append-6 {padding-right:240px;}
110
+ .append-7 {padding-right:280px;}
111
+ .append-8 {padding-right:320px;}
112
+ .append-9 {padding-right:360px;}
113
+ .append-10 {padding-right:400px;}
114
+ .append-11 {padding-right:440px;}
115
+ .append-12 {padding-right:480px;}
116
+ .append-13 {padding-right:520px;}
117
+ .append-14 {padding-right:560px;}
118
+ .append-15 {padding-right:600px;}
119
+ .append-16 {padding-right:640px;}
120
+ .append-17 {padding-right:680px;}
121
+ .append-18 {padding-right:720px;}
122
+ .append-19 {padding-right:760px;}
123
+ .append-20 {padding-right:800px;}
124
+ .append-21 {padding-right:840px;}
125
+ .append-22 {padding-right:880px;}
126
+ .append-23 {padding-right:920px;}
127
+ .prepend-1 {padding-left:40px;}
128
+ .prepend-2 {padding-left:80px;}
129
+ .prepend-3 {padding-left:120px;}
130
+ .prepend-4 {padding-left:160px;}
131
+ .prepend-5 {padding-left:200px;}
132
+ .prepend-6 {padding-left:240px;}
133
+ .prepend-7 {padding-left:280px;}
134
+ .prepend-8 {padding-left:320px;}
135
+ .prepend-9 {padding-left:360px;}
136
+ .prepend-10 {padding-left:400px;}
137
+ .prepend-11 {padding-left:440px;}
138
+ .prepend-12 {padding-left:480px;}
139
+ .prepend-13 {padding-left:520px;}
140
+ .prepend-14 {padding-left:560px;}
141
+ .prepend-15 {padding-left:600px;}
142
+ .prepend-16 {padding-left:640px;}
143
+ .prepend-17 {padding-left:680px;}
144
+ .prepend-18 {padding-left:720px;}
145
+ .prepend-19 {padding-left:760px;}
146
+ .prepend-20 {padding-left:800px;}
147
+ .prepend-21 {padding-left:840px;}
148
+ .prepend-22 {padding-left:880px;}
149
+ .prepend-23 {padding-left:920px;}
150
+ div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
151
+ div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
152
+ .pull-1 {margin-left:-40px;}
153
+ .pull-2 {margin-left:-80px;}
154
+ .pull-3 {margin-left:-120px;}
155
+ .pull-4 {margin-left:-160px;}
156
+ .pull-5 {margin-left:-200px;}
157
+ .pull-6 {margin-left:-240px;}
158
+ .pull-7 {margin-left:-280px;}
159
+ .pull-8 {margin-left:-320px;}
160
+ .pull-9 {margin-left:-360px;}
161
+ .pull-10 {margin-left:-400px;}
162
+ .pull-11 {margin-left:-440px;}
163
+ .pull-12 {margin-left:-480px;}
164
+ .pull-13 {margin-left:-520px;}
165
+ .pull-14 {margin-left:-560px;}
166
+ .pull-15 {margin-left:-600px;}
167
+ .pull-16 {margin-left:-640px;}
168
+ .pull-17 {margin-left:-680px;}
169
+ .pull-18 {margin-left:-720px;}
170
+ .pull-19 {margin-left:-760px;}
171
+ .pull-20 {margin-left:-800px;}
172
+ .pull-21 {margin-left:-840px;}
173
+ .pull-22 {margin-left:-880px;}
174
+ .pull-23 {margin-left:-920px;}
175
+ .pull-24 {margin-left:-960px;}
176
+ .pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
177
+ .push-1 {margin:0 -40px 1.5em 40px;}
178
+ .push-2 {margin:0 -80px 1.5em 80px;}
179
+ .push-3 {margin:0 -120px 1.5em 120px;}
180
+ .push-4 {margin:0 -160px 1.5em 160px;}
181
+ .push-5 {margin:0 -200px 1.5em 200px;}
182
+ .push-6 {margin:0 -240px 1.5em 240px;}
183
+ .push-7 {margin:0 -280px 1.5em 280px;}
184
+ .push-8 {margin:0 -320px 1.5em 320px;}
185
+ .push-9 {margin:0 -360px 1.5em 360px;}
186
+ .push-10 {margin:0 -400px 1.5em 400px;}
187
+ .push-11 {margin:0 -440px 1.5em 440px;}
188
+ .push-12 {margin:0 -480px 1.5em 480px;}
189
+ .push-13 {margin:0 -520px 1.5em 520px;}
190
+ .push-14 {margin:0 -560px 1.5em 560px;}
191
+ .push-15 {margin:0 -600px 1.5em 600px;}
192
+ .push-16 {margin:0 -640px 1.5em 640px;}
193
+ .push-17 {margin:0 -680px 1.5em 680px;}
194
+ .push-18 {margin:0 -720px 1.5em 720px;}
195
+ .push-19 {margin:0 -760px 1.5em 760px;}
196
+ .push-20 {margin:0 -800px 1.5em 800px;}
197
+ .push-21 {margin:0 -840px 1.5em 840px;}
198
+ .push-22 {margin:0 -880px 1.5em 880px;}
199
+ .push-23 {margin:0 -920px 1.5em 920px;}
200
+ .push-24 {margin:0 -960px 1.5em 960px;}
201
+ .push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
202
+ .box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
203
+ hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
204
+ hr.space {background:#fff;color:#fff;}
205
+ .clearfix:after, .container:after {content:".";display:block;height:0;clear:both;visibility:hidden;}
206
+ .clearfix, .container {display:inline-block;}
207
+ * html .clearfix, * html .container {height:1%;}
208
+ .clearfix, .container {display:block;}
209
+ .clear {clear:both;}
210
+
211
+ /* forms.css */
212
+ label {font-weight:bold;}
213
+ fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
214
+ legend {font-weight:bold;font-size:1.2em;}
215
+ input.text, input.title, textarea, select {margin:0.5em 0;border:1px solid #bbb;}
216
+ input.text:focus, input.title:focus, textarea:focus, select:focus {border:1px solid #666;}
217
+ input.text, input.title {width:300px;padding:5px;}
218
+ input.title {font-size:1.5em;}
219
+ textarea {width:390px;height:250px;padding:5px;}
220
+ .error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
221
+ .error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
222
+ .notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
223
+ .success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
224
+ .error a {color:#8a1f11;}
225
+ .notice a {color:#514721;}
226
+ .success a {color:#264409;}
@@ -0,0 +1,72 @@
1
+ class <%= controller_class_name %>Controller < ApplicationController
2
+ def index
3
+ @<%= table_name %> = <%= class_name %>.find(:all)
4
+
5
+ respond_to do |format|
6
+ format.html
7
+ format.xml { render :xml => @<%= table_name %> }
8
+ end
9
+ end
10
+
11
+ def show
12
+ @<%= file_name %> = <%= class_name %>.find(params[:id])
13
+
14
+ respond_to do |format|
15
+ format.html
16
+ format.xml { render :xml => @<%= file_name %> }
17
+ end
18
+ end
19
+
20
+ def new
21
+ @<%= file_name %> = <%= class_name %>.new
22
+
23
+ respond_to do |format|
24
+ format.html
25
+ format.xml { render :xml => @<%= file_name %> }
26
+ end
27
+ end
28
+
29
+ def edit
30
+ @<%= file_name %> = <%= class_name %>.find(params[:id])
31
+ end
32
+
33
+ def create
34
+ @<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
35
+
36
+ respond_to do |format|
37
+ if @<%= file_name %>.save
38
+ flash[:notice] = '<%= class_name %> was successfully created.'
39
+ format.html { redirect_to(@<%= file_name %>) }
40
+ format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
41
+ else
42
+ format.html { render :action => "new" }
43
+ format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
44
+ end
45
+ end
46
+ end
47
+
48
+ def update
49
+ @<%= file_name %> = <%= class_name %>.find(params[:id])
50
+
51
+ respond_to do |format|
52
+ if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
53
+ flash[:notice] = '<%= class_name %> was successfully updated.'
54
+ format.html { redirect_to(@<%= file_name %>) }
55
+ format.xml { head :ok }
56
+ else
57
+ format.html { render :action => "edit" }
58
+ format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
59
+ end
60
+ end
61
+ end
62
+
63
+ def destroy
64
+ @<%= file_name %> = <%= class_name %>.find(params[:id])
65
+ @<%= file_name %>.destroy
66
+
67
+ respond_to do |format|
68
+ format.html { redirect_to(<%= table_name %>_url) }
69
+ format.xml { head :ok }
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,8 @@
1
+ <%%= form.error_messages %>
2
+
3
+ <dl>
4
+ <% for attribute in attributes -%>
5
+ <dt><%%= form.label :<%= attribute.name %> %></dt>
6
+ <dd><%%= form.<%= attribute.field_type %> :<%= attribute.name %> %></dd>
7
+ <% end -%>
8
+ </dl>
@@ -0,0 +1,12 @@
1
+ <h1>Editing <%= singular_name %></h1>
2
+
3
+ <%% form_for(@<%= singular_name %>) do |form| %>
4
+ <%%= render :partial => 'form', :locals => {:form => form} %>
5
+ <p><%%= form.submit 'Update' %></p>
6
+ <%% end %>
7
+
8
+ <p>
9
+ <%%= link_to 'Show', @<%= singular_name %> %>
10
+ |
11
+ <%%= link_to 'Back', <%= plural_name %>_path %>
12
+ </p>
@@ -0,0 +1,22 @@
1
+ <h1> Listing <%= plural_name %></h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <% for attribute in attributes -%>
6
+ <th><%= attribute.column.human_name %></th>
7
+ <% end -%>
8
+ </tr>
9
+
10
+ <%% for <%= singular_name %> in @<%= plural_name %> %>
11
+ <tr>
12
+ <% for attribute in attributes -%>
13
+ <td><%%= h <%= singular_name %>.<%= attribute.name %> %></td>
14
+ <% end -%>
15
+ <td><%%= link_to 'Show', <%= singular_name %> %></td>
16
+ <td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
17
+ <td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
18
+ </tr>
19
+ <%% end %>
20
+ </table>
21
+
22
+ <p><%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %></p>
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <title><%%= "#{controller.controller_name}: #{controller.action_name}" %></title>
5
+ <%%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
6
+ <%%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
7
+ <%%= "<!--[if IE]>#{stylesheet_link_tag 'blueprint/ie', :media => 'screen'}<![endif]-->" %>
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+
12
+ <div id="content" class="column span-24">
13
+ <%% flash.each do |key, value| -%>
14
+ <div class="<%%= key %>">
15
+ <%%= h(value) %>
16
+ </div>
17
+ <%% end %>
18
+
19
+ <%%= yield %>
20
+ </div>
21
+ </div>
22
+ </body>
23
+ </html>
@@ -0,0 +1,8 @@
1
+ <h1>New <%= singular_name %></h1>
2
+
3
+ <%% form_for(@<%= singular_name %>) do |form| %>
4
+ <%%= render :partial => 'form', :locals => {:form => form} %>
5
+ <p><%%= form.submit 'Create' %></p>
6
+ <%% end %>
7
+
8
+ <p><%%= link_to 'Back', <%= plural_name %>_path %></p>
@@ -0,0 +1,12 @@
1
+ <dl>
2
+ <% for attribute in attributes -%>
3
+ <dt><%= attribute.column.human_name %></dt>
4
+ <dd><%%= h @<%= singular_name %>.<%= attribute.name %> %></dd>
5
+ <% end -%>
6
+ </dl>
7
+
8
+ <p>
9
+ <%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>)%>
10
+ |
11
+ <%%= link_to 'Back', <%= plural_name %>_path %>
12
+ </p>
@@ -0,0 +1,66 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
4
+ context 'GET to index' do
5
+ setup do
6
+ get :index
7
+ end
8
+ should_respond_with :success
9
+ should_assign_to :<%= table_name %>
10
+ end
11
+
12
+ context 'GET to new' do
13
+ setup do
14
+ get :new
15
+ end
16
+
17
+ should_respond_with :success
18
+ should_render_template :new
19
+ should_assign_to :<%= file_name %>
20
+ end
21
+
22
+ context 'POST to create' do
23
+ setup do
24
+ post :create, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
25
+ @<%= file_name %> = <%= class_name %>.find(:all).last
26
+ end
27
+
28
+ should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
29
+ end
30
+
31
+ context 'GET to show' do
32
+ setup do
33
+ @<%= file_name %> = Factory(:<%= file_name %>)
34
+ get :show, :id => @<%= file_name %>.id
35
+ end
36
+ should_respond_with :success
37
+ should_render_template :show
38
+ should_assign_to :<%= file_name %>
39
+ end
40
+
41
+ context 'GET to edit' do
42
+ setup do
43
+ @<%= file_name %> = Factory(:<%= file_name %>)
44
+ get :edit, :id => @<%= file_name %>.id
45
+ end
46
+ should_respond_with :success
47
+ should_render_template :edit
48
+ should_assign_to :<%= file_name %>
49
+ end
50
+
51
+ context 'PUT to update' do
52
+ setup do
53
+ @<%= file_name %> = Factory(:<%= file_name %>)
54
+ put :update, :id => @<%= file_name %>.id, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
55
+ end
56
+ should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
57
+ end
58
+
59
+ context 'DELETE to destroy' do
60
+ setup do
61
+ @<%= file_name %> = Factory(:<%= file_name %>)
62
+ delete :destroy, :id => @<%= file_name %>.id
63
+ end
64
+ should_redirect_to '<%= table_name %>_path'
65
+ end
66
+ end
@@ -0,0 +1,13 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class <%= controller_class_name %>ControllerTest < ActionController::TestCase
4
+
5
+ def setup
6
+ @<%= file_name %> = Factory(:event)
7
+ end
8
+
9
+ should_be_restful do |resource|
10
+ resource.formats = [:html, :xml]
11
+ resource.destroy.flash = nil
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ = form.error_messages
2
+
3
+ %dl
4
+ <% for attribute in attributes -%>
5
+ %dt= form.label :<%= attribute.name %>
6
+ %dd= form.<%= attribute.field_type %> :<%= attribute.name %>
7
+ <% end -%>
@@ -0,0 +1,9 @@
1
+ %h1 Editing <%= singular_name %>
2
+
3
+ - form_for(@<%= singular_name %>) do |form|
4
+ = render :partial => 'form', :locals => {:form => form}
5
+ %p= form.submit 'Update'
6
+
7
+ %p
8
+ = link_to 'Show', @<%= singular_name %>
9
+ = link_to 'Back', <%= plural_name %>_path
@@ -0,0 +1,18 @@
1
+ %h1 Listing <%= plural_name %>
2
+
3
+ %table
4
+ %tr
5
+ <% for attribute in attributes -%>
6
+ %th <%= attribute.column.human_name %>
7
+ <% end -%>
8
+
9
+ - for <%= singular_name %> in @<%= plural_name %>
10
+ %tr
11
+ <% for attribute in attributes -%>
12
+ %td= h <%= singular_name %>.<%= attribute.name %>
13
+ <% end -%>
14
+ %td= link_to 'Show', <%= singular_name %>
15
+ %td= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>)
16
+ %td= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
17
+
18
+ %p= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path
@@ -0,0 +1,15 @@
1
+ !!! Transitional
2
+ %html
3
+ %head
4
+ %title= "#{controller.controller_name}: #{controller.action_name}"
5
+ = stylesheet_link_tag 'blueprint/screen', :media => 'screen'
6
+ = stylesheet_link_tag 'blueprint/print', :media => 'print'
7
+ = "<!--[if IE]>#{stylesheet_link_tag 'blueprint/ie', :media => 'screen'}<![endif]-->"
8
+ %body
9
+ .container
10
+
11
+ #content{:class => 'column span-24'}
12
+ - flash.each do |key, value|
13
+ %div{:class => key}= h(value)
14
+
15
+ = yield
@@ -0,0 +1,7 @@
1
+ %h1 New <%= singular_name %>
2
+
3
+ - form_for(@<%= singular_name %>) do |form|
4
+ = render :partial => 'form', :locals => {:form => form}
5
+ %p= form.submit "Create"
6
+
7
+ %p= link_to 'Back', <%= plural_name %>_path
@@ -0,0 +1,10 @@
1
+ %dl
2
+ <% for attribute in attributes -%>
3
+ %dt <%= attribute.column.human_name %>
4
+ %dd= h @<%= singular_name %>.<%= attribute.name %>
5
+ <% end -%>
6
+
7
+ %p
8
+ = link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>)
9
+ |
10
+ = link_to 'Back', <%= plural_name %>_path
@@ -0,0 +1,2 @@
1
+ module <%= controller_class_name %>Helper
2
+ end
@@ -0,0 +1,32 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{shoulda_generator}
3
+ s.version = "0.1.0"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Josh Nichols"]
7
+ s.date = %q{2008-07-02}
8
+ s.description = %q{Generators which create tests using shoulda}
9
+ s.email = %q{josh@technicalpickles.com}
10
+ s.extra_rdoc_files = ["README.markdown"]
11
+ s.files = ["rails_generators/shoulda_model/shoulda_model_generator.rb", "rails_generators/shoulda_model/templates/factory.rb", "rails_generators/shoulda_model/templates/fixtures.yml", "rails_generators/shoulda_model/templates/migration.rb", "rails_generators/shoulda_model/templates/model.rb", "rails_generators/shoulda_model/templates/unit_test.rb", "rails_generators/shoulda_model/USAGE", "rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb", "rails_generators/shoulda_scaffold/templates/blueprint/ie.css", "rails_generators/shoulda_scaffold/templates/blueprint/print.css", "rails_generators/shoulda_scaffold/templates/blueprint/screen.css", "rails_generators/shoulda_scaffold/templates/controller.rb", "rails_generators/shoulda_scaffold/templates/erb/_form.html.erb", "rails_generators/shoulda_scaffold/templates/erb/edit.html.erb", "rails_generators/shoulda_scaffold/templates/erb/index.html.erb", "rails_generators/shoulda_scaffold/templates/erb/layout.html.erb", "rails_generators/shoulda_scaffold/templates/erb/new.html.erb", "rails_generators/shoulda_scaffold/templates/erb/show.html.erb", "rails_generators/shoulda_scaffold/templates/functional_test/basic.rb", "rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb", "rails_generators/shoulda_scaffold/templates/haml/_form.html.haml", "rails_generators/shoulda_scaffold/templates/haml/edit.html.haml", "rails_generators/shoulda_scaffold/templates/haml/index.html.haml", "rails_generators/shoulda_scaffold/templates/haml/layout.html.haml", "rails_generators/shoulda_scaffold/templates/haml/new.html.haml", "rails_generators/shoulda_scaffold/templates/haml/show.html.haml", "rails_generators/shoulda_scaffold/templates/helper.rb", "rails_generators/shoulda_scaffold/USAGE", "Rakefile", "README.markdown", "shoulda_generator.gemspec", "Manifest"]
12
+ s.has_rdoc = true
13
+ s.homepage = %q{http://github.com/technicalpickles/shoulda_generator}
14
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Shoulda_generator", "--main", "README.markdown"]
15
+ s.require_paths = ["lib"]
16
+ s.rubyforge_project = %q{shoulda_generator}
17
+ s.rubygems_version = %q{1.2.0}
18
+ s.summary = %q{Generators which create tests using shoulda}
19
+
20
+ if s.respond_to? :specification_version then
21
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ s.specification_version = 2
23
+
24
+ if current_version >= 3 then
25
+ s.add_development_dependency(%q<echoe>, [">= 0"])
26
+ else
27
+ s.add_dependency(%q<echoe>, [">= 0"])
28
+ end
29
+ else
30
+ s.add_dependency(%q<echoe>, [">= 0"])
31
+ end
32
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: technicalpickles-shoulda_generator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Josh Nichols
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-07-02 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: echoe
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: Generators which create tests using shoulda
25
+ email: josh@technicalpickles.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README.markdown
32
+ files:
33
+ - rails_generators/shoulda_model/shoulda_model_generator.rb
34
+ - rails_generators/shoulda_model/templates/factory.rb
35
+ - rails_generators/shoulda_model/templates/fixtures.yml
36
+ - rails_generators/shoulda_model/templates/migration.rb
37
+ - rails_generators/shoulda_model/templates/model.rb
38
+ - rails_generators/shoulda_model/templates/unit_test.rb
39
+ - rails_generators/shoulda_model/USAGE
40
+ - rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
41
+ - rails_generators/shoulda_scaffold/templates/blueprint/ie.css
42
+ - rails_generators/shoulda_scaffold/templates/blueprint/print.css
43
+ - rails_generators/shoulda_scaffold/templates/blueprint/screen.css
44
+ - rails_generators/shoulda_scaffold/templates/controller.rb
45
+ - rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
46
+ - rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
47
+ - rails_generators/shoulda_scaffold/templates/erb/index.html.erb
48
+ - rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
49
+ - rails_generators/shoulda_scaffold/templates/erb/new.html.erb
50
+ - rails_generators/shoulda_scaffold/templates/erb/show.html.erb
51
+ - rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
52
+ - rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
53
+ - rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
54
+ - rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
55
+ - rails_generators/shoulda_scaffold/templates/haml/index.html.haml
56
+ - rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
57
+ - rails_generators/shoulda_scaffold/templates/haml/new.html.haml
58
+ - rails_generators/shoulda_scaffold/templates/haml/show.html.haml
59
+ - rails_generators/shoulda_scaffold/templates/helper.rb
60
+ - rails_generators/shoulda_scaffold/USAGE
61
+ - Rakefile
62
+ - README.markdown
63
+ - shoulda_generator.gemspec
64
+ - Manifest
65
+ has_rdoc: true
66
+ homepage: http://github.com/technicalpickles/shoulda_generator
67
+ post_install_message:
68
+ rdoc_options:
69
+ - --line-numbers
70
+ - --inline-source
71
+ - --title
72
+ - Shoulda_generator
73
+ - --main
74
+ - README.markdown
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
82
+ version:
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "="
86
+ - !ruby/object:Gem::Version
87
+ version: "1.2"
88
+ version:
89
+ requirements: []
90
+
91
+ rubyforge_project: shoulda_generator
92
+ rubygems_version: 1.2.0
93
+ signing_key:
94
+ specification_version: 2
95
+ summary: Generators which create tests using shoulda
96
+ test_files: []
97
+