-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
- Loading branch information
Showing
35 changed files
with
1,267 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# change-ws.rb - | ||
# $Release Version: 0.9$ | ||
# $Revision$ | ||
# $Date$ | ||
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) | ||
# | ||
# -- | ||
# | ||
# | ||
# | ||
|
||
require "irb/cmd/nop.rb" | ||
require "irb/ext/change-ws.rb" | ||
|
||
module IRB | ||
module ExtendCommand | ||
|
||
class CurrentWorkingWorkspace<Nop | ||
def execute(*obj) | ||
irb_context.main | ||
end | ||
end | ||
|
||
class ChangeWorkspace<Nop | ||
def execute(*obj) | ||
irb_context.change_workspace(*obj) | ||
irb_context.main | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
module IRB | ||
module ExtendCommand | ||
class Fork<Nop | ||
def execute(&block) | ||
pid = send ExtendCommand.irb_original_method_name("fork") | ||
unless pid | ||
class<<self | ||
alias_method :exit, ExtendCommand.irb_original_method_name('exit') | ||
end | ||
if iterator? | ||
begin | ||
yield | ||
ensure | ||
exit | ||
end | ||
end | ||
end | ||
pid | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# | ||
# load.rb - | ||
# $Release Version: 0.9$ | ||
# $Revision$ | ||
# $Date$ | ||
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) | ||
# | ||
# -- | ||
# | ||
# | ||
# | ||
|
||
require "irb/cmd/nop.rb" | ||
require "irb/ext/loader" | ||
|
||
module IRB | ||
module ExtendCommand | ||
class Load<Nop | ||
include IrbLoader | ||
|
||
def execute(file_name, priv = nil) | ||
# return ruby_load(file_name) unless IRB.conf[:USE_LOADER] | ||
return irb_load(file_name, priv) | ||
end | ||
end | ||
|
||
class Require<Nop | ||
include IrbLoader | ||
|
||
def execute(file_name) | ||
# return ruby_require(file_name) unless IRB.conf[:USE_LOADER] | ||
|
||
rex = Regexp.new("#{Regexp.quote(file_name)}(\.o|\.rb)?") | ||
return false if $".find{|f| f =~ rex} | ||
|
||
case file_name | ||
when /\.rb$/ | ||
begin | ||
if irb_load(file_name) | ||
$".push file_name | ||
return true | ||
end | ||
rescue LoadError | ||
end | ||
when /\.(so|o|sl)$/ | ||
return ruby_require(file_name) | ||
end | ||
|
||
begin | ||
irb_load(f = file_name + ".rb") | ||
$".push f | ||
return true | ||
rescue LoadError | ||
return ruby_require(file_name) | ||
end | ||
end | ||
end | ||
|
||
class Source<Nop | ||
include IrbLoader | ||
def execute(file_name) | ||
source_file(file_name) | ||
end | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# nop.rb - | ||
# $Release Version: 0.9$ | ||
# $Revision$ | ||
# $Date$ | ||
# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) | ||
# | ||
# -- | ||
# | ||
# | ||
# | ||
module IRB | ||
module ExtendCommand | ||
class Nop | ||
|
||
@RCS_ID='-$Id$-' | ||
|
||
def self.execute(conf, *opts) | ||
command = new(conf) | ||
command.execute(*opts) | ||
end | ||
|
||
def initialize(conf) | ||
@irb_context = conf | ||
end | ||
|
||
attr_reader :irb_context | ||
|
||
def irb | ||
@irb_context.irb | ||
end | ||
|
||
def execute(*opts) | ||
#nop | ||
end | ||
end | ||
end | ||
end | ||
|
Oops, something went wrong.