railties 3.0.7 → 3.0.8.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *Rails 3.0.8 (unreleased)*
2
+
3
+ * Fix Rake 0.9.0 support.
4
+
1
5
  *Rails 3.0.7 (April 18, 2011)*
2
6
 
3
7
  *No changes.
@@ -133,9 +133,9 @@ The _setting part_ is easy. You can set the locale in a +before_filter+ in the +
133
133
 
134
134
  <ruby>
135
135
  before_filter :set_locale
136
+
136
137
  def set_locale
137
- # if params[:locale] is nil then I18n.default_locale will be used
138
- I18n.locale = params[:locale]
138
+ I18n.locale = params[:locale] || I18n.default_locale
139
139
  end
140
140
  </ruby>
141
141
 
@@ -158,7 +158,7 @@ You can implement it like this in your +ApplicationController+:
158
158
  before_filter :set_locale
159
159
 
160
160
  def set_locale
161
- I18n.locale = extract_locale_from_tld
161
+ I18n.locale = extract_locale_from_tld || I18n.default_locale
162
162
  end
163
163
 
164
164
  # Get locale from top-level domain or return nil if such locale is not available
@@ -182,7 +182,7 @@ We can also set the locale from the _subdomain_ in a very similar way:
182
182
  # in your /etc/hosts file to try this out locally
183
183
  def extract_locale_from_subdomain
184
184
  parsed_locale = request.subdomains.first
185
- I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale : nil
185
+ I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale : nil
186
186
  end
187
187
  </ruby>
188
188
 
@@ -228,8 +228,8 @@ h4. Learning Rack
228
228
 
229
229
  * "Official Rack Website":http://rack.github.com
230
230
  * "Introducing Rack":http://chneukirchen.org/blog/archive/2007/02/introducing-rack.html
231
- * "Ruby on Rack #1 - Hello Rack!":http://m.onkey.org/2008/11/17/ruby-on-rack-1
232
- * "Ruby on Rack #2 - The Builder":http://m.onkey.org/2008/11/18/ruby-on-rack-2-rack-builder
231
+ * "Ruby on Rack #1 - Hello Rack!":http://m.onkey.org/ruby-on-rack-1-hello-rack
232
+ * "Ruby on Rack #2 - The Builder":http://m.onkey.org/ruby-on-rack-2-the-builder
233
233
 
234
234
  h4. Understanding Middlewares
235
235
 
@@ -247,8 +247,7 @@ h4. Running Tests
247
247
  Running a test is as simple as invoking the file containing the test cases through Ruby:
248
248
 
249
249
  <shell>
250
- $ cd test
251
- $ ruby unit/post_test.rb
250
+ $ ruby -Itest test/unit/post_test.rb
252
251
 
253
252
  Loaded suite unit/post_test
254
253
  Started
@@ -258,12 +257,12 @@ Finished in 0.023513 seconds.
258
257
  1 tests, 1 assertions, 0 failures, 0 errors
259
258
  </shell>
260
259
 
261
- This will run all the test methods from the test case.
260
+ This will run all the test methods from the test case. Note that +test_helper.rb+ is in the +test+ directory, hence this directory needs to be added to the load path using the +-I+ switch.
262
261
 
263
262
  You can also run a particular test method from the test case by using the +-n+ switch with the +test method name+.
264
263
 
265
264
  <shell>
266
- $ ruby -Itest test/unit/post_test.rb -n test_the_truth
265
+ $ ruby -Itest test/unit/post_test.rb -n test_truth
267
266
 
268
267
  Loaded suite unit/post_test
269
268
  Started
@@ -211,10 +211,12 @@ module Rails
211
211
  end
212
212
 
213
213
  def initialize_tasks
214
- require "rails/tasks"
215
- task :environment do
216
- $rails_rake_task = true
217
- require_environment!
214
+ self.class.rake_tasks do
215
+ require "rails/tasks"
216
+ task :environment do
217
+ $rails_rake_task = true
218
+ require_environment!
219
+ end
218
220
  end
219
221
  end
220
222
 
@@ -47,6 +47,6 @@ module Rails
47
47
  end
48
48
 
49
49
  # Has to set the RAILS_ENV before config/application is required
50
- if ARGV.first && !ARGV.first.index("-") && env = ARGV.pop # has to pop the env ARGV so IRB doesn't freak
50
+ if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift # has to shift the env ARGV so IRB doesn't freak
51
51
  ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
