Sha256: 35b86a94e229e652bca35ed5ff2f519f6b6fb59808149ecda0f45bb5235b0bc2

Contents?: true

Size: 1.2 KB

Versions: 312

Compression:

Stored size: 1.2 KB

Contents

/*
 * This code is copyrighted work by Daniel Luz <dev at mernen dot com>.
 *
 * Distributed under the Ruby and GPLv2 licenses; see COPYING and GPL files
 * for details.
 */
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

312 entries across 272 versions & 47 rubygems

Version Path
scout-5.9.13 vendor/json_pure/java/src/json/ext/ParserService.java
scout-5.9.12 vendor/json_pure/java/src/json/ext/ParserService.java
scout-5.9.11 vendor/json_pure/java/src/json/ext/ParserService.java
cvss-suite-1.0.8 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.7 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.6 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.5 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.4 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.3 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.2 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.1 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
cvss-suite-1.0.0 vendor/cache/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
simplenet-client-0.2.0 ./vendor/bundle/ruby/2.0.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
simplenet-client-0.2.0 ./vendor/bundle/ruby/1.9.1/gems/json-1.8.3/java/src/json/ext/ParserService.java
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
dwolla_swagger-1.0.6 vendor/bundle/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/json-1.8.3/java/src/json/ext/ParserService.java
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/json-1.8.3/java/src/json/ext/ParserService.java