Skip to content
This repository
tree: a097f79837
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 53 lines (46 sloc) 1.254 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
require 'pathname'
require 'yard'

module Yardstick
  VERSION = '0.5.0'.freeze
  ROOT = Pathname(__FILE__).dirname.parent.expand_path.freeze

  # Measure a list of files
  #
  # @example
  # Yardstick.measure('article.rb') # => [ Measurement ]
  #
  # @param [Array<#to_s>, #to_s] path
  # optional list of paths to measure
  # @param [Hash] options
  # optional configuration
  #
  # @return [Yardstick::MeasurementSet]
  # the measurements for each file
  #
  # @api public
  def self.measure(path = 'lib/**/*.rb', options = {})
    Yardstick::Processor.process_path(path)
  end

  # Measure a string of code and YARD documentation
  #
  # @example
  # string = "def my_method; end"
  #
  # Yardstick.measure_string(string) # => [ Measurement ]
  #
  # @param [#to_str] string
  # the string to measure
  # @param [Hash] options
  # optional configuration
  #
  # @return [Yardstick::MeasurementSet]
  # the measurements for the string
  #
  # @api public
  def self.measure_string(string, options = {})
    Yardstick::Processor.process_string(string)
  end

end # module Yardstick

$LOAD_PATH.unshift((Yardstick::ROOT + 'lib').to_s)

require 'yardstick/core_ext/object'
require 'yardstick/yard_ext'
require 'yardstick/autoload'
Something went wrong with that request. Please try again.