mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
insns2vm.rb: make #generate_parser private
which is only used by #router. To make it private, we need to stop defining them on top-level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
be27efdb83
commit
c8e5796f61
2 changed files with 76 additions and 73 deletions
|
@ -6,7 +6,7 @@
|
||||||
require_relative 'ruby_vm/scripts/insns2vm'
|
require_relative 'ruby_vm/scripts/insns2vm'
|
||||||
|
|
||||||
if $0 == __FILE__
|
if $0 == __FILE__
|
||||||
router(ARGV).each do |(path, generator)|
|
RubyVM::Insns2VM.router(ARGV).each do |(path, generator)|
|
||||||
str = generator.generate path
|
str = generator.generate path
|
||||||
path.open 'wb:utf-8' do |fp|
|
path.open 'wb:utf-8' do |fp|
|
||||||
fp.write str
|
fp.write str
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
require_relative '../controllers/application_controller.rb'
|
require_relative '../controllers/application_controller.rb'
|
||||||
|
|
||||||
def router argv
|
module RubyVM::Insns2VM
|
||||||
|
def self.router argv
|
||||||
options = { destdir: Dir.getwd }
|
options = { destdir: Dir.getwd }
|
||||||
targets = generate_parser(options).parse argv
|
targets = generate_parser(options).parse argv
|
||||||
return targets.map do |i|
|
return targets.map do |i|
|
||||||
|
@ -21,7 +22,7 @@ def router argv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_parser(options)
|
def self.generate_parser(options)
|
||||||
OptionParser.new do |this|
|
OptionParser.new do |this|
|
||||||
this.on "-I", "--srcdir=DIR", <<-'end'
|
this.on "-I", "--srcdir=DIR", <<-'end'
|
||||||
Historically this option has been passed to the script. This is
|
Historically this option has been passed to the script. This is
|
||||||
|
@ -88,3 +89,5 @@ def generate_parser(options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
private_class_method :generate_parser
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue