Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

all versions of the json gem are now mimiced

  • Loading branch information...
commit eb72203ac5d324c9cec018d812e2b9867326c33e 1 parent 647d36b
@ohler55 authored
View
4 README.md
@@ -32,9 +32,9 @@ A fast JSON parser and Object marshaller as a Ruby gem.
## <a name="release">Release Notes</a>
-### Release 1.3.4
+### Release 1.3.5
- - Fixed mimic_JSON so it convinces Ruby that the json gem is already loaded.
+ - Fixed mimic_JSON so it convinces Ruby that the **ALL** versions of the json gem are already loaded.
## <a name="description">Description</a>
View
1  ext/oj/oj.c
@@ -814,6 +814,7 @@ define_mimic_json(VALUE self) {
dummy = rb_gv_get("$LOADED_FEATURES");
if (rb_type(dummy) == T_ARRAY) {
rb_ary_push(dummy, rb_str_new2("json"));
+ rb_funcall2(Oj, rb_intern("mimic_loaded"), 0, 0);
}
rb_define_module_function(mimic, "parser=", no_op1, 1);
View
1  lib/oj.rb
@@ -26,5 +26,6 @@ module Oj
require 'oj/version'
require 'oj/bag'
+require 'oj/mimic'
require 'oj/oj' # C extension
View
11 lib/oj/mimic.rb
@@ -0,0 +1,11 @@
+
+module Oj
+
+ def self.mimic_loaded()
+ gems_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__))))
+ Dir.foreach(gems_dir) do |gem|
+ next unless gem.start_with?('json-')
+ $LOADED_FEATURES << File.join(gems_dir, gem, 'lib', 'json.rb')
+ end
+ end
+end
View
2  lib/oj/version.rb
@@ -1,5 +1,5 @@
module Oj
# Current version of the module.
- VERSION = '1.3.4'
+ VERSION = '1.3.5'
end
View
2  notes
@@ -3,6 +3,8 @@
^c^d hide subtree
^c^s show subtree
+- memory leak on bad json
+
- next
- optimize read_hex in load.c
Please sign in to comment.
Something went wrong with that request. Please try again.