class Appraisal::Gemspec

Attributes

options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/appraisal/gemspec.rb, line 7
def initialize(options = {})
  @options = options
  @options[:path] ||= '.'
end

Public Instance Methods

exists?() click to toggle source
# File lib/appraisal/gemspec.rb, line 12
def exists?
  Dir[::File.join(@options[:path], "*.gemspec")].size > 0
end
to_s() click to toggle source
# File lib/appraisal/gemspec.rb, line 16
def to_s
  if exists?
    "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}"
  end
end

Private Instance Methods

exported_options() click to toggle source
# File lib/appraisal/gemspec.rb, line 24
def exported_options
  # Check to see if this is an absolute path
  if @options[:path] =~ /^(?:\/|\S:)/
    @options
  else
    # Remove leading ./ from path, if any
    exported_path = ::File.join("..", @options[:path].sub(/^\.\/?/,''))
    @options.merge(:path => exported_path)
  end
end