Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
don't depend on Yajl
  • Loading branch information
mislav committed Dec 16, 2011
1 parent d1d9664 commit febfaac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/gorgeous
Expand Up @@ -81,7 +81,11 @@ if output_format == :ruby
require 'pp'
output = input.data.pretty_inspect
elsif output_format == :json
require 'yajl/json_gem'
begin
require 'yajl/json_gem'
rescue LoadError
require 'json'
end
output = JSON.pretty_generate input.data
elsif output_format == :yaml
require 'yaml'
Expand Down
6 changes: 5 additions & 1 deletion lib/gorgeous.rb
Expand Up @@ -125,7 +125,11 @@ def data
require 'active_support/core_ext/hash/conversions'
Hash.from_xml(to_s)
when :json
require 'yajl/json_gem'
begin
require 'yajl/json_gem'
rescue LoadError
require 'json'
end
JSON.parse to_s
when :yaml
require 'yaml'
Expand Down

0 comments on commit febfaac

Please sign in to comment.