Skip to content

Commit

Permalink
fixed mimic_JSON to fake out Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Ohler committed Aug 12, 2012
1 parent e3f3258 commit 647d36b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -32,9 +32,9 @@ A fast JSON parser and Object marshaller as a Ruby gem.


## <a name="release">Release Notes</a> ## <a name="release">Release Notes</a>


### Release 1.3.2 ### Release 1.3.4


- Fixed compile problems with native Ruby on OS X 10.8 (Mountain Lion) - Fixed mimic_JSON so it convinces Ruby that the json gem is already loaded.


## <a name="description">Description</a> ## <a name="description">Description</a>


Expand Down
5 changes: 5 additions & 0 deletions ext/oj/oj.c
Expand Up @@ -810,6 +810,11 @@ define_mimic_json(VALUE self) {
ext = rb_define_module_under(mimic, "Ext"); ext = rb_define_module_under(mimic, "Ext");
dummy = rb_define_class_under(ext, "Parser", rb_cObject); dummy = rb_define_class_under(ext, "Parser", rb_cObject);
dummy = rb_define_class_under(ext, "Generator", rb_cObject); dummy = rb_define_class_under(ext, "Generator", rb_cObject);
// convince Ruby that the json gem has already been loaded
dummy = rb_gv_get("$LOADED_FEATURES");
if (rb_type(dummy) == T_ARRAY) {
rb_ary_push(dummy, rb_str_new2("json"));
}


rb_define_module_function(mimic, "parser=", no_op1, 1); rb_define_module_function(mimic, "parser=", no_op1, 1);
rb_define_module_function(mimic, "generator=", no_op1, 1); rb_define_module_function(mimic, "generator=", no_op1, 1);
Expand Down
2 changes: 1 addition & 1 deletion lib/oj/version.rb
@@ -1,5 +1,5 @@


module Oj module Oj
# Current version of the module. # Current version of the module.
VERSION = '1.3.2' VERSION = '1.3.4'
end end

0 comments on commit 647d36b

Please sign in to comment.