rails 2.0.5 → 2.1.0

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.

Files changed (84) hide show
  1. data/CHANGELOG +115 -3
  2. data/MIT-LICENSE +1 -1
  3. data/README +67 -14
  4. data/Rakefile +9 -19
  5. data/bin/dbconsole +3 -0
  6. data/bin/rails +0 -0
  7. data/builtin/rails_info/rails/info.rb +5 -5
  8. data/configs/apache.conf +0 -0
  9. data/configs/databases/frontbase.yml +2 -2
  10. data/configs/databases/mysql.yml +2 -2
  11. data/configs/databases/oracle.yml +3 -3
  12. data/configs/databases/postgresql.yml +2 -2
  13. data/configs/databases/sqlite2.yml +2 -2
  14. data/configs/databases/sqlite3.yml +2 -2
  15. data/configs/initializers/new_rails_defaults.rb +15 -0
  16. data/configs/routes.rb +6 -0
  17. data/dispatches/dispatch.fcgi +0 -0
  18. data/dispatches/dispatch.rb +0 -0
  19. data/environments/boot.rb +1 -0
  20. data/environments/development.rb +0 -1
  21. data/environments/environment.rb +15 -7
  22. data/environments/production.rb +3 -0
  23. data/environments/test.rb +1 -1
  24. data/fresh_rakefile +0 -0
  25. data/helpers/application.rb +5 -0
  26. data/html/images/rails.png +0 -0
  27. data/html/index.html +6 -9
  28. data/html/javascripts/controls.js +1 -1
  29. data/html/javascripts/dragdrop.js +1 -1
  30. data/html/javascripts/effects.js +1 -1
  31. data/lib/commands/console.rb +2 -2
  32. data/lib/commands/dbconsole.rb +65 -0
  33. data/lib/commands/generate.rb +0 -0
  34. data/lib/commands/performance/profiler.rb +1 -1
  35. data/lib/commands/performance/request.rb +0 -0
  36. data/lib/commands/plugin.rb +28 -1
  37. data/lib/commands/server.rb +2 -2
  38. data/lib/commands/servers/lighttpd.rb +1 -1
  39. data/lib/commands/servers/mongrel.rb +9 -9
  40. data/lib/commands/servers/new_mongrel.rb +16 -0
  41. data/lib/commands/servers/webrick.rb +1 -1
  42. data/lib/console_app.rb +2 -2
  43. data/lib/dispatcher.rb +1 -1
  44. data/lib/fcgi_handler.rb +32 -16
  45. data/lib/initializer.rb +273 -59
  46. data/lib/rails/gem_builder.rb +21 -0
  47. data/lib/rails/gem_dependency.rb +124 -0
  48. data/lib/rails/mongrel_server/commands.rb +342 -0
  49. data/lib/rails/mongrel_server/handler.rb +55 -0
  50. data/lib/rails/plugin.rb +42 -11
  51. data/lib/rails/plugin/loader.rb +3 -1
  52. data/lib/rails/plugin/locator.rb +22 -1
  53. data/lib/rails/version.rb +2 -2
  54. data/lib/rails_generator/base.rb +1 -1
  55. data/lib/rails_generator/commands.rb +63 -47
  56. data/lib/rails_generator/generators/applications/app/app_generator.rb +5 -7
  57. data/lib/rails_generator/generators/components/controller/templates/controller.rb +1 -4
  58. data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
  59. data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +1 -1
  60. data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +2 -6
  61. data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +8 -6
  62. data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
  63. data/lib/rails_generator/generators/components/migration/USAGE +4 -4
  64. data/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
  65. data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +1 -1
  66. data/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -0
  67. data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
  68. data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +2 -1
  69. data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +1 -1
  70. data/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -20
  71. data/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +3 -4
  72. data/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +3 -4
  73. data/lib/rails_generator/lookup.rb +6 -2
  74. data/lib/rails_generator/options.rb +7 -0
  75. data/lib/rails_generator/scripts.rb +8 -5
  76. data/lib/rails_generator/secret_key_generator.rb +12 -8
  77. data/lib/source_annotation_extractor.rb +40 -0
  78. data/lib/tasks/databases.rake +52 -27
  79. data/lib/tasks/framework.rake +22 -29
  80. data/lib/tasks/gems.rake +64 -0
  81. data/lib/tasks/misc.rake +47 -0
  82. data/lib/tasks/testing.rake +1 -1
  83. data/lib/test_help.rb +8 -0
  84. metadata +19 -15
