Class: RIO::CmdPipe::RL
- Defined in:
- lib/rio/scheme/cmdpipe.rb
Constant Summary collapse
- RIOSCHEME =
'cmdpipe'
- RIOPATH =
RIO::RL::CHMAP.invert[RIOSCHEME].to_s.freeze
- SPLIT_RE =
%r|(?:([^\|]+)(?:\|([^\|]+))*)?$|.freeze
Instance Attribute Summary collapse
-
#piper ⇒ Object
readonly
Returns the value of attribute piper.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ RL
constructor
A new instance of RL.
- #initialize_copy(*args) ⇒ Object
- #opaque ⇒ Object
- #open(m, *args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#piper ⇒ Object (readonly)
Returns the value of attribute piper.
49 50 51 |
# File 'lib/rio/scheme/cmdpipe.rb', line 49 def piper @piper end |
Class Method Details
.splitrl(s) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/rio/scheme/cmdpipe.rb', line 81 def self.splitrl(s) #p "S='#{s}'" sub,opq,whole = split_riorl(s) if opq.nil? or opq.empty? [] elsif bm = SPLIT_RE.match(opq) escaped_cmd = bm[1] cmd = URI.unescape(escaped_cmd) [cmd] else [] end end |
Instance Method Details
#initialize_copy(*args) ⇒ Object
62 63 64 65 |
# File 'lib/rio/scheme/cmdpipe.rb', line 62 def initialize_copy(*args) super @piper = @piper.clone end |
#opaque ⇒ Object
66 67 68 69 |
# File 'lib/rio/scheme/cmdpipe.rb', line 66 def opaque() #p callstr('opaque') @piper.rios.map{|cmd| URI.escape(cmd.to_s,RIO::RL::ESCAPE)}.join('|') end |
#open(m, *args) ⇒ Object
74 75 76 77 78 79 |
# File 'lib/rio/scheme/cmdpipe.rb', line 74 def open(m,*args) @outp = rio(?") rp = Piper::Base.new(@piper,@outp) rp.run @outp end |
#to_s ⇒ Object
70 71 72 73 |
# File 'lib/rio/scheme/cmdpipe.rb', line 70 def to_s() return "" if @piper.rios.nil? or @piper.rios.empty? @piper.rios.map{|cmd| cmd.to_s}.join('|') end |