Sha256: 6d0638737f4a3f0f539cc285a7eb0678ed5254acf3097fef6eba0c8922df791d

Contents?: true

Size: 689 Bytes

Versions: 5

Compression:

Stored size: 689 Bytes

Contents

require 'appraisal/utils'

module Appraisal
  class Gemspec
    attr_reader :options

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

    def to_s
      "gemspec #{Utils.format_string(exported_options)}"
    end

    private

    def exported_options
      # Check to see if this is an absolute path
      if @options[:path] =~ /^(?:\/|\S:)/ || @options[:path] == '../'
        @options
      else
        # Remove leading ./ from path, if any
        cleaned_path = @options[:path].gsub(/(^|\/)\.\/?/, '\1')
        exported_path = ::File.join("..", cleaned_path)
        @options.merge(:path => exported_path)
      end
    end
  end
end

Version data entries

5 entries across 3 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/appraisal-1.0.2/lib/appraisal/gemspec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/appraisal-1.0.2/lib/appraisal/gemspec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/appraisal-1.0.2/lib/appraisal/gemspec.rb
appraisal-1.0.2 lib/appraisal/gemspec.rb
appraisal-1.0.0 lib/appraisal/gemspec.rb