Class: Seto::Sed

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/seto/sed.rb

Instance Method Summary collapse

Constructor Details

#initialize(enumerator) ⇒ Sed

Returns a new instance of Sed.



8
9
10
# File 'lib/seto/sed.rb', line 8

def initialize(enumerator)
  @editor = Seto::Editor.new(enumerator)
end

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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


54
55
56
# File 'lib/seto/sed.rb', line 54

def get!
  raise NotImplementedError
end

#hold!Object

H

Raises:

  • (NotImplementedError)


59
60
61
# File 'lib/seto/sed.rb', line 59

def hold!
  raise NotImplementedError
end

#labelObject

:label

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/seto/sed.rb', line 44

def label
  raise NotImplementedError
end

#lookObject

l

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/seto/sed.rb', line 64

def look
  raise NotImplementedError
end

#next!Object

N

Raises:

  • (NotImplementedError)


69
70
71
# File 'lib/seto/sed.rb', line 69

def next!
  raise NotImplementedError
end

#print!Object

P

Raises:

  • (NotImplementedError)


74
75
76
# File 'lib/seto/sed.rb', line 74

def print!
  raise NotImplementedError
end

#test(label) ⇒ Object

t

Raises:

  • (NotImplementedError)


79
80
81
# File 'lib/seto/sed.rb', line 79

def test(label)
  raise NotImplementedError
end