stage 0.4.0 → 0.4.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/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.4.1 2008-05-26
2
+ *Fixed: Namespacing bugs with model
3
+
1
4
  == 0.4.0 2008-05-25
2
5
  *Fixed: Support for namespacing in Rails.
3
6
 
data/lib/stage/version.rb CHANGED
@@ -2,7 +2,7 @@ module Stage #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 4
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -10,22 +10,28 @@ class StageGenerator < Rails::Generator::NamedBase
10
10
  :singular_route_method,
11
11
  :plural_route_method
12
12
 
13
+ attr_reader :controller_file_path,
14
+ :controller_class_nesting,
15
+ :controller_nesting_depth,
16
+ :controller_singular_name,
17
+ :controller_plural_name
18
+
13
19
  alias_method :controller_file_name, :controller_underscore_name
14
20
  alias_method :controller_table_name, :controller_plural_name
15
21
 
16
22
  def initialize(runtime_args, runtime_options = {})
17
23
  super
18
- base_name, @controller_class_path, controller_file_path, controller_class_nesting, controller_class_nesting_depth = extract_modules(@name.pluralize)
19
- @controller_class_name_without_nesting, @controller_underscore_name, controller_plural_name = inflect_names(base_name)
20
- controller_singular_name= base_name.singularize
21
- if controller_class_nesting.empty?
24
+ base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@name.pluralize)
25
+ @controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
26
+ @controller_singular_name= base_name.singularize
27
+ if @controller_class_nesting.empty?
22
28
  @controller_class_name = @controller_class_name_without_nesting
23
29
  else
24
- @controller_class_name = "#{controller_class_nesting}::#{@controller_class_name_without_nesting}"
30
+ @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
25
31
  end
26
32
 
27
- @singular_title_name = controller_singular_name.humanize
28
- @plural_title_name = controller_plural_name.humanize
33
+ @singular_title_name = @controller_singular_name.humanize
34
+ @plural_title_name = @controller_plural_name.humanize
29
35
  @singular_route_method = "#{@name.gsub("::", "_")}_path"
30
36
  @plural_route_method = "#{@name.gsub("::", "_").pluralize}_path"
31
37
  end
@@ -37,7 +43,7 @@ class StageGenerator < Rails::Generator::NamedBase
37
43
  m.class_collisions(class_path, "#{class_name}")
38
44
 
39
45
  # Controller, helper, views
40
- m.directory(File.join("app","models", class_path))
46
+ m.directory(File.join("app","models"))
41
47
  m.directory(File.join("app","controllers", controller_class_path))
42
48
  m.directory(File.join("app","helpers", controller_class_path))
43
49
  m.directory(File.join("app","views", controller_class_path, controller_file_name))
@@ -54,11 +60,11 @@ class StageGenerator < Rails::Generator::NamedBase
54
60
 
55
61
  m.template("data_partial.html.erb", File.join("app","views",controller_class_path, controller_file_name, "_data.html.erb"))
56
62
 
57
- m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
63
+ m.template 'model.rb', File.join('app/models', "", "#{file_name}.rb")
58
64
 
59
65
  m.template("controller.rb", File.join("app","controllers", controller_class_path, "#{controller_file_name}_controller.rb"))
60
66
 
61
- m.template("helper.rb", File.join("app","helpers", controller_class_path, "#{controller_file_name}_helper.rb"))
67
+ m.template("helper.rb", File.join("app","helpers", controller_class_path, "#{controller_file_name}_helper.rb"))
62
68
 
63
69
  unless options[:skip_migration]
64
70
  m.migration_template 'migration.rb', 'db/migrate', :assigns => {
@@ -1,2 +1,2 @@
1
- class <%= class_name %> < ActiveRecord::Base
1
+ class <%= singular_title_name %> < ActiveRecord::Base
2
2
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>stage</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/stage"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.0</a>
36
+ <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;stage&#8217;</h1>
39
39
 
data/website/merb.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>stage</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/stage"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.0</a>
36
+ <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;stage&#8217;</h1>
39
39
 
data/website/rails.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>stage</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/stage"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.0</a>
36
+ <a href="http://rubyforge.org/projects/stage" class="numbers">0.4.1</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;stage&#8217;</h1>
39
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-05-25 00:00:00 -04:00
12
+ date: 2008-05-26 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15