lib/bait/build.rb in bait-0.5.11 vs lib/bait/build.rb in bait-0.5.12

- old
+ new

@@ -14,11 +14,11 @@ adapter :memory, Moneta.new(:YAML, :file => Bait.db_file('builds')) attribute :simplecov, Boolean, default: false - attribute :ref, String + attribute :ref, String, default: "master" attribute :owner_name, String attribute :owner_email, String attribute :name, String attribute :clone_url, String attribute :output, String, default: "" @@ -32,9 +32,22 @@ end after_destroy do self.broadcast(:remove) self.cleanup! + end + + def summary + branch = self.ref ? self.ref.split('/').last : "n/a" + output = %{#{self.name} (#{branch}) #{self.status}} + case self.status + when "passed" + output.green + when "failed" + output.red + else + output + end end def phases YAML.load_file(File.join(self.bait_dir, "config.yml")) end