Skip to content

Commit

Permalink
Merge pull request #6 from miyucy/better-compatibility
Browse files Browse the repository at this point in the history
Better compatibility
  • Loading branch information
courtenay committed Dec 6, 2013
2 parents 00c2d3a + c5957b3 commit 6886f61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/multipass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def decode(data)

CipherError = OpenSSL.const_defined?(:CipherError) ? OpenSSL::CipherError : OpenSSL::Cipher::CipherError

if Object.const_defined?(:ActiveSupport)
include ActiveSupport::Base64
if defined?(::ActiveSupport) && defined?(::ActiveSupport::Base64)
include ::ActiveSupport::Base64
else
require 'base64'
end
Expand Down Expand Up @@ -145,7 +145,7 @@ def self.decode_64(s, url_safe = true)
if Object.const_defined?(:ActiveSupport)
def decode_json(data, s)
ActiveSupport::JSON.decode(s)
rescue ActiveSupport::JSON::ParseError
rescue ActiveSupport::JSON.parse_error
raise MultiPass::JSONError.new(data, s)
end
else
Expand Down

0 comments on commit 6886f61

Please sign in to comment.