Sha256: e61f968059db445bf37b89a7f8df8127bf0d069f228713c03a2db8c2143e8fe5

Contents?: true

Size: 1.69 KB

Versions: 34

Compression:

Stored size: 1.69 KB

Contents

module Inch
  module Language
    module Ruby
      module Provider
        # Parses the source tree (using YARD)
        module YARD
          # Returns +true+ if the docstring was generated by YARD
          #
          # @param docstring [Docstring,String]
          # @param method [MethodObject]
          def self.implicit_docstring?(docstring, method)
            name = method.name
            if method.getter?
              docstring.to_s == "Returns the value of attribute #{name}"
            elsif method.setter?
              basename = name.to_s.gsub(/(\=)$/, '')
              docstring.to_s == "Sets the attribute #{basename}"
            else
              false
            end
          end

          # Returns +true+ if the tag was generated by YARD
          #
          # @param tag [::YARD::Tag]
          # @param method [MethodObject]
          def self.implicit_tag?(tag, method)
            name = method.name
            if method.getter?
              tag.tag_name == 'return' &&
                tag.text == "the current value of #{name}"
            elsif method.setter?
              tag.tag_name == 'return' &&
                tag.text == 'the newly set value'
            else
              false
            end
          end

          # @see Provider.parse
          def self.parse(dir, config)
            Parser.parse(dir, config)
          end
        end
      end
    end
  end
end

require 'logger'
require 'yard'

log.level = ::Logger::UNKNOWN # basically disable YARD's logging

require 'inch/language/ruby/provider/yard/parser'
require 'inch/language/ruby/provider/yard/docstring'
require 'inch/language/ruby/provider/yard/nodoc_helper'
require 'inch/language/ruby/provider/yard/object'

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
inch-0.9.0.rc1 lib/inch/language/ruby/provider/yard.rb
inch-0.8.0 lib/inch/language/ruby/provider/yard.rb
inch-0.8.0.rc2 lib/inch/language/ruby/provider/yard.rb
inch-0.8.0.rc1 lib/inch/language/ruby/provider/yard.rb
inch-0.7.1 lib/inch/language/ruby/provider/yard.rb
inch-0.7.0 lib/inch/language/ruby/provider/yard.rb
inch-0.6.4 lib/inch/language/ruby/provider/yard.rb
inch-0.6.3 lib/inch/language/ruby/provider/yard.rb
inch-0.6.2 lib/inch/language/ruby/provider/yard.rb
inch-0.6.1 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc6 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc5 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc4 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc3 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc2 lib/inch/language/ruby/provider/yard.rb
inch-0.6.0.rc1 lib/inch/language/ruby/provider/yard.rb
inch-0.5.10 lib/inch/language/ruby/provider/yard.rb
inch-0.5.9 lib/inch/language/ruby/provider/yard.rb
inch-0.5.8 lib/inch/language/ruby/provider/yard.rb