diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-08-07 18:26:46 -0500 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-08-07 18:26:46 -0500 |
commit | ee34c3018a520bf1271fdbd85ada659900b17ba2 (patch) | |
tree | 79dee940f52453a303daef036bcb9337dd8c21e7 /lib/ffi_yajl | |
parent | a21383e49ca307e140491524845fffac7a3df2e1 (diff) | |
download | ffi-yajl-ee34c3018a520bf1271fdbd85ada659900b17ba2.tar.gz |
Revert "fix for chef pretty printing issues"
This reverts commit 5d260103d3f11897e7873fb3fa796966896ff946.
Diffstat (limited to 'lib/ffi_yajl')
-rw-r--r-- | lib/ffi_yajl/encoder.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/ffi/encoder.rb | 2 | ||||
-rw-r--r-- | lib/ffi_yajl/json_gem.rb | 18 |
3 files changed, 10 insertions, 12 deletions
diff --git a/lib/ffi_yajl/encoder.rb b/lib/ffi_yajl/encoder.rb index bd3ff31..8b5bfcb 100644 --- a/lib/ffi_yajl/encoder.rb +++ b/lib/ffi_yajl/encoder.rb @@ -18,7 +18,7 @@ module FFI_Yajl end # call either the ext or ffi hook - str = do_yajl_encode(obj, yajl_gen_opts, opts) + str = do_yajl_encode(obj, yajl_gen_opts) str.force_encoding('UTF-8') if defined? Encoding str end diff --git a/lib/ffi_yajl/ffi/encoder.rb b/lib/ffi_yajl/ffi/encoder.rb index 8837e12..bbeba27 100644 --- a/lib/ffi_yajl/ffi/encoder.rb +++ b/lib/ffi_yajl/ffi/encoder.rb @@ -4,7 +4,7 @@ require 'ffi_yajl/ffi' module FFI_Yajl module FFI module Encoder - def do_yajl_encode(obj, yajl_gen_opts = {}, opts) + def do_yajl_encode(obj, yajl_gen_opts = {}) yajl_gen = FFI_Yajl.yajl_gen_alloc(nil); diff --git a/lib/ffi_yajl/json_gem.rb b/lib/ffi_yajl/json_gem.rb index 4773f7f..0e64d50 100644 --- a/lib/ffi_yajl/json_gem.rb +++ b/lib/ffi_yajl/json_gem.rb @@ -25,8 +25,6 @@ module JSON options_map = {} options_map[:pretty] = true options_map[:indent] = opts[:indent] if opts.has_key?(:indent) - require 'pp' - pp options_map FFI_Yajl::Encoder.encode(obj, options_map).chomp rescue FFI_Yajl::EncodeError => e raise JSON::GeneratorError, e.message @@ -57,49 +55,49 @@ end class Array def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Hash def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Fixnum def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class Float def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class String def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class TrueClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class FalseClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end class NilClass def to_json(*opts, &block) - FFI_Yajl::Encoder.encode(self, *opts) + FFI_Yajl::Encoder.encode(self) end end |