aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compilers.rb
diff options
context:
space:
mode:
authorJack Nagel2013-06-04 11:05:02 -0500
committerJack Nagel2013-06-04 11:06:18 -0500
commitb97b013fcea50c783faf85e7c12f7844eb86e4b3 (patch)
treeb6b12ee2f83044d7ab57e96331a48325520fccd6 /Library/Homebrew/compilers.rb
parent87819502945c546ff3356804ffd857df7d5406fa (diff)
downloadbrew-b97b013fcea50c783faf85e7c12f7844eb86e4b3.tar.bz2
Extract attr_rw from Formula for reuse
Closes Homebrew/homebrew#20239.
Diffstat (limited to 'Library/Homebrew/compilers.rb')
-rw-r--r--Library/Homebrew/compilers.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb
index 43d8ea900..80826237a 100644
--- a/Library/Homebrew/compilers.rb
+++ b/Library/Homebrew/compilers.rb
@@ -6,19 +6,12 @@ end
class CompilerFailure
attr_reader :compiler
+ attr_rw :build, :cause
def initialize compiler, &block
@compiler = compiler
instance_eval(&block) if block_given?
- @build ||= 9999
- end
-
- def build val=nil
- val.nil? ? @build.to_i : @build = val.to_i
- end
-
- def cause val=nil
- val.nil? ? @cause : @cause = val
+ @build = (@build || 9999).to_i
end
end