52
52
  end
@@ -1,4 +1,10 @@
1
1
  require 'erb'
2
+
3
+ begin
4
+ require 'psych'
5
+ rescue LoadError
6
+ end
7
+
2
8
  require 'yaml'
3
9
  require 'optparse'
4
10
  require 'rbconfig'
@@ -405,6 +405,13 @@ module Rails
405
405
  end
406
406
  end
407
407
 
408
+ def version_constraint_for_database_gem
409
+ case options[:database]
410
+ when "mysql" then "~> 0.2.6"
411
+ else nil
412
+ end
413
+ end
414
+
408
415
  def mysql_socket
409
416
  @mysql_socket ||= [
410
417
  "/tmp/mysql.sock", # default
@@ -12,7 +12,7 @@ gem 'rails', '<%= Rails::VERSION::STRING %>'
12
12
  <%- end -%>
13
13
 
14
14
  <% unless options[:skip_active_record] -%>
15
- gem '<%= gem_for_database %>'
15
+ gem '<%= gem_for_database %>'<%= ", '#{version_constraint_for_database_gem}'" if version_constraint_for_database_gem %>
16
16
  <% end -%>
17
17
 
18
18
  # Use unicorn as the web server
@@ -181,6 +181,7 @@ module Rails
181
181
  end
182
182
 
183
183
  def load_tasks
184
+ extend Rake::DSL if defined? Rake::DSL
184
185
  self.class.rake_tasks.each(&:call)
185
186
  end
186
187
 
@@ -2,8 +2,8 @@ module Rails
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- TINY = 7
6
- PRE = nil
5
+ TINY = 8
6
+ PRE = "rc1"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease:
4
+ hash: 15424055
5
+ prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
- - 7
10
- version: 3.0.7
9
+ - 8
10
+ - rc
11
+ - 1
12
+ version: 3.0.8.rc1
11
13
  platform: ruby
12
14
  authors:
13
15
  - David Heinemeier Hansson
@@ -15,7 +17,7 @@ autorequire:
15
17
  bindir: bin
16
18
  cert_chain: []
17
19
 
18
- date: 2011-04-18 00:00:00 Z
20
+ date: 2011-05-25 00:00:00 Z
19
21
  dependencies:
20
22
  - !ruby/object:Gem::Dependency
21
23
  name: rake
@@ -57,12 +59,14 @@ dependencies:
57
59
  requirements:
58
60
  - - "="
59
61
  - !ruby/object:Gem::Version
60
- hash: 9
62
+ hash: 15424055
61
63
  segments:
62
64
  - 3
63
65
  - 0
64
- - 7
65
- version: 3.0.7
66
+ - 8
67
+ - rc
68
+ - 1
69
+ version: 3.0.8.rc1
66
70
  type: :runtime
67
71
  version_requirements: *id003
68
72
  - !ruby/object:Gem::Dependency
@@ -73,12 +77,14 @@ dependencies:
73
77
  requirements:
74
78
  - - "="
75
79
  - !ruby/object:Gem::Version
76
- hash: 9
80
+ hash: 15424055
77
81
  segments:
78
82
  - 3
79
83
  - 0
80
- - 7
81
- version: 3.0.7
84
+ - 8
85
+ - rc
86
+ - 1
87
+ version: 3.0.8.rc1
82
88
  type: :runtime
83
89
  version_requirements: *id004
84
90
  description: "Rails internals: application bootup, plugins, generators, and rake tasks."
@@ -479,16 +485,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
479
485
  required_rubygems_version: !ruby/object:Gem::Requirement
480
486
  none: false
481
487
  requirements:
482
- - - ">="
488
+ - - ">"
483
489
  - !ruby/object:Gem::Version
484
- hash: 3
490
+ hash: 25
485
491
  segments:
486
- - 0
487
- version: "0"
492
+ - 1
493
+ - 3
494
+ - 1
495
+ version: 1.3.1
488
496
  requirements: []
489
497
 
490
498
  rubyforge_project: rails
491
- rubygems_version: 1.7.2
499
+ rubygems_version: 1.8.2
492
500
  signing_key:
493
501
  specification_version: 3
494
502
  summary: Tools for creating, working with, and running Rails applications.