Class: Intar::RedirectFile
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path, append) ⇒ RedirectFile
constructor
A new instance of RedirectFile.
- #outfile ⇒ Object
Methods inherited from Redirect
Constructor Details
#initialize(path, append) ⇒ RedirectFile
Returns a new instance of RedirectFile.
58 59 60 |
# File 'lib/intar/redirect.rb', line 58 def initialize path, append @path, @append = path, append end |
Class Method Details
.detect(line, outfile) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/intar/redirect.rb', line 48 def detect line, outfile if line.slice! /\s+>(>)?(\S+|"((?:[^\\"]|\\.)*)")\z/ then p = $3 ? ($3.gsub /\\(.)/, "\\1") : $2 append = true if $1 new p, append elsif outfile then new outfile.to_s, true end end |