Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making further changes for active support removal

  • Loading branch information...
commit 8bea8ede624e81fb4704e66097a1c8cf35f8de8d 1 parent 6eb4c44
Mikel Lindsaar authored
5 Gemfile
View
@@ -1,10 +1,15 @@
source :rubygems
+gem "activesupport", ">= 2.3.6"
gem "tlsmail" if RUBY_VERSION <= '1.8.6'
gem "mime-types", "~> 1.16"
gem "treetop", "~> 1.4.8"
gem "i18n", ">= 0.4.0"
+if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
+ gem 'jruby-openssl'
+end
+
group :test do
gem "ZenTest", "~> 4.4.0"
gem "rake", "~> 0.8.7"
4 lib/VERSION
View
@@ -1,4 +1,4 @@
major:2
-minor:2
-patch:18
+minor:3
+patch:0
build:
23 lib/mail.rb
View
@@ -26,20 +26,25 @@ module Mail # :doc:
require 'mail/version'
- # Only load our extensions if AS is not already loaded
- unless defined?(ActiveSupport)
- require 'mail/core_extensions/nil'
- require 'mail/core_extensions/string'
+ require 'mail/core_extensions/nil'
+ require 'mail/core_extensions/object'
+ require 'mail/core_extensions/string'
+ require 'mail/core_extensions/shellwords' unless String.new.respond_to?(:shellescape)
+ require 'mail/core_extensions/smtp' if RUBY_VERSION < '1.9.3'
+ require 'mail/indifferent_hash'
+
+ # Only load our multibyte extensions if AS is not already loaded
+ if defined?(ActiveSupport)
+ puts("====================================================")
+ puts(" USING ACTIVE SUPPORT ")
+ puts("====================================================")
+ require 'active_support/core_ext/string'
+ else
require 'mail/core_extensions/string/access'
require 'mail/core_extensions/string/multibyte'
- require 'mail/core_extensions/object'
require 'mail/multibyte'
- require 'mail/indifferent_hash'
end
- require 'mail/core_extensions/shellwords' unless String.new.respond_to?(:shellescape)
- require 'mail/core_extensions/smtp' if RUBY_VERSION < '1.9.3'
-
require 'mail/patterns'
require 'mail/utilities'
require 'mail/configuration'
2  lib/mail/core_extensions/nil.rb
View
@@ -1,5 +1,7 @@
# encoding: utf-8
+# This is not loaded if ActiveSupport is already loaded
+
class NilClass #:nodoc:
def to_crlf
''
4 lib/mail/core_extensions/object.rb
View
@@ -1,3 +1,7 @@
+# encoding: utf-8
+
+# This is not loaded if ActiveSupport is already loaded
+
class Object
def blank?
if respond_to?(:empty?)
2  lib/mail/core_extensions/shellwords.rb
View
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
# The following is imported from ruby 1.9.2 shellwords.rb
#
module Shellwords
1  lib/mail/core_extensions/smtp.rb
View
@@ -1,3 +1,4 @@
+# encoding: utf-8
module Net
class SMTP
# This is a backport of r30294 from ruby trunk because of a bug in net/smtp.
2  lib/mail/core_extensions/string.rb
View
@@ -20,7 +20,7 @@ def ascii_only?
!(self =~ /[^#{US_ASCII_REGEXP}]/)
end
end
-
+
def not_ascii_only?
!ascii_only?
end
6 lib/mail/core_extensions/string/access.rb
View
@@ -1,3 +1,9 @@
+# encoding: utf-8
+
+# This is not loaded if ActiveSupport is already loaded
+
+# This is an almost cut and paste from ActiveSupport v3.0.6, copied in here so that Mail
+# itself does not depend on ActiveSupport to avoid versioning conflicts
class String
unless '1.9'.respond_to?(:force_encoding)
6 lib/mail/core_extensions/string/multibyte.rb
View
@@ -1,4 +1,10 @@
# encoding: utf-8
+
+# This is not loaded if ActiveSupport is already loaded
+
+# This is an almost cut and paste from ActiveSupport v3.0.6, copied in here so that Mail
+# itself does not depend on ActiveSupport to avoid versioning conflicts
+
require 'mail/multibyte'
class String
6 lib/mail/indifferent_hash.rb
View
@@ -1,5 +1,9 @@
+# encoding: utf-8
+
+# This is an almost cut and paste from ActiveSupport v3.0.6, copied in here so that Mail
+# itself does not depend on ActiveSupport to avoid versioning conflicts
+
module Mail
- # Sort of like ActiveSupport HashWithIndifferentAccess, but lighter
class IndifferentHash < Hash
def initialize(constructor = {})
4 mail.gemspec
View
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG.rdoc", "TODO.rdoc"]
- s.add_dependency('activesupport', ">= 2.3.6")
s.add_dependency('mime-types', "~> 1.16")
s.add_dependency('treetop', '~> 1.4.8')
s.add_dependency('i18n', '>= 0.4.0')
+ s.add_dependency('jruby-openssl') if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
s.add_dependency('tlsmail', '~> 0.0.1') if RUBY_VERSION == '1.8.6'
s.require_path = 'lib'
- s.files = %w(README.rdoc Rakefile TODO.rdoc) + Dir.glob("lib/**/*")
+ s.files = %w(README.rdoc CHANGELOG.rdoc Dependencies.txt Gemfile Rakefile TODO.rdoc) + Dir.glob("lib/**/*")
end
Please sign in to comment.
Something went wrong with that request. Please try again.