aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/create.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cmd/create.rb')
-rw-r--r--Library/Homebrew/cmd/create.rb26
1 files changed, 12 insertions, 14 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index eaa1dca5c..88b8c0df3 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -1,17 +1,15 @@
-require 'formula'
-require 'blacklist'
-require 'digest'
-require 'erb'
+require "formula"
+require "blacklist"
+require "digest"
+require "erb"
module Homebrew
-
# Create a formula from a tarball URL
def create
-
# Allow searching MacPorts or Fink.
- if ARGV.include? '--macports'
+ if ARGV.include? "--macports"
exec_browser "https://www.macports.org/ports.php?by=name&substr=#{ARGV.next}"
- elsif ARGV.include? '--fink'
+ elsif ARGV.include? "--fink"
exec_browser "http://pdb.finkproject.org/pdb/browse.php?summary=#{ARGV.next}"
end
@@ -22,17 +20,17 @@ module Homebrew
url = ARGV.named.first # Pull the first (and only) url from ARGV
- version = ARGV.next if ARGV.include? '--set-version'
- name = ARGV.next if ARGV.include? '--set-name'
+ version = ARGV.next if ARGV.include? "--set-version"
+ name = ARGV.next if ARGV.include? "--set-name"
fc = FormulaCreator.new
fc.name = name
fc.version = version
fc.url = url
- fc.mode = if ARGV.include? '--cmake'
+ fc.mode = if ARGV.include? "--cmake"
:cmake
- elsif ARGV.include? '--autotools'
+ elsif ARGV.include? "--autotools"
:autotools
end
@@ -76,7 +74,7 @@ class FormulaCreator
attr_reader :url, :sha256
attr_accessor :name, :version, :path, :mode
- def url= url
+ def url=(url)
@url = url
path = Pathname.new(url)
if @name.nil?
@@ -115,7 +113,7 @@ class FormulaCreator
@sha256 = r.fetch.sha256 if r.download_strategy == CurlDownloadStrategy
end
- path.write ERB.new(template, nil, '>').result(binding)
+ path.write ERB.new(template, nil, ">").result(binding)
end
def template; <<-EOS.undent