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.
- data/CHANGELOG +115 -3
- data/MIT-LICENSE +1 -1
- data/README +67 -14
- data/Rakefile +9 -19
- data/bin/dbconsole +3 -0
- data/bin/rails +0 -0
- data/builtin/rails_info/rails/info.rb +5 -5
- data/configs/apache.conf +0 -0
- data/configs/databases/frontbase.yml +2 -2
- data/configs/databases/mysql.yml +2 -2
- data/configs/databases/oracle.yml +3 -3
- data/configs/databases/postgresql.yml +2 -2
- data/configs/databases/sqlite2.yml +2 -2
- data/configs/databases/sqlite3.yml +2 -2
- data/configs/initializers/new_rails_defaults.rb +15 -0
- data/configs/routes.rb +6 -0
- data/dispatches/dispatch.fcgi +0 -0
- data/dispatches/dispatch.rb +0 -0
- data/environments/boot.rb +1 -0
- data/environments/development.rb +0 -1
- data/environments/environment.rb +15 -7
- data/environments/production.rb +3 -0
- data/environments/test.rb +1 -1
- data/fresh_rakefile +0 -0
- data/helpers/application.rb +5 -0
- data/html/images/rails.png +0 -0
- data/html/index.html +6 -9
- data/html/javascripts/controls.js +1 -1
- data/html/javascripts/dragdrop.js +1 -1
- data/html/javascripts/effects.js +1 -1
- data/lib/commands/console.rb +2 -2
- data/lib/commands/dbconsole.rb +65 -0
- data/lib/commands/generate.rb +0 -0
- data/lib/commands/performance/profiler.rb +1 -1
- data/lib/commands/performance/request.rb +0 -0
- data/lib/commands/plugin.rb +28 -1
- data/lib/commands/server.rb +2 -2
- data/lib/commands/servers/lighttpd.rb +1 -1
- data/lib/commands/servers/mongrel.rb +9 -9
- data/lib/commands/servers/new_mongrel.rb +16 -0
- data/lib/commands/servers/webrick.rb +1 -1
- data/lib/console_app.rb +2 -2
- data/lib/dispatcher.rb +1 -1
- data/lib/fcgi_handler.rb +32 -16
- data/lib/initializer.rb +273 -59
- data/lib/rails/gem_builder.rb +21 -0
- data/lib/rails/gem_dependency.rb +124 -0
- data/lib/rails/mongrel_server/commands.rb +342 -0
- data/lib/rails/mongrel_server/handler.rb +55 -0
- data/lib/rails/plugin.rb +42 -11
- data/lib/rails/plugin/loader.rb +3 -1
- data/lib/rails/plugin/locator.rb +22 -1
- data/lib/rails/version.rb +2 -2
- data/lib/rails_generator/base.rb +1 -1
- data/lib/rails_generator/commands.rb +63 -47
- data/lib/rails_generator/generators/applications/app/app_generator.rb +5 -7
- data/lib/rails_generator/generators/components/controller/templates/controller.rb +1 -4
- data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -1
- data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +1 -1
- data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +2 -6
- data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +8 -6
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
- data/lib/rails_generator/generators/components/migration/USAGE +4 -4
- data/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +1 -1
- data/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -0
- data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +1 -1
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +2 -1
- data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -20
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +3 -4
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +3 -4
- data/lib/rails_generator/lookup.rb +6 -2
- data/lib/rails_generator/options.rb +7 -0
- data/lib/rails_generator/scripts.rb +8 -5
- data/lib/rails_generator/secret_key_generator.rb +12 -8
- data/lib/source_annotation_extractor.rb +40 -0
- data/lib/tasks/databases.rake +52 -27
- data/lib/tasks/framework.rake +22 -29
- data/lib/tasks/gems.rake +64 -0
- data/lib/tasks/misc.rake +47 -0
- data/lib/tasks/testing.rake +1 -1
- data/lib/test_help.rb +8 -0
- metadata +19 -15
data/lib/tasks/framework.rake
CHANGED
@@ -38,40 +38,33 @@ namespace :rails do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
desc
|
41
|
+
desc 'Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0'
|
42
42
|
task :edge do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
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
|
-
|
70
|
-
|
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
|
|
data/lib/tasks/gems.rake
ADDED
@@ -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
|
data/lib/tasks/misc.rake
CHANGED
@@ -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
|
data/lib/tasks/testing.rake
CHANGED
data/lib/test_help.rb
CHANGED
@@ -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
|
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-
|
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.
|
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
|
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
|
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
|
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
|
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
|
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.
|
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.
|