Package org.jruby

Examples of org.jruby.RubyFile


        try {
            in.read(first);
            if(first[0] != 'R' || first[1] != 'B' || first[2] != 'C' || first[3] != 'M') {
                throw new RuntimeException("File is not a compiled YARV file");
            }
            RubyFile f = new RubyFile(runtime,filename,in);
            IRubyObject arr = runtime.getMarshal().callMethod(runtime.getCurrentContext(),"load",f);
            iseq = transformIntoSequence(arr);
        } catch(IOException e) {
            throw new RuntimeException("Couldn't read from source",e);
        }
View Full Code Here


        try {
            result = parser.parse(configuration, lexerSource);
            if (result.getEndOffset() >= 0) {
                IRubyObject verbose = runtime.getVerbose();
                runtime.setVerbose(runtime.getNil());
              runtime.defineGlobalConstant("DATA", new RubyFile(runtime, file, content));
                runtime.setVerbose(verbose);
              result.setEndOffset(-1);
            }
        } catch (SyntaxException e) {
            StringBuilder buffer = new StringBuilder(100);
View Full Code Here

            result = parser.parse(configuration, lexerSource);
            if (result.getEndOffset() >= 0 && configuration.isSaveData()) {
                IRubyObject verbose = runtime.getVerbose();
                runtime.setVerbose(runtime.getNil());
                try {
                    runtime.defineGlobalConstant("DATA", new RubyFile(runtime, file, lexerSource.getRemainingAsStream()));
                } catch (IOException e) { // Not sure how to handle suddenly closed IO here?
                    runtime.defineGlobalConstant("DATA", runtime.getNil());
                }
                runtime.setVerbose(verbose);
              result.setEndOffset(-1);
View Full Code Here

            result = parser.parse(configuration, lexerSource);
            if (result.getEndOffset() >= 0 && configuration.isSaveData()) {
                IRubyObject verbose = runtime.getVerbose();
                runtime.setVerbose(runtime.getNil());
                try {
                    runtime.defineGlobalConstant("DATA", new RubyFile(runtime, file, lexerSource.getRemainingAsStream()));
                } catch (IOException e) { // Not sure how to handle suddenly closed IO here?
                    runtime.defineGlobalConstant("DATA", runtime.getNil());
                }
                runtime.setVerbose(verbose);
              result.setEndOffset(-1);
View Full Code Here

TOP

Related Classes of org.jruby.RubyFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.