jfs-generators 0.2.0 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Jason Stahl.
1
+ Copyright (c) 2009-2010 Jason Stahl.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,25 +1,17 @@
1
1
  jfs-generators
2
2
  ==============
3
-
4
- My collection of Ruby on Rails generators.
3
+ My collection of Ruby on Rails generators. If you use and like these generators, consider recommending me at [Working With Rails](http://workingwithrails.com/person/16743-jason-stahl).
5
4
 
6
5
 
7
6
  Install
8
7
  -------
9
-
10
- If you have never grabbed a gem from github or you aren't sure if you have, run
11
- the following command: (you should only have to do this once):
12
-
13
- gem sources -a http://gems.github.com
14
-
15
- Once you have setup GitHub as a gem source, run this command to install the gem:
8
+ Run this command to install the gem:
16
9
 
17
10
  sudo gem install jfs-generators
18
11
 
19
12
 
20
13
  Usage
21
14
  -----
22
-
23
15
  Once you install the gem, the generators should be available to all Ruby on
24
16
  Rails applications on your system. Run `script/generate` without any arguments
25
17
  to see a list of the available generators in your environment.
@@ -32,12 +24,12 @@ To run the generator, go to your rails project directory and call it using the
32
24
 
33
25
  jfs\_960
34
26
  --------
35
-
36
- Injects the project with the CSS files for the 960 Grid System (v1.1).
27
+ Injects the project with the CSS files for the
28
+ [960 Grid System](http://960.gs/) (v1.1).
37
29
 
38
30
  Example:
39
31
 
40
- ./script/generate jfs_960
32
+ script/generate jfs_960
41
33
 
42
34
  Injects the project with `public/stylesheets/reset.css`,
43
35
  `public/stylesheets/text.css` and `public/stylesheets/960.css`.
@@ -45,7 +37,6 @@ Injects the project with `public/stylesheets/reset.css`,
45
37
 
46
38
  jfs\_config
47
39
  -----------
48
-
49
40
  Creates YAML file in your config directory and an initializer to load this
50
41
  config. The config has a separate section for each environment.
51
42
 
@@ -71,13 +62,13 @@ Creates a YAML file at `config/passwords_config.yml` and an initializer at
71
62
 
72
63
  jfs\_jquery
73
64
  -----------
65
+ Injects the project with the javascript files for [jQuery](http://jquery.com)
66
+ (v.1.3.2) and [jQuery UI](http://ui.jquery.com) (v.1.7.1).
74
67
 
75
- Injects the project with the javascript files for jQuery (v.1.3.2) and
76
- jQuery UI (v.1.7.1).
77
68
 
78
69
  Example:
79
70
 
80
- ./script/generate jfs_jquery
71
+ script/generate jfs_jquery
81
72
 
82
73
  Injects the project with `public/javascripts/jqery.min.js.css` and
83
74
  `public/javascripts/jquery-ui.min.js`.
@@ -85,8 +76,7 @@ Injects the project with `public/javascripts/jqery.min.js.css` and
85
76
 
86
77
  jfs\_layout
87
78
  -----------
88
-
89
- Creates a basic layout using including a stylesheet and layout helper.
79
+ Creates a basic layout including a stylesheet and layout helper.
90
80
 
91
81
  The generator optionally takes a single arugument. This is the name of the
92
82
  layout and stylesheet files. If no argument is passed then it defaults to
@@ -117,7 +107,6 @@ Creates a layout file at `app/views/layouts/admin.html.erb`, a helper at
117
107
 
118
108
  jfs\_model
119
109
  ----------
120
-
121
110
  Stubs out a new model, including `attr_accessible` statement for attributes.
122
111
  Pass the model name, either CamelCased or under\_scored, and an optional list of
123
112
  attribute pairs as arguments.
@@ -130,19 +119,18 @@ This generates a model class in `app/models` and a migration in `db/migrate`.
130
119
 
131
120
  Examples:
132
121
 
133
- ./script/generate jfs_model Account
122
+ script/generate jfs_model Account
134
123
 
135
124
  Creates an Account model at `app/models/account.rb` and a migration at
136
125
  `db/migrate/XXX_create_accounts.rb`.
137
126
 
138
- ./script/generate model Article title:string content:text
127
+ script/generate jfs_model Article title:string content:text
139
128
 
140
129
  Creates an Article model with a string title and text body.
141
130
 
142
131
 
143
132
  jfs\_scaffold
144
133
  -------------
145
-
146
134
  Scaffolds an entire resource, from model and migration to translation ready
147
135
  controller and views. The resource is ready to use as a starting point for your
148
136
  RESTful, resource-oriented application.
@@ -162,7 +150,7 @@ that lists them all, as well as a `map.resources :articles` declaration in
162
150
 
163
151
  Examples:
164
152
 
165
- ./script/generate scaffold article title:string content:text
153
+ script/generate jfs_scaffold article title:string content:text
166
154
 
167
155
  Creates a model at `app/models/article.rb`, a migration at
168
156
  `db/migrate/XXX_create_articles.rb`, a helper at
@@ -176,5 +164,4 @@ and `app/views/article/_fields.html.erb` and a translation file at
176
164
 
177
165
  Copyright
178
166
  ---------
179
-
180
- Copyright (c) 2009 Jason Stahl. See LICENSE for details.
167
+ Copyright (c) 2009-2010 Jason Stahl. See LICENSE for details.
@@ -2,7 +2,7 @@ Description:
2
2
  Injects the project with the CSS files for the 960 Grid System (v1.1).
3
3
 
4
4
  Example:
5
- `./script/generate jfs_960`
5
+ `script/generate jfs_960`
6
6
 
7
7
  Injects the project with three stylesheets:
8
8
  Stylesheet: public/stylesheets/reset.css
@@ -13,11 +13,7 @@ class Jfs960Generator < Rails::Generator::Base
13
13
  protected
14
14
 
15
15
  def banner
16
- <<-END
17
- Generates the CSS files for the 960 Grid System.
18
-
19
- USAGE: #{$0} #{spec.name}
20
- END
16
+ "Usage: #{$0} #{spec.name}"
21
17
  end
22
18
 
23
19
  end
@@ -25,11 +25,7 @@ class JfsConfigGenerator < Rails::Generator::Base
25
25
  protected
26
26
 
27
27
  def banner
28
- <<-END
29
- Generates a config YAML file and loader.
30
-
31
- USAGE: #{$0} #{spec.name} [config_name]
32
- END
28
+ "Usage: #{$0} #{spec.name} [config_name]"
33
29
  end
34
30
 
35
31
  end
@@ -3,7 +3,7 @@ Description:
3
3
  jQuery UI (v.1.7.1).
4
4
 
5
5
  Example:
6
- `./script/generate jfs_jquery`
6
+ `script/generate jfs_jquery`
7
7
 
8
8
  Injects the project with two javascript files:
9
9
  JavaScript: public/javascripts/jquery.min.js
@@ -20,11 +20,7 @@ class JfsJqueryGenerator < Rails::Generator::Base
20
20
  end
21
21
 
22
22
  def banner
23
- <<-END
24
- Generates the javascript files for jQuery and jQuery UI.
25
-
26
- USAGE: #{$0} #{spec.name}
27
- END
23
+ "Usage: #{$0} #{spec.name}"
28
24
  end
29
25
 
30
26
  end
@@ -26,11 +26,7 @@ class JfsLayoutGenerator < Rails::Generator::Base
26
26
  protected
27
27
 
28
28
  def banner
29
- <<-END
30
- Generates a basic layout using including a stylesheet and layout helper.
31
-
32
- USAGE: #{$0} #{spec.name} [layout_name]
33
- END
29
+ "Usage: #{$0} #{spec.name} [layout_name]"
34
30
  end
35
31
 
36
32
  end
@@ -12,13 +12,17 @@ h1, h2, h3, h4, h5, h6
12
12
  letter-spacing: 0.1em;
13
13
  }
14
14
  img { border: none; }
15
- input
15
+ input, textarea
16
16
  {
17
17
  border: solid #CCC 1px;
18
18
  padding: 0.2em 0.4em;
19
19
  }
20
20
  input[type=text], input[type=password], textarea { width: 50%; }
21
- textarea { height: 10em; }
21
+ label { font-weight: bold; }
22
+ textarea {
23
+ height: 10em;
24
+ width: 50%;
25
+ }
22
26
  td { padding: 0.2em 0.4em; }
23
27
  th { text-align: left; }
24
28
 
@@ -51,7 +55,7 @@ th { text-align: left; }
51
55
  }
52
56
  #content a { color: #000; }
53
57
  #content h1:first-child { margin-top: 0em; }
54
- #content input { border: solid #333 1px; }
58
+ #content input, #content textarea { border: solid #333 1px; }
55
59
 
56
60
  #errorExplanation {
57
61
  background-color: #FCC;
@@ -10,12 +10,12 @@ Description:
10
10
  This generates a model class in app/models and a migration in db/migrate.
11
11
 
12
12
  Examples:
13
- `./script/generate jfs_model Account`
13
+ `script/generate jfs_model Account`
14
14
 
15
15
  Creates an Account model and migration:
16
16
  Model: app/models/account.rb
17
17
  Migration: db/migrate/XXX_create_accounts.rb
18
18
 
19
- `./script/generate model Article title:string content:text`
19
+ `script/generate jfs_model Article title:string content:text`
20
20
 
21
21
  Creates an Article model with a string title and text body,.
@@ -17,7 +17,7 @@ Description:
17
17
  config/routes.rb.
18
18
 
19
19
  Examples:
20
- `./script/generate scaffold article title:string body:text published:boolean`
20
+ `script/generate jfs_scaffold article title:string body:text published:boolean`
21
21
 
22
22
  Creates a model, migration, helper, controller, views and translation
23
23
  file:
@@ -26,6 +26,7 @@ class JfsScaffoldGenerator < Rails::Generator::Base
26
26
  end
27
27
  end
28
28
  m.template "views/_fields.html.erb", "app/views/#{plural_name}/_fields.html.erb"
29
+ m.template "views/_resource.html.erb", "app/views/#{plural_name}/_#{singular_name}.html.erb"
29
30
  m.directory 'config/locales'
30
31
  m.template 'en.yml', "config/locales/en.#{plural_name}.yml"
31
32
 
@@ -93,12 +94,7 @@ class JfsScaffoldGenerator < Rails::Generator::Base
93
94
  end
94
95
 
95
96
  def banner
96
- <<-END
97
- Creates a controller, model and views given the model name, actions, and
98
- attributes.
99
-
100
- USAGE: #{$0} #{spec.name} ModelName [controller_actions and model:attributes] [options]
101
- END
97
+ "Usage: #{$0} #{spec.name} ModelName [controller_actions and model:attributes] [options]"
102
98
  end
103
99
 
104
100
  end
@@ -0,0 +1,18 @@
1
+ <p>
2
+ <strong><%%=t '<%= plural_name %>.fields.id' %>:</strong>
3
+ <%%=h @<%= singular_name %>.id %>
4
+ </p>
5
+ <%- attributes.each do |attribute| -%>
6
+ <p>
7
+ <strong><%%=t '<%= plural_name %>.fields.<%= attribute.name %>' %>:</strong>
8
+ <%%=h @<%= singular_name %>.<%= attribute.name %> %>
9
+ </p>
10
+ <%- end -%>
11
+ <p>
12
+ <strong><%%=t '<%= plural_name %>.fields.created_at' %>:</strong>
13
+ <%%=l @<%= singular_name %>.created_at, :format => :long %>
14
+ </p>
15
+ <p>
16
+ <strong><%%=t '<%= plural_name %>.fields.updated_at' %>:</strong>
17
+ <%%=l @<%= singular_name %>.updated_at, :format => :long %>
18
+ </p>
@@ -1,22 +1,5 @@
1
1
  <h1><%%=title t('.title') %></h1>
2
- <p>
3
- <strong><%%=t '<%= plural_name %>.fields.id' %>:</strong>
4
- <%%=h @<%= singular_name %>.id %>
5
- </p>
6
- <%- attributes.each do |attribute| -%>
7
- <p>
8
- <strong><%%=t '<%= plural_name %>.fields.<%= attribute.name %>' %>:</strong>
9
- <%%=h @<%= singular_name %>.<%= attribute.name %> %>
10
- </p>
11
- <%- end -%>
12
- <p>
13
- <strong><%%=t '<%= plural_name %>.fields.created_at' %>:</strong>
14
- <%%=l @<%= singular_name %>.created_at, :format => :long %>
15
- </p>
16
- <p>
17
- <strong><%%=t '<%= plural_name %>.fields.updated_at' %>:</strong>
18
- <%%=l @<%= singular_name %>.updated_at, :format => :long %>
19
- </p>
2
+ <%%= render @<%= singular_name %> %>
20
3
  <p>
21
4
  <%- if is_action_included? :edit -%>
22
5
  <%%= link_to t('<%= plural_name %>.edit.title'), edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jfs-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ hash: 17
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 3
10
+ version: 0.2.3
5
11
  platform: ruby
6
12
  authors:
7
13
  - Jason Stahl
@@ -9,45 +15,58 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-05-18 00:00:00 -07:00
18
+ date: 2010-05-25 00:00:00 -05:00
13
19
  default_executable:
14
- dependencies: []
15
-
16
- description: My collection of Ruby on Rails generators.
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: formtastic
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 43
30
+ segments:
31
+ - 0
32
+ - 9
33
+ - 8
34
+ version: 0.9.8
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: My collection of Ruby on Rails generators which includes a new model and scaffold generator along with other helpful generators
17
38
  email: jason@jasonstahl.net
18
39
  executables: []
19
40
 
20
41
  extensions: []
21
42
 
22
- extra_rdoc_files:
23
- - LICENSE
24
- - README.md
43
+ extra_rdoc_files: []
44
+
25
45
  files:
26
46
  - lib/generators.rb
27
- - rails_generators/jfs_960/USAGE
28
47
  - rails_generators/jfs_960/jfs_960_generator.rb
29
48
  - rails_generators/jfs_960/templates/960.css
30
49
  - rails_generators/jfs_960/templates/reset.css
31
50
  - rails_generators/jfs_960/templates/text.css
32
- - rails_generators/jfs_config/USAGE
51
+ - rails_generators/jfs_960/USAGE
33
52
  - rails_generators/jfs_config/jfs_config_generator.rb
34
53
  - rails_generators/jfs_config/templates/config.yml
35
54
  - rails_generators/jfs_config/templates/load_config.rb
36
- - rails_generators/jfs_jquery/USAGE
55
+ - rails_generators/jfs_config/USAGE
37
56
  - rails_generators/jfs_jquery/jfs_jquery_generator.rb
38
57
  - rails_generators/jfs_jquery/templates/jquery-ui.min.js
39
58
  - rails_generators/jfs_jquery/templates/jquery.min.js
40
- - rails_generators/jfs_layout/USAGE
59
+ - rails_generators/jfs_jquery/USAGE
41
60
  - rails_generators/jfs_layout/jfs_layout_generator.rb
42
61
  - rails_generators/jfs_layout/templates/en.yml
43
62
  - rails_generators/jfs_layout/templates/helper.rb
44
63
  - rails_generators/jfs_layout/templates/layout.html.erb
45
64
  - rails_generators/jfs_layout/templates/stylesheet.css
46
- - rails_generators/jfs_model/USAGE
65
+ - rails_generators/jfs_layout/USAGE
47
66
  - rails_generators/jfs_model/jfs_model_generator.rb
48
67
  - rails_generators/jfs_model/templates/migration.rb
49
68
  - rails_generators/jfs_model/templates/model.rb
50
- - rails_generators/jfs_scaffold/USAGE
69
+ - rails_generators/jfs_model/USAGE
51
70
  - rails_generators/jfs_scaffold/jfs_scaffold_generator.rb
52
71
  - rails_generators/jfs_scaffold/templates/actions/create.rb
53
72
  - rails_generators/jfs_scaffold/templates/actions/destroy.rb
@@ -62,38 +81,51 @@ files:
62
81
  - rails_generators/jfs_scaffold/templates/migration.rb
63
82
  - rails_generators/jfs_scaffold/templates/model.rb
64
83
  - rails_generators/jfs_scaffold/templates/views/_fields.html.erb
84
+ - rails_generators/jfs_scaffold/templates/views/_resource.html.erb
65
85
  - rails_generators/jfs_scaffold/templates/views/edit.html.erb
66
86
  - rails_generators/jfs_scaffold/templates/views/index.html.erb
67
87
  - rails_generators/jfs_scaffold/templates/views/new.html.erb
68
88
  - rails_generators/jfs_scaffold/templates/views/show.html.erb
69
- - LICENSE
89
+ - rails_generators/jfs_scaffold/USAGE
70
90
  - README.md
91
+ - LICENSE
71
92
  has_rdoc: true
72
93
  homepage: http://github.com/jfs/generators
94
+ licenses: []
95
+
73
96
  post_install_message:
74
- rdoc_options:
75
- - --charset=UTF-8
97
+ rdoc_options: []
98
+
76
99
  require_paths:
77
100
  - lib
78
101
  required_ruby_version: !ruby/object:Gem::Requirement
102
+ none: false
79
103
  requirements:
80
104
  - - ">="
81
105
  - !ruby/object:Gem::Version
82
- version: "0"
83
- version:
106
+ hash: 57
107
+ segments:
108
+ - 1
109
+ - 8
110
+ - 7
111
+ version: 1.8.7
84
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
+ none: false
85
114
  requirements:
86
115
  - - ">="
87
116
  - !ruby/object:Gem::Version
88
- version: "0"
89
- version:
117
+ hash: 21
118
+ segments:
119
+ - 1
120
+ - 3
121
+ - 7
122
+ version: 1.3.7
90
123
  requirements: []
91
124
 
92
125
  rubyforge_project:
93
- rubygems_version: 1.2.0
126
+ rubygems_version: 1.3.7
94
127
  signing_key:
95
128
  specification_version: 3
96
129
  summary: My collection of Ruby on Rails generators.
97
- test_files:
98
- - test/generators_test.rb
99
- - test/test_helper.rb
130
+ test_files: []
131
+
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class GeneratorsTest < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end
data/test/test_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- require 'test/unit'
3
- require 'shoulda'
4
-
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
- $LOAD_PATH.unshift(File.dirname(__FILE__))
7
- require 'generators'
8
-
9
- class Test::Unit::TestCase
10
- end