org.jruby.Ruby.getArgsFile()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.jruby.Ruby.getArgsFile方法的一些代码示例,展示了Ruby.getArgsFile的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getArgsFile方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getArgsFile

Ruby.getArgsFile介绍

暂无

代码示例

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public IRubyObject getValue() {
  return runtime.getArgsFile();
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public IRubyObject getValue() {
  return runtime.getArgsFile();
}

代码示例来源:origin: org.jruby/jruby-core

public IRubyObject getValue() {
  return runtime.getArgsFile();
}

代码示例来源:origin: org.jruby/jruby-complete

public IRubyObject getValue() {
  return runtime.getArgsFile();
}

代码示例来源:origin: org.jruby/jruby-core

public static ArgsFileData getArgsFileData(Ruby runtime) {
  return (ArgsFileData) runtime.getArgsFile().dataGetStruct();
}

代码示例来源:origin: org.jruby/jruby-complete

public static ArgsFileData getArgsFileData(Ruby runtime) {
  return (ArgsFileData) runtime.getArgsFile().dataGetStruct();
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.readlines(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "readlines", optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.readlines(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "readlines", optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.readlines(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.readlines(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "gets", optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject gets(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.gets(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "gets", optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject gets(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  return RubyArgsFile.gets(context, context.runtime.getArgsFile(), args);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private void incrementLineno(Ruby runtime, OpenFile myOpenFile) {
  int lineno = myOpenFile.getLineNumber() + 1;
  myOpenFile.setLineNumber(lineno);
  runtime.setCurrentLine(lineno);
  RubyArgsFile.setCurrentLineNumber(runtime.getArgsFile(), lineno);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public IRubyObject set(IRubyObject value) {
  int line = (int)value.convertToInteger().getLongValue();
  runtime.setCurrentLine(line);
  RubyArgsFile.setCurrentLineNumber(runtime.getArgsFile(), line);
  return value;
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject gets(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  Ruby runtime = context.runtime;
  IRubyObject argsFile = runtime.getArgsFile();
  if (recv == argsFile) {
    return RubyArgsFile.gets(context, argsFile, args);
  }
  return sites(context).gets.call(context, argsFile, argsFile, args);
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(optional = 1, module = true, visibility = PRIVATE)
public static IRubyObject gets(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
  Ruby runtime = context.runtime;
  IRubyObject argsFile = runtime.getArgsFile();
  if (recv == argsFile) {
    return RubyArgsFile.gets(context, argsFile, args);
  }
  return sites(context).gets.call(context, argsFile, argsFile, args);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public IRubyObject set(IRubyObject value) {
  int line = (int)value.convertToInteger().getLongValue();
  runtime.setCurrentLine(line);
  RubyArgsFile.setCurrentLineNumber(runtime.getArgsFile(), line);
  return value;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private void incrementLineno(Ruby runtime, OpenFile myOpenFile) {
  int lineno = myOpenFile.getLineNumber() + 1;
  myOpenFile.setLineNumber(lineno);
  runtime.setCurrentLine(lineno);
  RubyArgsFile.setCurrentLineNumber(runtime.getArgsFile(), lineno);
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "initialize", visibility = PRIVATE, rest = true)
public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
  final Ruby runtime = context.runtime;
  final RubyArray argv;
  if (args.length == 1 && args[0] == null) {
    argv = runtime.getObject().getConstant("ARGV").convertToArray();
  } else {
    argv = runtime.newArray(args);
  }
  // ARGF is intended to be a singleton from a Ruby perspective but it is still
  // possible for someone to ARGF.class.new.  We do still want a global view of
  // ARGF otherwise getline and rewind in IO would have to keep track of the n
  // instances in play.  So all instances will share
  if (runtime.getArgsFile() == null) {
    dataWrapStruct(new ArgsFileData(runtime, argv));
  } else {
    ArgsFileData data = (ArgsFileData) runtime.getArgsFile().dataGetStruct();
    dataWrapStruct(data);
    data.setArgs(argv);
  }
  return this;
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(name = "initialize", visibility = PRIVATE, rest = true)
public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
  final Ruby runtime = context.runtime;
  final RubyArray argv;
  if (args.length == 1 && args[0] == null) {
    argv = runtime.getObject().getConstant("ARGV").convertToArray();
  } else {
    argv = runtime.newArray(args);
  }
  // ARGF is intended to be a singleton from a Ruby perspective but it is still
  // possible for someone to ARGF.class.new.  We do still want a global view of
  // ARGF otherwise getline and rewind in IO would have to keep track of the n
  // instances in play.  So all instances will share
  if (runtime.getArgsFile() == null) {
    dataWrapStruct(new ArgsFileData(runtime, argv));
  } else {
    ArgsFileData data = (ArgsFileData) runtime.getArgsFile().dataGetStruct();
    dataWrapStruct(data);
    data.setArgs(argv);
  }
  return this;
}

相关文章

Ruby类方法