Module: Integrity::Integritray::Helpers
- Defined in:
- lib/integrity/integritray.rb
Instance Method Summary collapse
Instance Method Details
#activity(status) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/integrity/integritray.rb', line 21 def activity(status) case status when :success, :failed then 'Sleeping' when :pending then 'Building' else 'Sleeping' end end |
#build_status(status) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/integrity/integritray.rb', line 32 def build_status(status) case status when :success, :pending then 'Success' when :failed then 'Failure' else 'Unknown' end end |
#xml_opts_for_project(project) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/integrity/integritray.rb', line 7 def xml_opts_for_project(project) opts = {} opts['name'] = project.name opts['category'] = project.branch opts['activity'] = activity(project.last_build.status) if project.last_build opts['webUrl'] = project_url(project) if project.last_build opts['lastBuildStatus'] = build_status(project.last_build.status) opts['lastBuildLabel'] = project.last_build.commit.short_identifier opts['lastBuildTime'] = project.last_build.completed_at end opts end |