rails 2.3.5 → 2.3.6

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,8 +1,14 @@
1
- *Edge*
1
+ *2.3.6 (May 23, 2010)*
2
+
3
+ * Added config/initializers/cookie_verification_secret.rb with an auto-generated secret for using ActionController::Base#cookies.signed [DHH]
2
4
 
3
5
  * Fixed that the debugger wouldn't go into IRB mode because of left-over ARGVs [DHH]
4
6
 
5
- * 1.9 compatibility
7
+
8
+ *2.3.5 (November 25, 2009)*
9
+
10
+ * Ruby 1.9 compatibility
11
+
6
12
 
7
13
  *2.3.4 (September 4, 2009)*
8
14
 
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2009 David Heinemeier Hansson
1
+ Copyright (c) 2004-2010 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -314,11 +314,11 @@ spec = Gem::Specification.new do |s|
314
314
  EOF
315
315
 
316
316
  s.add_dependency('rake', '>= 0.8.3')
317
- s.add_dependency('activesupport', '= 2.3.5' + PKG_BUILD)
318
- s.add_dependency('activerecord', '= 2.3.5' + PKG_BUILD)
319
- s.add_dependency('actionpack', '= 2.3.5' + PKG_BUILD)
320
- s.add_dependency('actionmailer', '= 2.3.5' + PKG_BUILD)
321
- s.add_dependency('activeresource', '= 2.3.5' + PKG_BUILD)
317
+ s.add_dependency('activesupport', '= 2.3.6' + PKG_BUILD)
318
+ s.add_dependency('activerecord', '= 2.3.6' + PKG_BUILD)
319
+ s.add_dependency('actionpack', '= 2.3.6' + PKG_BUILD)
320
+ s.add_dependency('actionmailer', '= 2.3.6' + PKG_BUILD)
321
+ s.add_dependency('activeresource', '= 2.3.6' + PKG_BUILD)
322
322
 
323
323
  s.rdoc_options << '--exclude' << '.'
324
324
  s.has_rdoc = false
data/bin/rails CHANGED
@@ -1,19 +1,20 @@
1
- require File.dirname(__FILE__) + '/../lib/ruby_version_check'
1
+ $:.unshift File.expand_path("../../lib", __FILE__)
2
+
3
+ require 'ruby_version_check'
2
4
  Signal.trap("INT") { puts; exit }
3
5
 
4
- require File.dirname(__FILE__) + '/../lib/rails/version'
6
+ require 'rails/version'
5
7
  if %w(--version -v).include? ARGV.first
6
8
  puts "Rails #{Rails::VERSION::STRING}"
7
9
  exit(0)
8
10
  end
9
11
 
10
12
  freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
11
-
12
13
  app_path = ARGV.first
13
14
 
14
- require File.dirname(__FILE__) + '/../lib/rails_generator'
15
-
15
+ require 'rails_generator'
16
16
  require 'rails_generator/scripts/generate'
17
+
17
18
  Rails::Generator::Base.use_application_sources!
18
19
  Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
19
20
 
@@ -38,7 +38,7 @@ module Rails
38
38
  def freeze_edge_version
39
39
  if File.exist?(rails_vendor_root)
40
40
  begin
41
- Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first
41
+ File.readlines(File.join(rails_vendor_root,'REVISION')).first.strip
42
42
  rescue
43
43
  Dir[File.join(rails_vendor_root, 'TAG_*')].first.scan(/_(.+)$/).first.first rescue 'unknown'
44
44
  end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ ActionController::Base.cookie_verifier_secret = '<%= app_secret %>';
@@ -1255,8 +1255,8 @@ You'll also need to modify +views/posts/_form.html.erb+ to include the tags:
1255
1255
  </p>
1256
1256
  <% unless tag_form.object.nil? || tag_form.object.new_record? %>
1257
1257
  <p>
1258
- <%= tag_form.label :_delete, 'Remove:' %>
1259
- <%= tag_form.check_box :_delete %>
1258
+ <%= tag_form.label :_destroy, 'Remove:' %>
1259
+ <%= tag_form.check_box :_destroy %>
1260
1260
  </p>
1261
1261
  <% end %>
1262
1262
  <% end %>
@@ -45,7 +45,7 @@ def find_cmd(*commands)
45
45
  end
46
46
 
47
47
  case config["adapter"]
