diff options
| author | Jack Nagel | 2013-09-22 16:04:25 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-09-22 16:04:25 -0500 |
| commit | 28c8395f3de97bba70c20fc8fd0443ceed9f5453 (patch) | |
| tree | 4f4fba95a4b19201994caf7808fc2bbc397fe1e8 /Library/Homebrew | |
| parent | 134210d9ed0d5eec6f70ae999b50ef4d3dae6a1c (diff) | |
| download | brew-28c8395f3de97bba70c20fc8fd0443ceed9f5453.tar.bz2 | |
Group DSL methods that delegate to the stable spec
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 90ab6e66e..f45725822 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -647,15 +647,6 @@ class Formula attr_rw :homepage, :keg_only_reason, :cc_failures attr_rw :plist_startup, :plist_manual - Checksum::TYPES.each do |cksum| - class_eval <<-EOS, __FILE__, __LINE__ + 1 - def #{cksum}(val) - @stable ||= create_spec(SoftwareSpec) - @stable.#{cksum}(val) - end - EOS - end - def specs @specs ||= [] end @@ -666,14 +657,33 @@ class Formula spec end - def build + def url val, specs={} @stable ||= create_spec(SoftwareSpec) - @stable.build + @stable.url(val, specs) end - def url val, specs={} + def version val=nil @stable ||= create_spec(SoftwareSpec) - @stable.url(val, specs) + @stable.version(val) + end + + def mirror val + @stable ||= create_spec(SoftwareSpec) + @stable.mirror(val) + end + + Checksum::TYPES.each do |cksum| + class_eval <<-EOS, __FILE__, __LINE__ + 1 + def #{cksum}(val) + @stable ||= create_spec(SoftwareSpec) + @stable.#{cksum}(val) + end + EOS + end + + def build + @stable ||= create_spec(SoftwareSpec) + @stable.build end def stable &block @@ -706,16 +716,6 @@ class Formula end end - def version val=nil - @stable ||= create_spec(SoftwareSpec) - @stable.version(val) - end - - def mirror val - @stable ||= create_spec(SoftwareSpec) - @stable.mirror(val) - end - # Define a named resource using a SoftwareSpec style block def resource name, &block specs.each do |spec| |
