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
commit0759cce3c2a5354858358cb0d0f6b168a2f0e6e7 (patch)
treebf87a1f1c2d54400b745777d409ec9013d97eaec /Library/Homebrew/compilers.rb
parentaf4a66b0cf1dcf1ebee5442ae52322fa8269a851 (diff)
downloadhomebrew-0759cce3c2a5354858358cb0d0f6b168a2f0e6e7.tar.bz2
Extract attr_rw from Formula for reuse
Closes #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