Add CVSRequirement and SubversionRequirement
Use these two requirements in DependencyCollector. Remove the unused function MacOS::Xcode.provides_cvs?
This commit is contained in:
parent
86305f7d81
commit
baa3d187d6
@ -159,7 +159,9 @@ class DependencyCollector
|
|||||||
elsif strategy <= BazaarDownloadStrategy
|
elsif strategy <= BazaarDownloadStrategy
|
||||||
Dependency.new("bazaar", tags)
|
Dependency.new("bazaar", tags)
|
||||||
elsif strategy <= CVSDownloadStrategy
|
elsif strategy <= CVSDownloadStrategy
|
||||||
Dependency.new("cvs", tags) if MacOS.version >= :mavericks || !MacOS::Xcode.provides_cvs?
|
CVSRequirement.new(tags)
|
||||||
|
elsif strategy <= SubversionDownloadStrategy
|
||||||
|
SubversionRequirement.new(tags)
|
||||||
elsif strategy < AbstractDownloadStrategy
|
elsif strategy < AbstractDownloadStrategy
|
||||||
# allow unknown strategies to pass through
|
# allow unknown strategies to pass through
|
||||||
else
|
else
|
||||||
|
|||||||
@ -174,10 +174,6 @@ module OS
|
|||||||
version < "4.3"
|
version < "4.3"
|
||||||
end
|
end
|
||||||
|
|
||||||
def provides_cvs?
|
|
||||||
version < "5.0"
|
|
||||||
end
|
|
||||||
|
|
||||||
def default_prefix?
|
def default_prefix?
|
||||||
if version < "4.3"
|
if version < "4.3"
|
||||||
prefix.to_s.start_with? "/Developer"
|
prefix.to_s.start_with? "/Developer"
|
||||||
|
|||||||
@ -114,10 +114,15 @@ class ArchRequirement < Requirement
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class CVSRequirement < Requirement
|
||||||
|
fatal true
|
||||||
|
default_formula "cvs"
|
||||||
|
satisfy { which "cvs" }
|
||||||
|
end
|
||||||
|
|
||||||
class MercurialRequirement < Requirement
|
class MercurialRequirement < Requirement
|
||||||
fatal true
|
fatal true
|
||||||
default_formula "mercurial"
|
default_formula "mercurial"
|
||||||
|
|
||||||
satisfy { which("hg") }
|
satisfy { which("hg") }
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -126,3 +131,9 @@ class GitRequirement < Requirement
|
|||||||
default_formula "git"
|
default_formula "git"
|
||||||
satisfy { Utils.git_available? }
|
satisfy { Utils.git_available? }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class SubversionRequirement < Requirement
|
||||||
|
fatal true
|
||||||
|
default_formula "subversion"
|
||||||
|
satisfy { Utils.svn_available? }
|
||||||
|
end
|
||||||
|
|||||||
@ -84,6 +84,18 @@ describe DependencyCollector do
|
|||||||
expect(subject.add(resource)).to be_an_instance_of(GitRequirement)
|
expect(subject.add(resource)).to be_an_instance_of(GitRequirement)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "creates a resource dependency from a CVS URL" do
|
||||||
|
resource = Resource.new
|
||||||
|
resource.url(":pserver:anonymous:@example.com:/cvsroot/foo/bar", using: :cvs)
|
||||||
|
expect(subject.add(resource)).to be_an_instance_of(CVSRequirement)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "creates a resource dependency from a Subversion URL" do
|
||||||
|
resource = Resource.new
|
||||||
|
resource.url("svn://example.com/foo/bar")
|
||||||
|
expect(subject.add(resource)).to be_an_instance_of(SubversionRequirement)
|
||||||
|
end
|
||||||
|
|
||||||
it "creates a resource dependency from a '.7z' URL" do
|
it "creates a resource dependency from a '.7z' URL" do
|
||||||
resource = Resource.new
|
resource = Resource.new
|
||||||
resource.url("http://example.com/foo.7z")
|
resource.url("http://example.com/foo.7z")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user