@@ -38,40 +38,33 @@ namespace :rails do
38
38
  end
39
39
  end
40
40
 
41
- desc "Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)"
41
+ desc 'Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0'
42
42
  task :edge do
43
- $verbose = false
44
- `svn --version` rescue nil
45
- unless !$?.nil? && $?.success?
46
- $stderr.puts "ERROR: Must have subversion (svn) available in the PATH to lock this application to Edge Rails"
47
- exit 1
48
- end
49
-
50
- rm_rf "vendor/rails"
51
- mkdir_p "vendor/rails"
52
-
53
- svn_root = "http://dev.rubyonrails.org/svn/rails/"
54
-
55
- if ENV['TAG']
56
- rails_svn = "#{svn_root}/tags/#{ENV['TAG']}"
57
- touch "vendor/rails/TAG_#{ENV['TAG']}"
58
- else
59
- rails_svn = "#{svn_root}/trunk"
60
-
61
- if ENV['REVISION'].nil?
62
- ENV['REVISION'] = /^r(\d+)/.match(%x{svn -qr HEAD log #{svn_root}})[1]
63
- puts "REVISION not set. Using HEAD, which is revision #{ENV['REVISION']}."
43
+ require 'open-uri'
44
+ version = ENV["RELEASE"] || "edge"
45
+ target = "rails_#{version}.zip"
46
+ url = "http://dev.rubyonrails.org/archives/#{target}"
47
+
48
+ chdir 'vendor' do
49
+ puts "Downloading Rails from #{url}"
50
+ File.open('rails.zip', 'wb') do |dst|
51
+ open url do |src|
52
+ while chunk = src.read(4096)
53
+ dst << chunk
54
+ end
55
+ end
64
56
  end
65
57
 
66
- touch "vendor/rails/REVISION_#{ENV['REVISION']}"
58
+ puts 'Unpacking Rails'
59
+ rm_rf 'rails'
60
+ `unzip rails.zip`
61
+ %w(rails.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner|
62
+ rm_f goner
63
+ end
67
64
  end
68
65
 
69
- for framework in %w(railties actionpack activerecord actionmailer activesupport activeresource)
70
- system "svn export #{rails_svn}/#{framework} vendor/rails/#{framework}" + (ENV['REVISION'] ? " -r #{ENV['REVISION']}" : "")
71
- end
72
-
73
- puts "Updating current scripts, javascripts, and configuration settings"
74
- Rake::Task["rails:update"].invoke
66
+ puts 'Updating current scripts, javascripts, and configuration settings'
67
+ Rake::Task['rails:update'].invoke
75
68
  end
76
69
  end
77
70
 
@@ -0,0 +1,64 @@
1
+ desc "List the gems that this rails application depends on"
2
+ task :gems => 'gems:base' do
3
+ Rails.configuration.gems.each do |gem|
4
+ code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " "
5
+ puts "[#{code}] #{gem.name} #{gem.requirement.to_s}"
6
+ end
7
+ puts
8
+ puts "I = Installed"
9
+ puts "F = Frozen"
10
+ end
11
+
12
+ namespace :gems do
13
+ task :base do
14
+ $rails_gem_installer = true
15
+ Rake::Task[:environment].invoke
16
+ end
17
+
18
+ desc "Build any native extensions for unpacked gems"
19
+ task :build do
20
+ $rails_gem_installer = true
21
+ require 'rails/gem_builder'
22
+ Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*')].each do |gem_dir|
23
+ spec_file = File.join(gem_dir, '.specification')
24
+ next unless File.exists?(spec_file)
25
+ specification = YAML::load_file(spec_file)
26
+ next unless ENV['GEM'].blank? || ENV['GEM'] == specification.name
27
+ Rails::GemBuilder.new(specification, gem_dir).build_extensions
28
+ puts "Built gem: '#{gem_dir}'"
29
+ end
30
+ end
31
+
32
+ desc "Installs all required gems for this application."
33
+ task :install => :base do
34
+ require 'rubygems'
35
+ require 'rubygems/gem_runner'
36
+ Rails.configuration.gems.each { |gem| gem.install unless gem.loaded? }
37
+ end
38
+
39
+ desc "Unpacks the specified gem into vendor/gems."
40
+ task :unpack => :base do
41
+ require 'rubygems'
42
+ require 'rubygems/gem_runner'
43
+ Rails.configuration.gems.each do |gem|
44
+ next unless !gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name)
45
+ gem.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems')) if gem.loaded?
46
+ end
47
+ end
48
+
49
+ namespace :unpack do
50
+ desc "Unpacks the specified gems and its dependencies into vendor/gems"
51
+ task :dependencies => :unpack do
52
+ require 'rubygems'
53
+ require 'rubygems/gem_runner'
54
+ Rails.configuration.gems.each do |gem|
55
+ next unless ENV['GEM'].blank? || ENV['GEM'] == gem.name
56
+ gem.dependencies.each do |dependency|
57
+ dependency.add_load_paths # double check that we have not already unpacked
58
+ next if dependency.frozen?
59
+ dependency.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems'))
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -8,3 +8,50 @@ desc 'Generate a crytographically secure secret key. This is typically used to g
8
8
  task :secret do
9
9
  puts Rails::SecretKeyGenerator.new(ENV['ID']).generate_secret
10
10
  end
11
+
12
+ require 'active_support'
13
+ namespace :time do
14
+ namespace :zones do
15
+ desc 'Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
16
+ task :all do
17
+ build_time_zone_list(:all)
18
+ end
19
+
20
+ desc 'Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6'
21
+ task :us do
22
+ build_time_zone_list(:us_zones)
23
+ end
24
+
25
+ desc 'Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time'
26
+ task :local do
27
+ jan_offset = Time.now.beginning_of_year.utc_offset
28
+ jul_offset = Time.now.beginning_of_year.change(:month => 7).utc_offset
29
+ offset = jan_offset < jul_offset ? jan_offset : jul_offset
30
+ build_time_zone_list(:all, offset)
31
+ end
32
+
33
+ # to find UTC -06:00 zones, OFFSET can be set to either -6, -6:00 or 21600
34
+ def build_time_zone_list(method, offset = ENV['OFFSET'])
35
+ if offset
36
+ offset = if offset.to_s.match(/(\+|-)?(\d+):(\d+)/)
37
+ sign = $1 == '-' ? -1 : 1
38
+ hours, minutes = $2.to_f, $3.to_f
39
+ ((hours * 3600) + (minutes.to_f * 60)) * sign
40
+ elsif offset.to_f.abs <= 13
41
+ offset.to_f * 3600
42
+ else
43
+ offset.to_f
44
+ end
45
+ end
46
+ previous_offset = nil
47
+ TimeZone.__send__(method).each do |zone|
48
+ if offset.nil? || offset == zone.utc_offset
49
+ puts "\n* UTC #{zone.formatted_offset} *" unless zone.utc_offset == previous_offset
50
+ puts zone.name
51
+ previous_offset = zone.utc_offset
52
+ end
53
+ end
54
+ puts "\n"
55
+ end
56
+ end
57
+ end
@@ -38,7 +38,7 @@ module Kernel
38
38
  end
39
39
  end
40
40
 
41
- desc 'Test all units and functionals'
41
+ desc 'Run all unit, functional and integration tests'
42
42
  task :test do
43
43
  errors = %w(test:units test:functionals test:integration).collect do |task|
44
44
  begin
@@ -18,3 +18,11 @@ ActionController::IntegrationTest.fixture_path = Test::Unit::TestCase.fixture_pa
18
18
  def create_fixtures(*table_names)
19
19
  Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names)
20
20
  end
21
+
22
+ begin
23
+ require_library_or_gem 'ruby-debug'
24
+ Debugger.start
25
+ Debugger.settings[:autoeval] = true if Debugger.respond_to?(:settings)
26
+ rescue LoadError
27
+ # ruby-debug wasn't available so neither can the debugging be
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,68 +9,62 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-19 00:00:00 +02:00
12
+ date: 2008-05-31 00:00:00 -07:00
13
13
  default_executable: rails
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
17
- type: :runtime
18
17
  version_requirement:
19
18
  version_requirements: !ruby/object:Gem::Requirement
20
19
  requirements:
21
20
  - - ">="
22
21
  - !ruby/object:Gem::Version
23
- version: 0.7.2
22
+ version: 0.8.1
24
23
  version:
25
24
  - !ruby/object:Gem::Dependency
26
25
  name: activesupport
27
- type: :runtime
28
26
  version_requirement:
29
27
  version_requirements: !ruby/object:Gem::Requirement
30
28
  requirements:
31
29
  - - "="
32
30
  - !ruby/object:Gem::Version
33
- version: 2.0.5
31
+ version: 2.1.0
34
32
  version:
35
33
  - !ruby/object:Gem::Dependency
36
34
  name: activerecord
37
- type: :runtime
38
35
  version_requirement:
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "="
42
39
  - !ruby/object:Gem::Version
43
- version: 2.0.5
40
+ version: 2.1.0
44
41
  version:
45
42
  - !ruby/object:Gem::Dependency
46
43
  name: actionpack
47
- type: :runtime
48
44
  version_requirement:
49
45
  version_requirements: !ruby/object:Gem::Requirement
50
46
  requirements:
51
47
  - - "="
52
48
  - !ruby/object:Gem::Version
53
- version: 2.0.5
49
+ version: 2.1.0
54
50
  version:
55
51
  - !ruby/object:Gem::Dependency
56
52
  name: actionmailer
57
- type: :runtime
58
53
  version_requirement:
59
54
  version_requirements: !ruby/object:Gem::Requirement
60
55
  requirements:
61
56
  - - "="
62
57
  - !ruby/object:Gem::Version
63
- version: 2.0.5
58
+ version: 2.1.0
64
59
  version:
65
60
  - !ruby/object:Gem::Dependency
66
61
  name: activeresource
67
- type: :runtime
68
62
  version_requirement:
69
63
  version_requirements: !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - "="
72
66
  - !ruby/object:Gem::Version
73
- version: 2.0.5
67
+ version: 2.1.0
74
68
  version:
75
69
  description: Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
76
70
  email: david@loudthinking.com
@@ -97,6 +91,7 @@ files:
97
91
  - README
98
92
  - bin/about
99
93
  - bin/console
94
+ - bin/dbconsole
100
95
  - bin/destroy
101
96
  - bin/generate
102
97
  - bin/performance
@@ -129,6 +124,7 @@ files:
129
124
  - configs/initializers
130
125
  - configs/initializers/inflections.rb
131
126
  - configs/initializers/mime_types.rb
127
+ - configs/initializers/new_rails_defaults.rb
132
128
  - configs/lighttpd.conf
133
129
  - configs/routes.rb
134
130
  - doc/README_FOR_APP
@@ -161,6 +157,7 @@ files:
161
157
  - lib/commands
162
158
  - lib/commands/about.rb
163
159
  - lib/commands/console.rb
160
+ - lib/commands/dbconsole.rb
164
161
  - lib/commands/destroy.rb
165
162
  - lib/commands/generate.rb
166
163
  - lib/commands/ncgi
@@ -182,6 +179,7 @@ files:
182
179
  - lib/commands/servers/base.rb
183
180
  - lib/commands/servers/lighttpd.rb
184
181
  - lib/commands/servers/mongrel.rb
182
+ - lib/commands/servers/new_mongrel.rb
185
183
  - lib/commands/servers/webrick.rb
186
184
  - lib/commands/update.rb
187
185
  - lib/commands.rb
@@ -192,6 +190,11 @@ files:
192
190
  - lib/fcgi_handler.rb
193
191
  - lib/initializer.rb
194
192
  - lib/rails
193
+ - lib/rails/gem_builder.rb
194
+ - lib/rails/gem_dependency.rb
195
+ - lib/rails/mongrel_server
196
+ - lib/rails/mongrel_server/commands.rb
197
+ - lib/rails/mongrel_server/handler.rb
195
198
  - lib/rails/plugin
196
199
  - lib/rails/plugin/loader.rb
197
200
  - lib/rails/plugin/locator.rb
@@ -310,6 +313,7 @@ files:
310
313
  - lib/tasks/databases.rake
311
314
  - lib/tasks/documentation.rake
312
315
  - lib/tasks/framework.rake
316
+ - lib/tasks/gems.rake
313
317
  - lib/tasks/log.rake
314
318
  - lib/tasks/misc.rake
315
319
  - lib/tasks/rails.rb
@@ -342,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
346
  requirements: []
343
347
 
344
348
  rubyforge_project: rails
345
- rubygems_version: 1.2.0
349
+ rubygems_version: 1.0.1
346
350
  signing_key:
347
351
  specification_version: 2
348
352
  summary: Web-application framework with template engine, control-flow layer, and ORM.