Sha256: 59e6eb7a346b632fd13812c50d5acfa8e1081873eea122983198355a9876aa7f

Contents?: true

Size: 616 Bytes

Versions: 3

Compression:

Stored size: 616 Bytes

Contents

require 'pathname'

module Appraisal
  class Gemspec
    attr_reader :options

    def initialize(options = {})
      @options = options
      @options[:path] ||= '.'
    end

    def to_s
      "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}"
    end

    private

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appraisal-1.0.0.beta3 lib/appraisal/gemspec.rb
appraisal-1.0.0.beta2 lib/appraisal/gemspec.rb
appraisal-1.0.0.beta1 lib/appraisal/gemspec.rb