Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
Fix multijson feature detect
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed May 7, 2012
1 parent 1636f19 commit c8d3ba7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/sprockets/manifest.rb
Expand Up @@ -192,21 +192,19 @@ def save

private
# Feature detect newer MultiJson API
if MultiJson.respond_to?(:load)
if MultiJson.respond_to?(:dump)
def json_decode(obj)
MultiJson.load(obj)
end
else
def json_decode(obj)
MultiJson.decode(obj)
end
end

if MultiJson.respond_to?(:dump)
def json_encode(obj)
MultiJson.dump(obj)
end
else
def json_decode(obj)
MultiJson.decode(obj)
end

def json_encode(obj)
MultiJson.encode(obj)
end
Expand Down

0 comments on commit c8d3ba7

Please sign in to comment.