Sha256: 580d6b1637b71b7f32ba6d28e6fb73940fecb0488f8755575845b5d81c67e250

Contents?: true

Size: 831 Bytes

Versions: 10

Compression:

Stored size: 831 Bytes

Contents

module ProjectHelper

  def with_most_recent_commit(project)
    commit = project.head
    if commit
      commit.project = project # so that _Commit_ doesn't load project again
      yield commit
    end
  end

  def with_most_recent_release(project)
    release = @releases[project.id]
    if release
      release.project = project # so that _Release_ doesn't load project again
      yield release
    end
  end

  def with_most_recent_test_run(project)
    test_run = @test_runs[project.id]
    if test_run
      test_run.project = project # so that _TestRun_ doesn't load project again
      yield test_run
    end
  end

  def project_label(project)
    return '<b class="label unknown">&nbsp;</b>'.html_safe unless project
    "<b class=\"label #{project.color}\">#{h project.slug.gsub("_", " ")}</b>".html_safe
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
houston-core-0.8.0.pre app/helpers/project_helper.rb
houston-core-0.7.0 app/helpers/project_helper.rb
houston-core-0.7.0.beta4 app/helpers/project_helper.rb
houston-core-0.7.0.beta3 app/helpers/project_helper.rb
houston-core-0.7.0.beta2 app/helpers/project_helper.rb
houston-core-0.7.0.beta app/helpers/project_helper.rb
houston-core-0.6.3 app/helpers/project_helper.rb
houston-core-0.6.2 app/helpers/project_helper.rb
houston-core-0.6.1 app/helpers/project_helper.rb
houston-core-0.6.0 app/helpers/project_helper.rb