Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (27 sloc) 0.65 kb
module Appraisal
# Dependency on a gem and optional version requirements
class Dependency
attr_reader :name, :requirements
def initialize(name, requirements)
@name = name
@requirements = requirements
end
def to_s
if no_requirements?
gem_name
else
"#{gem_name}, #{inspect_requirements}"
end
end
private
def gem_name
%{gem "#{name}"}
end
def no_requirements?
requirements.nil? || requirements.empty?
end
def inspect_requirements
requirements.map { |requirement| requirement.inspect.gsub(/^\{|\}$/, '') }.join(", ")
end
end
end
Jump to Line
Something went wrong with that request. Please try again.