Class: RIO::CmdIO::RL
- Defined in:
- lib/rio/scheme/cmdio.rb
Constant Summary collapse
- RIOSCHEME =
'cmdio'
- RIOPATH =
RIO::RL::CHMAP.invert[RIOSCHEME].to_s.freeze
- SPLIT_RE =
must be able to process parse(‘rio:cmdio’,cmd) parse(‘rio:cmdio:escaped_cmd’)
%r|(?:(.+))$|.freeze
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cmd = "") ⇒ RL
constructor
A new instance of RL.
- #opaque ⇒ Object
- #open(m) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(cmd = "") ⇒ RL
Returns a new instance of RL.
46 47 48 49 50 51 52 |
# File 'lib/rio/scheme/cmdio.rb', line 46 def initialize(cmd="") case cmd when self.class then @cmd = cmd.cmd else @cmd = cmd end super end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
45 46 47 |
# File 'lib/rio/scheme/cmdio.rb', line 45 def cmd @cmd end |
Class Method Details
Instance Method Details
#opaque ⇒ Object
53 54 55 |
# File 'lib/rio/scheme/cmdio.rb', line 53 def opaque() URI.escape(@cmd,RIO::RL::ESCAPE) end |
#open(m) ⇒ Object
59 60 61 62 63 |
# File 'lib/rio/scheme/cmdio.rb', line 59 def open(m) #p "opening #{@cmd}" #raise RuntimeError, "Should Not Open" super(::IO.popen(@cmd,m.to_s)) end |
#to_s ⇒ Object
56 57 58 |
# File 'lib/rio/scheme/cmdio.rb', line 56 def to_s() @cmd end |