Sha256: f3fa6df9b73413e59714220036afc9d870b22b8c8a5863ed28a7eceee9b34176

Contents?: true

Size: 1.19 KB

Versions: 111

Compression:

Stored size: 1.19 KB

Contents

/*
 * This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
 *
 * Distributed under the Ruby license: https://www.ruby-lang.org/en/about/license.txt
 */
package json.ext;

import java.io.IOException;
import java.lang.ref.WeakReference;

import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
import org.jruby.runtime.load.BasicLibraryService;

/**
 * The service invoked by JRuby's {@link org.jruby.runtime.load.LoadService LoadService}.
 * Defines the <code>JSON::Ext::Parser</code> class.
 * @author mernen
 */
public class ParserService implements BasicLibraryService {
    public boolean basicLoad(Ruby runtime) throws IOException {
        runtime.getLoadService().require("json/common");
        RuntimeInfo info = RuntimeInfo.initRuntime(runtime);

        info.jsonModule = new WeakReference<RubyModule>(runtime.defineModule("JSON"));
        RubyModule jsonExtModule = info.jsonModule.get().defineModuleUnder("Ext");
        RubyClass parserClass =
            jsonExtModule.defineClassUnder("Parser", runtime.getObject(),
                                           Parser.ALLOCATOR);
        parserClass.defineAnnotatedMethods(Parser.class);
        return true;
    }
}

Version data entries

111 entries across 101 versions & 19 rubygems

Version Path
alloy_sdk-0.1.0 vendor/bundle/ruby/3.0.0/gems/json-1.8.6/java/src/json/ext/ParserService.java
alloy_sdk-0.1.0 vendor/bundle/ruby/2.6.0/gems/json-1.8.6/java/src/json/ext/ParserService.java
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
video_chat_get-0.1.9 vendor/bundle/ruby/2.5.0/gems/json-2.3.0/java/src/json/ext/ParserService.java
json_pure-2.4.0 java/src/json/ext/ParserService.java
json-2.4.0 java/src/json/ext/ParserService.java
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
video_chat_get-0.1.6 vendor/bundle/ruby/2.5.0/gems/json-2.3.0/java/src/json/ext/ParserService.java
cloudsmith-api-0.54.15 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.53.79 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.53.17 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.53.3 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.53.1 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.52.121 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.52.92 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java
cloudsmith-api-0.52.79 vendor/bundle/ruby/2.6.0/gems/json-2.3.1/java/src/json/ext/ParserService.java