rails 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,29 @@
1
+ *0.9.4* (January 17th, 2005)
2
+
3
+ * Added that ApplicationController will catch a ControllerNotFound exception if someone attempts to access a url pointing to an unexisting controller [Tobias Luetke]
4
+
5
+ * Flipped code-to-test ratio around to be more readable #468 [Scott Baron]
6
+
7
+ * Fixed log file permissions to be 666 instead of 777 (so they're not executable) #471 [Lucas Carlson]
8
+
9
+ * Fixed that auto reloading would some times not work or would reload the models twice #475 [Tobias Luetke]
10
+
11
+ * Added rewrite rules to deal with caching to public/.htaccess
12
+
13
+ * Added the option to specify a controller name to "generate scaffold" and made the default controller name the plural form of the model.
14
+
15
+ * Added that rake clone_structure_to_test, db_structure_dump, and purge_test_database tasks now pick up the source database to use from
16
+ RAILS_ENV instead of just forcing development #424 [Tobias Luetke]
17
+
18
+ * Fixed script/console to work with Windows (that requires the use of irb.bat) #418 [octopod]
19
+
20
+ * Fixed WEBrick servlet slowdown over time by restricting the load path reloading to mod_ruby
21
+
22
+ * Removed Fancy Indexing as a default option on the WEBrick servlet as it made it harder to use various caching schemes
23
+
24
+ * Upgraded to Active Record 1.5, Action Pack 1.3, Action Mailer 0.6
25
+
26
+
1
27
  *0.9.3* (January 4th, 2005)
2
28
 
3
29
  * Added support for SQLite in the auto-dumping/importing of schemas for development -> test #416
@@ -31,6 +57,8 @@
31
57
 
32
58
  * Fixed that generated action_mailers doesnt need to require the action_mailer since thats already done in the environment #382 [Lucas Carlson]
33
59
 
60
+ * Upgraded to Action Pack 1.2.0 and Active Record 1.4.0
61
+
34
62
 
35
63
  *0.9.2*
36
64
 
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ require 'rbconfig'
9
9
 
10
10
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
11
11
  PKG_NAME = 'rails'
12
- PKG_VERSION = '0.9.3' + PKG_BUILD
12
+ PKG_VERSION = '0.9.4' + PKG_BUILD
13
13
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
14
  PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
15
15
 
@@ -39,6 +39,9 @@ task :fresh_gem_rails => [ :clean, :make_dir_structure, :initialize_file_stubs,
39
39
  desc "Generates a fresh Rails package without documentation (faster)"
40
40
  task :fresh_rails_without_docs => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content ]
41
41
 
42
+ desc "Generates a fresh Rails package without documentation (faster)"
43
+ task :fresh_rails_without_docs_using_links => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
44
+
42
45
  desc "Packages the fresh Rails package with documentation"
43
46
  task :package => [ :clean, :fresh_rails ] do
44
47
  system %{cd ..; tar -czvf #{PKG_NAME}-#{PKG_VERSION}.tgz #{PKG_NAME}}
@@ -76,7 +79,7 @@ task :initialize_log_files do
76
79
  LOG_FILES.each do |log_file|
77
80
  log_path = File.join(log_dir, log_file)
78
81
  touch log_path
79
- chmod 0777, log_path
82
+ chmod 0666, log_path
80
83
  end
81
84
  end
82
85
 
@@ -89,6 +92,14 @@ task :copy_vendor_libraries do
89
92
  File.join(PKG_DESTINATION, 'vendor')
90
93
  end
91
94
 
95
+ desc "Link in all the Rails packages to vendor"
96
+ task :link_vendor_libraries do
97
+ return_dir = File.dirname(File.expand_path(__FILE__))
98
+ cd File.join(PKG_DESTINATION, 'vendor')
99
+ VENDOR_LIBS.each { |dir| ln_s File.dirname(__FILE__) + "/../../#{dir}", "." }
100
+ cd return_dir
101
+ end
102
+
92
103
 
93
104
  # Copy Ties Content -----------------------------------------------------------------------
94
105
 
@@ -234,9 +245,9 @@ spec = Gem::Specification.new do |s|
234
245
  EOF
235
246
 
236
247
  s.add_dependency('rake', '>= 0.4.15')
237
- s.add_dependency('activerecord', '>= 1.4.0')
238
- s.add_dependency('actionpack', '>= 1.2.0')
239
- s.add_dependency('actionmailer', '>= 0.5.0')
248
+ s.add_dependency('activerecord', '>= 1.5.0')
249
+ s.add_dependency('actionpack', '>= 1.3.0')
250
+ s.add_dependency('actionmailer', '>= 0.6.0')
240
251
 
241
252
  s.has_rdoc = false
242
253
 
@@ -3,7 +3,12 @@
3
3
  if ARGV[0]
4
4
  ENV['RAILS_ENV'] = ARGV[0]
5
5
  puts "Loading environment..."
6
- exec "irb -r config/environment.rb -r irb/completion --noinspect"
6
+ if RUBY_PLATFORM =~ /mswin32/
7
+ irb_name = "irb.bat"
8
+ else
9
+ irb_name = 'irb'
10
+ end
11
+ exec "#{irb_name} -r config/environment.rb -r irb/completion --noinspect"
7
12
  else
8
13
  puts <<-HELP
9
14
 
@@ -27,4 +32,4 @@ EXAMPLE
27
32
  and config/environments/production.rb). You would now be ready to start requiring
28
33
  models using require_dependency.
29
34
  HELP
30
- end
35
+ end
@@ -12,6 +12,38 @@ RewriteBase /dispatch.cgi
12
12
  # Enable this rewrite rule to point to the controller/action that should serve root.
13
13
  # RewriteRule ^$ /controller/action [R]
14
14
 
15
+ # <caching>
16
+ # no query string?
17
+ RewriteCond %{QUERY_STRING} ^$
18
+
19
+ # no POST method?
20
+ RewriteCond %{REQUEST_METHOD} !^POST$ [NC]
21
+
22
+ # Request filename is a directory?
23
+ RewriteCond %{REQUEST_FILENAME} -d
24
+
25
+ # Request filename + '/index' is a file?
26
+ RewriteCond %{REQUEST_FILENAME}/index -f
27
+
28
+ # Rewrite to request filename + '/index' and finish
29
+ RewriteRule ^(.*)/?$ $1/index [QSA,L]
30
+
31
+ # no query string?
32
+ RewriteCond %{QUERY_STRING} ^$
33
+
34
+ # no POST method?
35
+ RewriteCond %{REQUEST_METHOD} !^POST$ [NC]
36
+
37
+ # Request filename is a file?
38
+ RewriteCond %{REQUEST_FILENAME} -f
39
+
40
+ # Finish rewriting
41
+ RewriteRule .* - [L]
42
+
43
+ # Set default type of cached files to text/html
44
+ DefaultType text/html
45
+ # </caching>
46
+
15
47
  # Add missing slash
16
48
  RewriteRule ^([-_a-zA-Z0-9]+)$ /$1/ [R]
17
49
 
@@ -6,5 +6,5 @@ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_
6
6
  # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
7
  require "dispatcher"
8
8
 
9
- ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) }
9
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
10
  Dispatcher.dispatch
