Skip to content

Commit cae2519

Browse files
author
David Heinemeier Hansson
committed
Merge branch 'master' of github.com:rails/rails
2 parents d57397c + a0bb1dd commit cae2519

File tree

14 files changed

+44
-21
lines changed

14 files changed

+44
-21
lines changed

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ elsif RUBY_ENGINE == "jruby"
2121
gem "jruby-openssl"
2222
end
2323

24+
# AS
25+
gem "memcache-client", ">= 1.7.5"
26+
27+
# AM
28+
gem "text-format", "~> 1.0.0"
29+
2430
# AR
2531
if mri || RUBY_ENGINE == "rbx"
2632
gem "sqlite3-ruby", "= 1.3.0.beta.2", :require => 'sqlite3'

actionmailer/actionmailer.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ Gem::Specification.new do |s|
2121

2222
s.add_dependency('actionpack', version)
2323
s.add_dependency('mail', '~> 2.2.1')
24-
s.add_dependency('text-format', '~> 1.0.0')
2524
end

actionmailer/lib/action_mailer.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,3 @@ module ActionMailer
4949
autoload :TestCase
5050
autoload :TestHelper
5151
end
52-
53-
module Text
54-
extend ActiveSupport::Autoload
55-
56-
autoload :Format, 'text/format'
57-
end

actionmailer/lib/action_mailer/mail_helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ module MailHelper
33
# Uses Text::Format to take the text and format it, indented two spaces for
44
# each line, and wrapped at 72 columns.
55
def block_format(text)
6+
begin
7+
require 'text/format'
8+
rescue LoadError => e
9+
$stderr.puts "You don't have text-format installed in your application. Please add it to your Gemfile and run bundle install"
10+
raise e
11+
end unless defined?(Text::Format)
12+
613
formatted = text.split(/\n\r\n/).collect { |paragraph|
714
Text::Format.new(
815
:columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph

actionpack/actionpack.gemspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Gem::Specification.new do |s|
2121

2222
s.add_dependency('activesupport', version)
2323
s.add_dependency('activemodel', version)
24+
s.add_dependency('builder', '~> 2.1.2')
2425
s.add_dependency('i18n', '~> 0.4.0')
2526
s.add_dependency('rack', '~> 1.1.0')
2627
s.add_dependency('rack-test', '~> 0.5.4')
2728
s.add_dependency('rack-mount', '~> 0.6.3')
29+
s.add_dependency('tzinfo', '~> 0.3.16')
2830
s.add_dependency('erubis', '~> 2.6.5')
2931
end

activemodel/activemodel.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
2020
s.has_rdoc = true
2121

2222
s.add_dependency('activesupport', version)
23+
s.add_dependency('builder', '~> 2.1.2')
2324
s.add_dependency('i18n', '~> 0.4.0')
2425
end

activemodel/lib/active_model/errors.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ def to_xml(options={})
170170
end
171171
end
172172

173-
# Adds an error message (+messsage+) to the +attribute+, which will be returned on a call to <tt>on(attribute)</tt>
174-
# for the same attribute and ensure that this error object returns false when asked if <tt>empty?</tt>. More than one
175-
# error can be added to the same +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
176-
# If no +messsage+ is supplied, :invalid is assumed.
173+
# Adds +message+ to the error messages on +attribute+, which will be returned on a call to
174+
# <tt>on(attribute)</tt> for the same attribute. More than one error can be added to the same
175+
# +attribute+ in which case an array will be returned on a call to <tt>on(attribute)</tt>.
176+
# If no +message+ is supplied, <tt>:invalid</tt> is assumed.
177177
#
178-
# If +message+ is a Symbol, it will be translated, using the appropriate scope (see translate_error).
179-
# If +message+ is a Proc, it will be called, allowing for things like Time.now to be used within an error
178+
# If +message+ is a symbol, it will be translated using the appropriate scope (see +translate_error+).
179+
# If +message+ is a proc, it will be called, allowing for things like <tt>Time.now</tt> to be used within an error.
180180
def add(attribute, message = nil, options = {})
181181
message ||= :invalid
182182
message = generate_message(attribute, message, options) if message.is_a?(Symbol)

activerecord/activerecord.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ Gem::Specification.new do |s|
2424
s.add_dependency('activesupport', version)
2525
s.add_dependency('activemodel', version)
2626
s.add_dependency('arel', '~> 0.3.3')
27+
s.add_dependency('tzinfo', '~> 0.3.16')
2728
end

activesupport/activesupport.gemspec

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,4 @@ Gem::Specification.new do |s|
1818
s.require_path = 'lib'
1919

2020
s.has_rdoc = true
21-
22-
s.add_dependency('tzinfo', '~> 0.3.16')
23-
s.add_dependency('builder', '~> 2.1.2')
24-
s.add_dependency('memcache-client', '>= 1.7.5')
2521
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
begin
2+
require 'builder'
3+
rescue LoadError => e
4+
$stderr.puts "You don't have builder installed in your application. Please add it to your Gemfile and run bundle install"
5+
raise e
6+
end

activesupport/lib/active_support/cache/mem_cache_store.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
require 'memcache'
1+
begin
2+
require 'memcache'
3+
rescue LoadError => e
4+
$stderr.puts "You don't have memcache installed in your application. Please add it to your Gemfile and run bundle install"
5+
raise e
6+
end
27
require 'digest/md5'
38

49
module ActiveSupport

activesupport/lib/active_support/core_ext/array/conversions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def to_formatted_s(format = :default)
134134
# </messages>
135135
#
136136
def to_xml(options = {})
137-
require 'builder' unless defined?(Builder)
137+
require 'active_support/builder' unless defined?(Builder)
138138

139139
options = options.dup
140140
options[:indent] ||= 2

activesupport/lib/active_support/core_ext/hash/conversions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Hash
5555
# configure your own builder with the <tt>:builder</tt> option. The method also accepts
5656
# options like <tt>:dasherize</tt> and friends, they are forwarded to the builder.
5757
def to_xml(options = {})
58-
require 'builder' unless defined?(Builder)
58+
require 'active_support/builder' unless defined?(Builder)
5959

6060
options = options.dup
6161
options[:indent] ||= 2

activesupport/lib/active_support/values/time_zone.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
require 'active_support/core_ext/object/blank'
22
require 'active_support/core_ext/object/try'
3+
begin
4+
require 'tzinfo'
5+
rescue LoadError => e
6+
$stderr.puts "You don't have tzinfo installed in your application. Please add it to your Gemfile and run bundle install"
7+
raise e
8+
end
39

410
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
511
#
@@ -313,7 +319,7 @@ def period_for_local(time, dst=true)
313319

314320
# TODO: Preload instead of lazy load for thread safety
315321
def self.find_tzinfo(name)
316-
require 'tzinfo' unless defined?(::TZInfo)
322+
require 'active_support/tzinfo' unless defined?(::TZInfo)
317323
::TZInfo::TimezoneProxy.new(MAPPING[name] || name)
318324
end
319325

0 commit comments

Comments
 (0)