From aedd3779ef10c84c3ff9ea61c0bcfcd6fb226efe Mon Sep 17 00:00:00 2001 From: Yuki MIYAUCHI Date: Fri, 5 Jul 2013 22:34:18 +0900 Subject: [PATCH 1/2] add ActiveSupport::Base64 check. ActiveSupport::Base64 was deleted in ActiveSupport 4.0. https://github.com/rails/rails/commit/44df252382cc2301364495ff65563d23bcc1b070 --- lib/multipass.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/multipass.rb b/lib/multipass.rb index 54a33c6..d28159d 100644 --- a/lib/multipass.rb +++ b/lib/multipass.rb @@ -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 From c5957b3e88a56beda657e8019bb59ec60251c57a Mon Sep 17 00:00:00 2001 From: Yuki MIYAUCHI Date: Fri, 5 Jul 2013 22:36:06 +0900 Subject: [PATCH 2/2] change to ActiveSupport::JSON.parse_error to catch JSON parse error. https://github.com/rails/rails/commit/053a0f6ac48d35fd39d385df5d810078e92c521e --- lib/multipass.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/multipass.rb b/lib/multipass.rb index d28159d..ac9f0fa 100644 --- a/lib/multipass.rb +++ b/lib/multipass.rb @@ -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