Class: Cerberus::Builder::RubyBase
- Inherits:
-
Object
- Object
- Cerberus::Builder::RubyBase
- Defined in:
- lib/cerberus/builder/ruby_base.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #brokeness ⇒ Object
-
#initialize(config, name, cmd = name) ⇒ RubyBase
constructor
A new instance of RubyBase.
- #run ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(config, name, cmd = name) ⇒ RubyBase
Returns a new instance of RubyBase.
6 7 8 9 10 |
# File 'lib/cerberus/builder/ruby_base.rb', line 6 def initialize(config, name, cmd = name) @config = config @cmd = cmd @name = name end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/cerberus/builder/ruby_base.rb', line 4 def output @output end |
Instance Method Details
#brokeness ⇒ Object
24 25 26 27 28 |
# File 'lib/cerberus/builder/ruby_base.rb', line 24 def brokeness if @output =~ /\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors/ return $1.to_i + $2.to_i end end |
#run ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/cerberus/builder/ruby_base.rb', line 12 def run build_dir = @config[:builder, :build_dir] Dir.chdir(build_dir) if build_dir @output = `#{@config[:bin_path]}#{choose_exec()} #{@config[:builder, @name.to_sym, :task]} 2>&1` successful? end |
#successful? ⇒ Boolean
20 21 22 |
# File 'lib/cerberus/builder/ruby_base.rb', line 20 def successful? $?.exitstatus == 0 and not @output.include?("#{@cmd} aborted!") end |