Class: Cerberus::Builder::Ruby
- Defined in:
- lib/cerberus/builder/ruby.rb
Instance Attribute Summary
Attributes inherited from RubyBase
Instance Method Summary collapse
- #brokeness ⇒ Object
-
#initialize(config) ⇒ Ruby
constructor
A new instance of Ruby.
- #run ⇒ Object
- #successful? ⇒ Boolean
Constructor Details
#initialize(config) ⇒ Ruby
Returns a new instance of Ruby.
4 5 6 |
# File 'lib/cerberus/builder/ruby.rb', line 4 def initialize(config) super(config, "ruby") end |
Instance Method Details
#brokeness ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cerberus/builder/ruby.rb', line 21 def brokeness if @config[:builder, @name.to_sym, :brokeness] re = Regexp.new( @config[:builder, @name.to_sym, :brokeness] ) md = re.match( @output ) if md return md.captures.inject( 0 ) { |sum, n| sum += n.to_i } end else super # use RubyBase default if custom :brokeness not specified end end |
#run ⇒ Object
8 9 10 11 |
# File 'lib/cerberus/builder/ruby.rb', line 8 def run ENV['PATH'] = "#{@config[:builder, @name.to_sym, :ruby_path]}::#{ENV['PATH']}" super end |
#successful? ⇒ Boolean
13 14 15 16 17 18 19 |
# File 'lib/cerberus/builder/ruby.rb', line 13 def successful? if ( @config[:builder, @name.to_sym, :failure] and @config[:builder, @name.to_sym, :success] ) $?.exitstatus == 0 and !@output.include?(@config[:builder, @name.to_sym, :failure]) and @output.include?(@config[:builder, @name.to_sym, :success]) else super # use RubyBase default if custom :success and :failure not specified end end |