48
- when "mysql"
48
+ when /^mysql/
49
49
  args = {
50
50
  'host' => '--host',
51
51
  'port' => '--port',
@@ -18,7 +18,7 @@ ARGV.clone.options do |opts|
18
18
  opts.on("-h", "--help",
19
19
  "Show this help message.") { $stderr.puts opts; exit }
20
20
 
21
- if RUBY_PLATFORM !~ /mswin/
21
+ if RUBY_PLATFORM !~ /(:?mswin|mingw)/
22
22
  opts.separator ""
23
23
  opts.separator "You can also use runner as a shebang line for your scripts like this:"
24
24
  opts.separator "-------------------------------------------------------------"
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2004-2009 David Heinemeier Hansson
2
+ # Copyright (c) 2004-2010 David Heinemeier Hansson
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -83,7 +83,7 @@ module Rails
83
83
  specification.dependencies.reject do |dependency|
84
84
  dependency.type == :development
85
85
  end.map do |dependency|
86
- GemDependency.new(dependency.name, :requirement => dependency.version_requirements)
86
+ GemDependency.new(dependency.name, :requirement => (dependency.respond_to?(:requirement) ? dependency.requirement : dependency.version_requirements))
87
87
  end
88
88
  end
89
89
 
@@ -115,9 +115,16 @@ module Rails
115
115
  @spec = s
116
116
  end
117
117
 
118
- def requirement
119
- r = version_requirements
120
- (r == Gem::Requirement.default) ? nil : r
118
+ if method_defined?(:requirement)
119
+ def requirement
120
+ req = super
121
+ req unless req == Gem::Requirement.default
122
+ end
123
+ else
124
+ def requirement
125
+ req = version_requirements
126
+ req unless req == Gem::Requirement.default
127
+ end
121
128
  end
122
129
 
123
130
  def built?
@@ -37,7 +37,7 @@ module Rails
37
37
  # handle vendor Rails gems - they are identified by having loaded_from set to ""
38
38
  # we add them manually to the list, so that other gems can find them via dependencies
39
39
  Gem.loaded_specs.each do |n, s|
40
- next unless s.loaded_from.empty?
40
+ next unless s.loaded_from.to_s.empty?
41
41
  vendor_gems[s.full_name] = s
42
42
  end
43
43
 
@@ -2,7 +2,7 @@ module Rails
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 3
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -21,8 +21,11 @@
21
21
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  #++
23
23
 
24
- $:.unshift(File.dirname(__FILE__))
25
- $:.unshift(File.dirname(__FILE__) + "/../../activesupport/lib")
24
+ railties = File.expand_path("..", __FILE__)
25
+ $:.unshift(railties) unless $:.include?(railties)
26
+
27
+ activesupport = File.expand_path("../../../activesupport/lib", __FILE__)
28
+ $:.unshift(activesupport) unless $:.include?(activesupport)
26
29
 
27
30
  begin
28
31
  require 'active_support'
@@ -12,12 +12,13 @@ module Rails
12
12
 
13
13
  def field_type
14
14
  @field_type ||= case type
15
- when :integer, :float, :decimal then :text_field
16
- when :datetime, :timestamp, :time then :datetime_select
17
- when :date then :date_select
18
- when :string then :text_field
19
- when :text then :text_area
20
- when :boolean then :check_box
15
+ when :integer, :float, :decimal then :text_field
16
+ when :time then :time_select
17
+ when :datetime, :timestamp then :datetime_select
18
+ when :date then :date_select
19
+ when :string then :text_field
20
+ when :text then :text_area
21
+ when :boolean then :check_box
21
22
  else
22
23
  :text_field
23
24
  end
@@ -193,6 +193,9 @@ class AppGenerator < Rails::Generator::Base
193
193
 
194
194
  m.template "configs/initializers/session_store.rb", "config/initializers/session_store.rb",
195
195
  :assigns => { :app_name => @app_name, :app_secret => ActiveSupport::SecureRandom.hex(64) }
196
+
197
+ m.template "configs/initializers/cookie_verification_secret.rb", "config/initializers/cookie_verification_secret.rb",
198
+ :assigns => { :app_secret => ActiveSupport::SecureRandom.hex(64) }
196
199
  end
197
200
 
198
201
  def create_locale_file(m)
@@ -11,9 +11,13 @@ two:
11
11
  <%= attribute.name %>: <%= attribute.default %>
12
12
  <% end -%>
13
13
  <% else -%>
14
- # one:
15
- # column: value
14
+ # This model initially had no columns defined. If you add columns to the
15
+ # model remove the '{}' from the fixture names and add the columns immediately
16
+ # below each fixture, per the syntax in the comments below
16
17
  #
17
- # two:
18
- # column: value
19
- <% end -%>
18
+ one: {}
19
+ # column: value
20
+ #
21
+ two: {}
22
+ # column: value
23
+ <% end -%>
@@ -13,7 +13,7 @@ class PluginGenerator < Rails::Generator::NamedBase
13
13
  m.class_collisions class_name
14
14
 
15
15
  m.directory "#{plugin_path}/lib"
16
- m.directory "#{plugin_path}/tasks"
16
+ m.directory "#{plugin_path}/lib/tasks"
17
17
  m.directory "#{plugin_path}/test"
18
18
 
19
19
  m.template 'README', "#{plugin_path}/README"
@@ -23,7 +23,7 @@ class PluginGenerator < Rails::Generator::NamedBase
23
23
  m.template 'install.rb', "#{plugin_path}/install.rb"
24
24
  m.template 'uninstall.rb', "#{plugin_path}/uninstall.rb"
25
25
  m.template 'plugin.rb', "#{plugin_path}/lib/#{file_name}.rb"
26
- m.template 'tasks.rake', "#{plugin_path}/tasks/#{file_name}_tasks.rake"
26
+ m.template 'tasks.rake', "#{plugin_path}/lib/tasks/#{file_name}.rake"
27
27
  m.template 'unit_test.rb', "#{plugin_path}/test/#{file_name}_test.rb"
28
28
  m.template 'test_helper.rb', "#{plugin_path}/test/test_helper.rb"
29
29
  if @with_generator
@@ -44,8 +44,7 @@ class <%= controller_class_name %>Controller < ApplicationController
44
44
 
45
45
  respond_to do |format|
46
46
  if @<%= file_name %>.save
47
- flash[:notice] = '<%= class_name %> was successfully created.'
48
- format.html { redirect_to(@<%= file_name %>) }
47
+ format.html { redirect_to(@<%= file_name %>, :notice => '<%= class_name %> was successfully created.') }
49
48
  format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
50
49
  else
51
50
  format.html { render :action => "new" }
@@ -61,8 +60,7 @@ class <%= controller_class_name %>Controller < ApplicationController
61
60
 
62
61
  respond_to do |format|
63
62
  if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
64
- flash[:notice] = '<%= class_name %> was successfully updated.'
65
- format.html { redirect_to(@<%= file_name %>) }
63
+ format.html { redirect_to(@<%= file_name %>, :notice => '<%= class_name %> was successfully updated.') }
66
64
  format.xml { head :ok }
67
65
  else
68
66
  format.html { render :action => "edit" }
@@ -9,7 +9,7 @@
9
9
  </head>
10
10
  <body>
11
11
 
12
- <p style="color: green"><%%= flash[:notice] %></p>
12
+ <p style="color: green"><%%= notice %></p>
13
13
 
14
14
  <%%= yield %>
15
15
 
@@ -94,11 +94,7 @@ namespace :db do
94
94
  desc 'Drops the database for the current RAILS_ENV'
95
95
  task :drop => :load_config do
96
96
  config = ActiveRecord::Base.configurations[RAILS_ENV || 'development']
97
- begin
98
- drop_database(config)
99
- rescue Exception => e
100
- puts "Couldn't drop #{config['database']} : #{e.inspect}"
101
- end
97
+ drop_database(config)
102
98
  end
103
99
 
104
100
  def local_database?(config, &block)
@@ -410,15 +406,19 @@ namespace :db do
410
406
  end
411
407
 
412
408
  def drop_database(config)
413
- case config['adapter']
414
- when 'mysql'
415
- ActiveRecord::Base.establish_connection(config)
416
- ActiveRecord::Base.connection.drop_database config['database']
417
- when /^sqlite/
418
- FileUtils.rm(File.join(RAILS_ROOT, config['database']))
419
- when 'postgresql'
420
- ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
421
- ActiveRecord::Base.connection.drop_database config['database']
409
+ begin
410
+ case config['adapter']
411
+ when 'mysql'
412
+ ActiveRecord::Base.establish_connection(config)
413
+ ActiveRecord::Base.connection.drop_database config['database']
414
+ when /^sqlite/
415
+ FileUtils.rm(File.join(RAILS_ROOT, config['database']))
416
+ when 'postgresql'
417
+ ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
418
+ ActiveRecord::Base.connection.drop_database config['database']
419
+ end
420
+ rescue Exception => e
421
+ puts "Couldn't drop #{config['database']} : #{e.inspect}"
422
422
  end
423
423
  end
424
424
 
@@ -64,7 +64,10 @@ namespace :rails do
64
64
  rm_f goner
65
65
  end
66
66
 
67
- touch "rails/REVISION_#{latest_revision}"
67
+ puts "Frozen to git revision #{latest_revision}"
68
+ File.open('rails/REVISION', 'w') do |revision|
69
+ revision.puts latest_revision
70
+ end
68
71
  end
69
72
 
70
73
  puts 'Updating current scripts, javascripts, and configuration settings'
@@ -4,6 +4,11 @@ $VERBOSE = nil
4
4
  Dir["#{File.dirname(__FILE__)}/*.rake"].each { |ext| load ext }
5
5
 
6
6
  # Load any custom rakefile extensions
7
- Dir["#{RAILS_ROOT}/vendor/plugins/*/tasks/**/*.rake"].sort.each { |ext| load ext }
7
+ deprecated_paths = Dir["#{RAILS_ROOT}/vendor/plugins/*/tasks/**/*.rake"].sort
8
+ if deprecated_paths.any?
9
+ plugins = deprecated_paths.map { |p| $1 if p =~ %r((vendor/plugins/[^/]+/tasks)) }.compact
10
+ ActiveSupport::Deprecation.warn "Rake tasks in #{plugins.to_sentence} are deprecated. Use lib/tasks instead."
11
+ deprecated_paths.each { |ext| load ext }
12
+ end
8
13
  Dir["#{RAILS_ROOT}/vendor/plugins/*/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
9
14
  Dir["#{RAILS_ROOT}/lib/tasks/**/*.rake"].sort.each { |ext| load ext }
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.5
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 3
8
+ - 6
9
+ version: 2.3.6
5
10
  platform: ruby
6
11
  authors:
7
12
  - David Heinemeier Hansson
@@ -9,69 +14,93 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-11-27 00:00:00 +13:00
17
+ date: 2010-05-23 00:00:00 -07:00
13
18
  default_executable: rails
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rake
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 8
30
+ - 3
23
31
  version: 0.8.3
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: activesupport
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - "="
32
40
  - !ruby/object:Gem::Version
33
- version: 2.3.5
34
- version:
41
+ segments:
42
+ - 2
43
+ - 3
44
+ - 6
45
+ version: 2.3.6
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: activerecord
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
40
52
  requirements:
41
53
  - - "="
42
54
  - !ruby/object:Gem::Version
43
- version: 2.3.5
44
- version:
55
+ segments:
56
+ - 2
57
+ - 3
58
+ - 6
59
+ version: 2.3.6
60
+ type: :runtime
61
+ version_requirements: *id003
45
62
  - !ruby/object:Gem::Dependency
46
63
  name: actionpack
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
50
66
  requirements:
51
67
  - - "="
52
68
  - !ruby/object:Gem::Version
53
- version: 2.3.5
54
- version:
69
+ segments:
70
+ - 2
71
+ - 3
72
+ - 6
73
+ version: 2.3.6
74
+ type: :runtime
75
+ version_requirements: *id004
55
76
  - !ruby/object:Gem::Dependency
56
77
  name: actionmailer
57
- type: :runtime
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
60
80
  requirements:
61
81
  - - "="
62
82
  - !ruby/object:Gem::Version
63
- version: 2.3.5
64
- version:
83
+ segments:
84
+ - 2
85
+ - 3
86
+ - 6
87
+ version: 2.3.6
88
+ type: :runtime
89
+ version_requirements: *id005
65
90
  - !ruby/object:Gem::Dependency
66
91
  name: activeresource
67
- type: :runtime
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
70
94
  requirements:
71
95
  - - "="
72
96
  - !ruby/object:Gem::Version
73
- version: 2.3.5
74
- version:
97
+ segments:
98
+ - 2
99
+ - 3
100
+ - 6
101
+ version: 2.3.6
102
+ type: :runtime
103
+ version_requirements: *id006
75
104
  description: " Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick\n on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.\n"
76
105
  email: david@loudthinking.com
77
106
  executables:
@@ -110,6 +139,7 @@ files:
110
139
  - configs/databases/sqlite3.yml
111
140
  - configs/empty.log
112
141
  - configs/initializers/backtrace_silencers.rb
142
+ - configs/initializers/cookie_verification_secret.rb
113
143
  - configs/initializers/inflections.rb
114
144
  - configs/initializers/mime_types.rb
115
145
  - configs/initializers/new_rails_defaults.rb
@@ -400,7 +430,7 @@ files:
400
430
  - lib/tasks/tmp.rake
401
431
  - lib/test_help.rb
402
432
  - lib/webrick_server.rb
403
- has_rdoc: false
433
+ has_rdoc: true
404
434
  homepage: http://www.rubyonrails.org
405
435
  licenses: []
406
436
 
@@ -414,18 +444,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
414
444
  requirements:
415
445
  - - ">="
416
446
  - !ruby/object:Gem::Version
447
+ segments:
448
+ - 0
417
449
  version: "0"
418
- version:
419
450
  required_rubygems_version: !ruby/object:Gem::Requirement
420
451
  requirements:
421
452
  - - ">="
422
453
  - !ruby/object:Gem::Version
454
+ segments:
455
+ - 0
423
456
  version: "0"
424
- version:
425
457
  requirements: []
426
458
 
427
459
  rubyforge_project: rails
428
- rubygems_version: 1.3.5
460
+ rubygems_version: 1.3.6
429
461
  signing_key:
430
462
  specification_version: 3
431
463
  summary: Web-application framework with template engine, control-flow layer, and ORM.