Sha256: eb0035d55eb4ae4a7e29dad78d1813ab60da9c2c46dc12c6e52fe20b0e334596

Contents?: true

Size: 1 KB

Versions: 12

Compression:

Stored size: 1 KB

Contents

YARD::Templates::Engine.register_template_path File.expand_path("#{__FILE__}/../templates")

class RSpecDescribeHandler < YARD::Handlers::Ruby::Base
  handles method_call(:describe)

  def process
    objname = statement.parameters.first.jump(:string_content).source
    if statement.parameters[1]
      src = statement.parameters[1].jump(:string_content).source
      objname += (src[0] == "#" ? "" : "::") + src
    end
    obj = {:spec => owner ? (owner[:spec] || "") : ""}
    obj[:spec] += objname
    parse_block(statement.last.last, owner: obj)
  rescue YARD::Handlers::NamespaceMissingError
  end
end

class RSpecItHandler < YARD::Handlers::Ruby::Base
  handles method_call(:it)

  def process
    return if owner.nil?
    obj = P(owner[:spec])
    return if obj.is_a?(Proxy)

    obj[:specifications] ||= []
    obj[:specifications] << {
      name: statement.parameters.first.jump(:string_content).source,
      file: statement.file,
      line: statement.line,
      source: statement.last.last.source
    }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dropbox_api-0.1.16 yardoc/rspec.rb
dropbox_api-0.1.15 yardoc/rspec.rb
dropbox_api-0.1.14 yardoc/rspec.rb
dropbox_api-0.1.13 yardoc/rspec.rb
dropbox_api-0.1.12 yardoc/rspec.rb
dropbox_api-0.1.11 yardoc/rspec.rb
dropbox_api-0.1.10 yardoc/rspec.rb
dropbox_api-0.1.9 yardoc/rspec.rb
dropbox_api-0.1.8 yardoc/rspec.rb
dropbox_api-0.1.7 yardoc/rspec.rb
dropbox_api-0.1.6 yardoc/rspec.rb
dropbox_api-0.1.5 yardoc/rspec.rb