@@ -32,7 +32,7 @@
32
32
  <p><b>Before you move on</b>, verify that the following conditions have been met:</p>
33
33
 
34
34
  <ol>
35
- <li>The log directory and the empty log files must be writable to the web server (<code>chmod -R 777 log</code>).
35
+ <li>The log directory and the empty log files must be writable to the web server (<code>chmod -R 666 log/*</code>).
36
36
  <li>
37
37
  The shebang line in the public/dispatch* files must reference your Ruby installation. <br/>
38
38
  You might need to change it to <code>#!/usr/bin/env ruby</code> or point directly at the installation.
@@ -67,4 +67,4 @@
67
67
  </p>
68
68
 
69
69
  </body>
70
- </html>
70
+ </html>
@@ -1,3 +1,4 @@
1
1
  Dependencies.mechanism = :load
2
2
  ActionController::Base.consider_all_requests_local = true
3
+ ActionController::Base.perform_caching = false
3
4
  BREAKPOINT_SERVER_PORT = 42531
@@ -1,2 +1,3 @@
1
1
  Dependencies.mechanism = :require
2
2
  ActionController::Base.consider_all_requests_local = false
3
+ ActionController::Base.perform_caching = true
@@ -47,7 +47,7 @@ rescue StandardError
47
47
  RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
48
48
  RAILS_DEFAULT_LOGGER.level = Logger::WARN
49
49
  RAILS_DEFAULT_LOGGER.warn(
50
- "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0777. " +
50
+ "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0666. " +
51
51
  "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
52
52
  )
53
53
  end
@@ -44,7 +44,7 @@ rescue StandardError
44
44
  RAILS_DEFAULT_LOGGER = Logger.new(STDERR)
45
45
  RAILS_DEFAULT_LOGGER.level = Logger::WARN
46
46
  RAILS_DEFAULT_LOGGER.warn(
47
- "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0777. " +
47
+ "Rails Error: Unable to access log file. Please ensure that log/#{RAILS_ENV}.log exists and is chmod 0666. " +
48
48
  "The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
49
49
  )
50
50
  end
@@ -1,3 +1,4 @@
1
1
  Dependencies.mechanism = :require
2
2
  ActionController::Base.consider_all_requests_local = true
3
+ ActionController::Base.perform_caching = false
3
4
  ActionMailer::Base.delivery_method = :test
@@ -8,7 +8,7 @@ require File.dirname(__FILE__) + '/config/environment'
8
8
  require 'code_statistics'
9
9
 
10
10
  desc "Run all the tests on a fresh test database"
11
- task :default => [ :clone_development_structure_to_test, :test_units, :test_functional ]
11
+ task :default => [ :clone_structure_to_test, :test_units, :test_functional ]
12
12
 
13
13
  desc "Generate API documentatio, show coding stats"
14
14
  task :doc => [ :appdoc, :stats ]
@@ -72,36 +72,36 @@ task :stats do
72
72
  end
73
73
 
74
74
  desc "Recreate the test databases from the development structure"
75
- task :clone_development_structure_to_test => [ :db_structure_dump, :purge_test_database ] do
75
+ task :clone_structure_to_test => [ :db_structure_dump, :purge_test_database ] do
76
76
  if ActiveRecord::Base.configurations["test"]["adapter"] == "mysql"
77
77
  ActiveRecord::Base.establish_connection(:test)
78
78
  ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0')
79
- IO.readlines("db/development_structure.sql").join.split("\n\n").each do |table|
79
+ IO.readlines("db/#{RAILS_ENV}_structure.sql").join.split("\n\n").each do |table|
80
80
  ActiveRecord::Base.connection.execute(table)
81
81
  end
82
82
  elsif ActiveRecord::Base.configurations["test"]["adapter"] == "postgresql"
83
- `psql -U #{ActiveRecord::Base.configurations["test"]["username"]} -f db/development_structure.sql #{ActiveRecord::Base.configurations["test"]["database"]}`
83
+ `psql -U #{ActiveRecord::Base.configurations["test"]["username"]} -f db/#{RAILS_ENV}_structure.sql #{ActiveRecord::Base.configurations["test"]["database"]}`
84
84
  elsif ActiveRecord::Base.configurations["test"]["adapter"] == "sqlite"
85
- `sqlite #{ActiveRecord::Base.configurations["test"]["dbfile"]} < db/development_structure.sql`
85
+ `sqlite #{ActiveRecord::Base.configurations["test"]["dbfile"]} < db/#{RAILS_ENV}_structure.sql`
86
86
  end
87
87
  end
88
88
 
89
89
  desc "Dump the database structure to a SQL file"
90
90
  task :db_structure_dump do
91
- if ActiveRecord::Base.configurations["development"]["adapter"] == "mysql"
92
- ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations["development"])
93
- File.open("db/development_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
94
- elsif ActiveRecord::Base.configurations["development"]["adapter"] == "postgresql"
95
- `pg_dump -U #{ActiveRecord::Base.configurations["development"]["username"]} -s -f db/development_structure.sql #{ActiveRecord::Base.configurations["development"]["database"]}`
96
- elsif ActiveRecord::Base.configurations["development"]["adapter"] == "sqlite"
97
- `sqlite #{ActiveRecord::Base.configurations["development"]["dbfile"]} .schema > db/development_structure.sql`
91
+ if ActiveRecord::Base.configurations[RAILS_ENV]["adapter"] == "mysql"
92
+ ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[RAILS_ENV])
93
+ File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
94
+ elsif ActiveRecord::Base.configurations[RAILS_ENV]["adapter"] == "postgresql"
95
+ `pg_dump -U #{ActiveRecord::Base.configurations[RAILS_ENV]["username"]} -s -f db/#{RAILS_ENV}_structure.sql #{ActiveRecord::Base.configurations[RAILS_ENV]["database"]}`
96
+ elsif ActiveRecord::Base.configurations[RAILS_ENV]["adapter"] == "sqlite"
97
+ `sqlite #{ActiveRecord::Base.configurations[RAILS_ENV]["dbfile"]} .schema > db/#{RAILS_ENV}_structure.sql`
98
98
  end
99
99
  end
100
100
 
101
101
  desc "Drop the test database and bring it back again"
102
102
  task :purge_test_database do
103
103
  if ActiveRecord::Base.configurations["test"]["adapter"] == "mysql"
104
- ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations["development"])
104
+ ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[RAILS_ENV])
105
105
  ActiveRecord::Base.connection.recreate_database(ActiveRecord::Base.configurations["test"]["database"])
106
106
  elsif ActiveRecord::Base.configurations["test"]["adapter"] == "postgresql"
107
107
  `dropdb -U #{ActiveRecord::Base.configurations["test"]["username"]} #{ActiveRecord::Base.configurations["test"]["database"]}`
@@ -2,12 +2,14 @@ GENERATOR
2
2
  scaffold - create a model and basic controller
3
3
 
4
4
  SYNOPSIS
5
- generate scaffold ModelName [action ...]
5
+ generate scaffold ModelName [ControllerName] [action ...]
6
6
 
7
7
  DESCRIPTION
8
8
  The scaffold generator takes the name of the new model as the
9
- first argument and an optional list of controller actions as the
10
- subsequent arguments. Any actions with scaffolding code available
9
+ first argument, an optional controller name as the second, and
10
+ an optional list of controller actions as the subsequent arguments.
11
+ If the controller name is not specified, the plural form of the model
12
+ name will be used. Any actions with scaffolding code available
11
13
  will be generated in your controller; others will be left as stubs.
12
14
 
13
15
  The generated controller has the same code that "scaffold :model"
@@ -15,11 +17,11 @@ DESCRIPTION
15
17
  your controller.
16
18
 
17
19
  EXAMPLE
18
- ./script/generate scaffold Account debit credit
20
+ ./script/generate scaffold Account Bank debit credit
19
21
 
20
22
  This will generate the Account model with unit tests and fixtures,
21
- the AccountController controller with actions, views, and tests for
23
+ the BankController controller with actions, views, and tests for
22
24
  index, list, show, new, create, edit, update, and destroy.
23
25
 
24
26
  Now create the accounts table in your database and browse to
25
- http://localhost/account/ -- voila, you're on Rails!
27
+ http://localhost/bank/ -- voila, you're on Rails!
@@ -8,14 +8,17 @@ class ScaffoldGenerator < Rails::Generator::Base
8
8
  # Fixtures.
9
9
  template "fixtures.yml", "test/fixtures/#{table_name}.yml"
10
10
 
11
+ @controller_class_name = args.empty? ? Inflector.pluralize(class_name) : args.shift.sub(/^[a-z]?/) { |m| m.capitalize }
12
+ controller_name = Inflector.underscore(@controller_class_name)
13
+
11
14
  # Controller class, functional test, helper, and views.
12
- template "controller.rb", "app/controllers/#{file_name}_controller.rb"
13
- template "functional_test.rb", "test/functional/#{file_name}_controller_test.rb"
14
- template "controller/helper.rb", "app/helpers/#{file_name}_helper.rb"
15
+ template "controller.rb", "app/controllers/#{controller_name}_controller.rb"
16
+ template "functional_test.rb", "test/functional/#{controller_name}_controller_test.rb"
17
+ template "controller/helper.rb", "app/helpers/#{controller_name}_helper.rb"
15
18
 
16
19
  # Layout and stylesheet.
17
- unless File.file?("app/views/layouts/scaffold.rhtml")
18
- template "layout.rhtml", "app/views/layouts/scaffold.rhtml"
20
+ unless File.file?("app/views/layouts/#{controller_name}.rhtml")
21
+ template "layout.rhtml", "app/views/layouts/#{controller_name}.rhtml"
19
22
  end
20
23
  unless File.file?("public/stylesheets/scaffold.css")
21
24
  template "style.css", "public/stylesheets/scaffold.css"
@@ -23,13 +26,13 @@ class ScaffoldGenerator < Rails::Generator::Base
23
26
 
24
27
  # Scaffolded views.
25
28
  scaffold_views.each do |action|
26
- template "view_#{action}.rhtml", "app/views/#{file_name}/#{action}.rhtml"
29
+ template "view_#{action}.rhtml", "app/views/#{controller_name}/#{action}.rhtml"
27
30
  end
28
31
 
29
32
  # Unscaffolded views.
30
33
  unscaffolded_actions.each do |action|
31
34
  template "controller/view.rhtml",
32
- "app/views/#{file_name}/#{action}.rhtml",
35
+ "app/views/#{controller_name}/#{action}.rhtml",
33
36
  binding
34
37
  end
35
38
  end
@@ -1,6 +1,4 @@
1
- class <%= class_name %>Controller < ApplicationController
2
- layout 'scaffold'
3
-
1
+ class <%= @controller_class_name %>Controller < ApplicationController
4
2
  <% unless suffix -%>
5
3
  def index
6
4
  list
@@ -41,8 +39,7 @@ class <%= class_name %>Controller < ApplicationController
41
39
 
42
40
  def update
43
41
  @<%= singular_name %> = <%= class_name %>.find(@params['<%= singular_name %>']['id'])
44
- @<%= singular_name %>.attributes = @params['<%= singular_name %>']
45
- if @<%= singular_name %>.save
42
+ if @<%= singular_name %>.update_attributes(@params['<%= singular_name %>'])
46
43
  flash['notice'] = '<%= class_name %> was successfully updated.'
47
44
  redirect_to :action => 'show<%= suffix %>', :id => @<%= singular_name %>.id
48
45
  else
@@ -1,6 +1,6 @@
1
1
  <%% for column in <%= class_name %>.content_columns %>
2
2
  <p>
3
- <b><%%= column.human_name %>:</b> <%%= @<%= singular_name %>[column.name] %>
3
+ <b><%%= column.human_name %>:</b> <%%= @<%= singular_name %>.send(column.name) %>
4
4
  </p>
5
5
  <%% end %>
6
6
 
@@ -1,4 +1,4 @@
1
- ENV["RAILS_ENV"] ||= "test"
1
+ ENV["RAILS_ENV"] = "test"
2
2
  require File.dirname(__FILE__) + "/../config/environment"
3
3
  require 'application'
4
4
 
@@ -98,7 +98,7 @@ class CodeStatistics
98
98
  code = calculate_code
99
99
  tests = calculate_tests
100
100
 
101
- puts " Code LOC: #{code} Test LOC: #{tests} Code to Test Ratio: #{sprintf("%.1f", code/tests.to_f)}:1"
101
+ puts " Code LOC: #{code} Test LOC: #{tests} Code to Test Ratio: 1:#{sprintf("%.1f", tests.to_f/code)}"
102
102
  puts ""
103
103
  end
104
104
  end
@@ -24,60 +24,64 @@
24
24
  require 'breakpoint'
25
25
 
26
26
  class Dispatcher
27
- def self.dispatch(cgi = CGI.new, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS)
28
- Breakpoint.activate_drb("druby://localhost:#{BREAKPOINT_SERVER_PORT}", nil, !defined?(FastCGI)) if defined?(BREAKPOINT_SERVER_PORT)
27
+ class <<self
28
+ def dispatch(cgi = CGI.new, session_options = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS)
29
+ begin
30
+ Breakpoint.activate_drb("druby://localhost:#{BREAKPOINT_SERVER_PORT}", nil, !defined?(FastCGI)) if defined?(BREAKPOINT_SERVER_PORT)
29
31
 
30
- begin
31
- request = ActionController::CgiRequest.new(cgi, session_options)
32
- response = ActionController::CgiResponse.new(cgi)
33
-
34
- controller_name, module_name = controller_name(request.parameters), module_name(request.parameters)
32
+ request = ActionController::CgiRequest.new(cgi, session_options)
33
+ response = ActionController::CgiResponse.new(cgi)
34
+
35
+ controller_name, module_name = controller_name(request.parameters), module_name(request.parameters)
35
36
 
36
- require_dependency("application")
37
- require_dependency(controller_path(controller_name, module_name))
37
+ require_dependency("application")
38
+ require_dependency(controller_path(controller_name, module_name))
38
39
 
39
- controller_class(controller_name).process(request, response).out
40
- rescue Object => exception
41
- ActionController::Base.process_with_exception(request, response, exception).out
42
- ensure
43
- if Dependencies.mechanism == :load
40
+ controller_class(controller_name).process(request, response).out
41
+ rescue Object => exception
42
+ ActionController::Base.process_with_exception(request, response, exception).out
43
+ ensure
44
+ reset_application(controller_name) if Dependencies.mechanism == :load
45
+ Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT)
46
+ end
47
+ end
48
+
49
+ private
50
+ def reset_application(controller_name)
44
51
  ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses
45
- Dependencies.reload rescue nil # Ignore out of order reloading errors for Controllers
52
+ Dependencies.clear
46
53
  remove_class_hierarchy(controller_class(controller_name), ActionController::Base)
47
54
  end
48
-
49
- Breakpoint.deactivate_drb if defined?(BREAKPOINT_SERVER_PORT)
50
- end
51
- end
52
-
53
- def self.controller_path(controller_name, module_name = nil)
54
- if module_name
55
- "#{module_name}/#{Inflector.underscore(controller_name)}_controller"
56
- else
57
- "#{Inflector.underscore(controller_name)}_controller"
58
- end
59
- end
60
-
61
- def self.controller_class(controller_name)
62
- Object.const_get(controller_class_name(controller_name))
63
- end
64
-
65
- def self.controller_class_name(controller_name)
66
- "#{Inflector.camelize(controller_name)}Controller"
67
- end
68
-
69
- def self.controller_name(parameters)
70
- parameters["controller"].gsub(/[^_a-zA-Z0-9]/, "").untaint
71
- end
72
-
73
- def self.module_name(parameters)
74
- parameters["module"].gsub(/[^_a-zA-Z0-9]/, "").untaint if parameters["module"]
75
- end
76
55
 
77
- def self.remove_class_hierarchy(klass, until_superclass)
78
- while klass
79
- Object.send(:remove_const, "#{klass}".intern)
80
- klass = (klass.superclass unless until_superclass == klass.superclass)
81
- end
56
+ def controller_path(controller_name, module_name = nil)
57
+ if module_name
58
+ "#{module_name}/#{Inflector.underscore(controller_name)}_controller"
59
+ else
60
+ "#{Inflector.underscore(controller_name)}_controller"
61
+ end
62
+ end
63
+
64
+ def controller_class(controller_name)
65
+ Object.const_get(controller_class_name(controller_name))
66
+ end
67
+
68
+ def controller_class_name(controller_name)
69
+ "#{Inflector.camelize(controller_name)}Controller"
70
+ end
71
+
72
+ def controller_name(parameters)
73
+ parameters["controller"].gsub(/[^_a-zA-Z0-9]/, "").untaint
74
+ end
75
+
76
+ def module_name(parameters)
77
+ parameters["module"].gsub(/[^_a-zA-Z0-9]/, "").untaint if parameters["module"]
78
+ end
79
+
80
+ def remove_class_hierarchy(klass, until_superclass)
81
+ while klass
82
+ Object.send(:remove_const, "#{klass}".intern)
83
+ klass = (klass.superclass unless until_superclass == klass.superclass)
84
+ end
85
+ end
82
86
  end
83
87
  end
@@ -21,7 +21,7 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
21
21
 
22
22
  def initialize(server, options)
23
23
  @server_options = options
24
- @file_handler = WEBrick::HTTPServlet::FileHandler.new(server, options[:server_root], {:FancyIndexing => true })
24
+ @file_handler = WEBrick::HTTPServlet::FileHandler.new(server, options[:server_root])
25
25
  super
26
26
  end
27
27
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: rails
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.3
7
- date: 2005-01-04
6
+ version: 0.9.4
7
+ date: 2005-01-17
8
8
  summary: "Web-application framework with template engine, control-flow layer, and ORM."
9
9
  require_paths:
10
10
  - lib
@@ -138,7 +138,7 @@ dependencies:
138
138
  -
139
139
  - ">="
140
140
  - !ruby/object:Gem::Version
141
- version: 1.4.0
141
+ version: 1.5.0
142
142
  version:
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: actionpack
@@ -148,7 +148,7 @@ dependencies:
148
148
  -
149
149
  - ">="
150
150
  - !ruby/object:Gem::Version
151
- version: 1.2.0
151
+ version: 1.3.0
152
152
  version:
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: actionmailer
@@ -158,5 +158,5 @@ dependencies:
158
158
  -
159
159
  - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 0.5.0
161
+ version: 0.6.0
162
162
  version: