Class: LegacyRSpecItHandler

Inherits:
YARD::Handlers::Ruby::Legacy::Base
  • Object
show all
Defined in:
lib/yard-rspec/legacy.rb

Constant Summary collapse

MATCH =
/\Ait\s+['"](.+?)['"]\s+(do|\{)/

Instance Method Summary collapse

Instance Method Details

#processObject


18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/yard-rspec/legacy.rb', line 18

def process
  return if owner.nil?
  obj = P(owner[:spec])
  return if obj.is_a?(Proxy)
  
  (obj[:specifications] ||= []) << {
    :name => statement.tokens.to_s[MATCH, 1],
    :file => parser.file,
    :line => statement.line,
    :source => statement.block.to_s
  }
end