Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better compatibility #6

Merged
merged 2 commits into from
Dec 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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