jzajpt-blueberry_scaffold 0.1.1 → 0.2.1

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.1
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{blueberry_scaffold}
5
- s.version = "0.1.1"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ji\305\231\303\255 Zajpt"]
9
- s.date = %q{2009-05-16}
9
+ s.date = %q{2009-05-29}
10
10
  s.description = %q{Scaffold generator featuring i18n, shoulda & factory girl tests.}
11
11
  s.email = %q{jzajpt@blueberryapps.com}
12
12
  s.extra_rdoc_files = [
@@ -3,6 +3,7 @@ class BlueberryScaffoldGenerator < Rails::Generator::Base
3
3
 
4
4
  def initialize(runtime_args, runtime_options = {})
5
5
  super
6
+ usage if @args.empty?
6
7
 
7
8
  # First argument is our controller/model name
8
9
  @name = runtime_args.shift
@@ -23,13 +24,13 @@ class BlueberryScaffoldGenerator < Rails::Generator::Base
23
24
  @actions.uniq!
24
25
  @actions = all_actions if @actions.empty?
25
26
 
26
- puts "args = #{@args.inspect}"
27
- puts "options = #{runtime_options.inspect}"
28
- puts "------------------------"
29
- puts "@name = #@name"
30
- puts "@namespace = #@namespace"
31
- puts "@action = #{@actions.inspect}"
32
- puts "@attributes = #{@attributes.inspect}}"
27
+ # puts "args = #{@args.inspect}"
28
+ # puts "options = #{runtime_options.inspect}"
29
+ # puts "------------------------"
30
+ # puts "@name = #@name"
31
+ # puts "@namespace = #@namespace"
32
+ # puts "@action = #{@actions.inspect}"
33
+ # puts "@attributes = #{@attributes.inspect}}"
33
34
  end
34
35
 
35
36
  def manifest
@@ -178,6 +179,5 @@ class BlueberryScaffoldGenerator < Rails::Generator::Base
178
179
  "Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
179
180
  opt.on("--skip-timestamps",
180
181
  "Don't add timestamps to migration file.") { |v| options[:skip_timestamps] = v }
181
-
182
182
  end
183
183
  end
@@ -53,11 +53,11 @@ class <%= controller_class_name %> < ApplicationController
53
53
  <% end -%>
54
54
  <% if action? :destroy -%>
55
55
  # DELETE /<%= plural_name %>/:id
56
- def destroy
57
- @<%= singular_name %> = <%= class_name %>.find(params[:id])
58
- @<%= singular_name %>.destroy
59
- flash[:notice] = t('<%= i18n_prefix %>.destroy.success')
60
- redirect_to <%= url %>
61
- end
56
+ def destroy
57
+ @<%= singular_name %> = <%= class_name %>.find(params[:id])
58
+ @<%= singular_name %>.destroy
59
+ flash[:notice] = t('<%= i18n_prefix %>.destroy.success')
60
+ redirect_to <%= url %>
61
+ end
62
62
  <% end -%>
63
63
  end
@@ -1,7 +1,7 @@
1
1
  <%%= form.error_messages %>
2
2
  <%- for attribute in attributes -%>
3
- <div>
4
- <%%= form.label :<%= attribute.name %> %>
5
- <%%= form.<%= attribute.field_type %> :<%= attribute.name %> %>
6
- </div>
3
+ <div>
4
+ <%%= form.label :<%= attribute.name %> %>
5
+ <%%= form.<%= attribute.field_type %> :<%= attribute.name %> %>
6
+ </div>
7
7
  <%- end -%>
@@ -1,6 +1,7 @@
1
1
  <p>
2
2
  <% if action? :index %><%%= link_to t('common.back'), <%= items_path %> %><% end -%>
3
3
  <% if action? :destroy %><%%= link_to_destroy_<%=singular_name %> @<%= singular_name %> %><% end -%>
4
+
4
5
  </p>
5
6
 
6
7
  <%% form_for @<%= singular_name %> do |form| %>
@@ -10,22 +10,20 @@
10
10
  </tr>
11
11
  </thead>
12
12
  <tbody>
13
- <%% @<%= plural_name %>.each do |<%= singular_name %>| -%>
14
- <%% content_tag_for :tr, <%= singular_name %> do %>
15
- <tr>
13
+ <%% @<%= plural_name %>.each do |<%= singular_name %>| -%>
14
+ <%% content_tag_for :tr, <%= singular_name %> do %>
16
15
  <% for attribute in attributes -%>
17
- <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
16
+ <td><%%=h <%= singular_name %>.<%= attribute.name %> %></td>
18
17
  <% end -%>
19
- <td class="actions">
18
+ <td class="actions">
20
19
  <% if action? :edit -%>
21
- <%%= link_to_edit_<%= singular_name %> <%= singular_name %> %>
20
+ <%%= link_to_edit_<%= singular_name %> <%= singular_name %> %>
22
21
  <% end -%>
23
22
  <% if action? :edit -%>
24
- <%%= link_to_destroy_<%= singular_name %> <%= singular_name %> %>
23
+ <%%= link_to_destroy_<%= singular_name %> <%= singular_name %> %>
25
24
  <% end -%>
26
- </td>
27
- </tr>
28
- <%% end %>
29
- <%% end -%>
25
+ </td>
26
+ <%% end %>
27
+ <%% end -%>
30
28
  </tbody>
31
29
  </table>
@@ -2,14 +2,15 @@
2
2
  <% if action? :index %><%%= link_to t('common.back'), <%= items_path %> %><% end -%>
3
3
  <% if action? :edit %><%%= link_to_edit_<%=singular_name %> @<%= singular_name %> %><% end -%>
4
4
  <% if action? :destroy %><%%= link_to_destroy_<%=singular_name %> @<%= singular_name %> %><% end -%>
5
+
5
6
  </p>
6
7
  <%% content_tag_for :div, @<%= singular_name %> do %>
7
8
  <ul>
8
9
  <% for attribute in attributes -%>
9
- <li>
10
- <strong><%%= <%= class_name %>.human_attribute_name '<%= attribute.column.name %>' %>:</strong>
11
- <%%=h @<%= singular_name %>.<%= attribute.name %> %>
12
- </li>
10
+ <li>
11
+ <strong><%%= <%= class_name %>.human_attribute_name '<%= attribute.column.name %>' %>:</strong>
12
+ <%%=h @<%= singular_name %>.<%= attribute.name %> %>
13
+ </li>
13
14
  <% end -%>
14
15
  </ul>
15
16
  <%% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jzajpt-blueberry_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Ji\xC5\x99\xC3\xAD Zajpt"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-16 00:00:00 -07:00
12
+ date: 2009-05-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15