Sha256: 35f895f2387391f8214b8d7576abe4d08931434c5e81c9f80af23ea9633b9db3

Contents?: true

Size: 768 Bytes

Versions: 1

Compression:

Stored size: 768 Bytes

Contents

require 'pivotal-tracker'

module Tracker
  class Project

    attr_reader :tracker_token, :project_id

    def initialize(tracker_token, project_id)
      @tracker_token = tracker_token
      @project_id = project_id

      PivotalTracker::Client.token = tracker_token
      PivotalTracker::Client.use_ssl = true
    end

    def finished
      _project.stories.all(state: "finished", story_type: ['bug', 'feature'])
    end

    def deliver(story)
      story.update(current_state: "delivered")
    end

    def add_label(story, label)
      labels = (story.labels || "").split(",")
      labels << label
      story.update(labels: labels.join(","))
    end

    private
    def _project
      @project ||= PivotalTracker::Project.find(project_id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracker-git-0.0.4 lib/tracker-git/project.rb