Class: Seto::Sed
Instance Method Summary collapse
- #address(pattern, last = nil) ⇒ Object
-
#branch(label) ⇒ Object
b.
- #edit(&block) ⇒ Object
-
#get! ⇒ Object
G.
-
#hold! ⇒ Object
H.
-
#initialize(enumerator) ⇒ Sed
constructor
A new instance of Sed.
-
#label ⇒ Object
:label.
-
#look ⇒ Object
l.
-
#next! ⇒ Object
N.
-
#print! ⇒ Object
P.
-
#test(label) ⇒ Object
t.
Constructor Details
Instance Method Details
#address(pattern, last = nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/seto/sed.rb', line 21 def address(pattern, last=nil) result = cover?(pattern, last) yield if result && block_given? result end |
#branch(label) ⇒ Object
b
49 50 51 |
# File 'lib/seto/sed.rb', line 49 def branch(label) raise NotImplementedError end |
#edit(&block) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/seto/sed.rb', line 12 def edit(&block) loop do @editor.load instance_eval &block @editor.copy end @editor.result.reject { |l| l.empty? } end |
#get! ⇒ Object
G
54 55 56 |
# File 'lib/seto/sed.rb', line 54 def get! raise NotImplementedError end |
#hold! ⇒ Object
H
59 60 61 |
# File 'lib/seto/sed.rb', line 59 def hold! raise NotImplementedError end |
#label ⇒ Object
:label
44 45 46 |
# File 'lib/seto/sed.rb', line 44 def label raise NotImplementedError end |
#look ⇒ Object
l
64 65 66 |
# File 'lib/seto/sed.rb', line 64 def look raise NotImplementedError end |
#next! ⇒ Object
N
69 70 71 |
# File 'lib/seto/sed.rb', line 69 def next! raise NotImplementedError end |
#print! ⇒ Object
P
74 75 76 |
# File 'lib/seto/sed.rb', line 74 def print! raise NotImplementedError end |
#test(label) ⇒ Object
t
79 80 81 |
# File 'lib/seto/sed.rb', line 79 def test(label) raise NotImplementedError end |