aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorVlad Shablinsky2016-07-11 16:09:35 +0300
committerXu Cheng2016-07-16 20:39:13 +0800
commit3fb5d70a729472a7d7f2a5d0d7b84248921fb583 (patch)
treeb23f70013abe231fe997f2601ae89814b1f338db /Library/Homebrew/cmd
parent454003c4c1ea43f4fd84db96017636fc4c50b318 (diff)
downloadbrew-3fb5d70a729472a7d7f2a5d0d7b84248921fb583.tar.bz2
Unify Version.create usage
Substitue each Version.new and HeadVersion.new with Version.create to unify Version and HeadVersion instantiation among core code. Note that this does not relate to Mac::OS::Version class.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb2
-rw-r--r--Library/Homebrew/cmd/create.rb2
-rw-r--r--Library/Homebrew/cmd/pull.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 18ebbec52..5171ec711 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -606,7 +606,7 @@ class FormulaAuditor
case stable && stable.url
when %r{download\.gnome\.org/sources}, %r{ftp\.gnome\.org/pub/GNOME/sources}i
version = Version.parse(stable.url)
- if version >= Version.new("1.0")
+ if version >= Version.create("1.0")
minor_version = version.to_s.split(".", 3)[1].to_i
if minor_version.odd?
problem "#{stable.version} is a development release"
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index eb3bec46f..ac936818a 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -116,7 +116,7 @@ class FormulaCreator
end
update_path
if @version
- @version = Version.new(@version)
+ @version = Version.create(@version)
else
@version = Pathname.new(url).version
end
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index 3b3c68930..f93ad095a 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -441,7 +441,7 @@ module Homebrew
def version(spec_type)
version_str = info["versions"][spec_type.to_s]
- version_str && Version.new(version_str)
+ version_str && Version.create(version_str)
end
def pkg_version(spec_type = :stable)