Examples of RubyFile


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

Examples of org.jruby.RubyFile

        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

Examples of org.jruby.RubyFile

            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

Examples of org.jruby.RubyFile

            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

Examples of org.jruby.truffle.runtime.core.RubyFile

        @Specialization
        public Object open(VirtualFrame frame, RubyString fileName, RubyString mode, RubyProc block) {
            notDesignedForCompilation();

            final RubyFile file = RubyFile.open(getContext(), fileName.toString(), mode.toString());

            if (block != null) {
                try {
                    yield(frame, block, file);
                } finally {
                    file.close();
                }
            }

            return file;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.