class GitPivotalTrackerIntegration::Command::Base

An abstract base class for all commands @abstract Subclass and override {#run} to implement command functionality

Public Class Methods

new() click to toggle source

Common initialization functionality for all command classes. This enforces that:

  • the command is being run within a valid Git repository

  • the user has specified their Pivotal Tracker API token

  • all communication with Pivotal Tracker will be protected with SSL

  • the user has configured the project id for this repository

# File lib/git-pivotal-tracker-integration/command/base.rb, line 31
def initialize
  @repository_root = GitPivotalTrackerIntegration::Util::Git.repository_root
  @configuration = GitPivotalTrackerIntegration::Command::Configuration.new

  PivotalTracker::Client.token = @configuration.api_token
  PivotalTracker::Client.use_ssl = true

  @project = PivotalTracker::Project.find @configuration.project_id
end

Public Instance Methods

run() click to toggle source

The main entry point to the command's execution @abstract Override this method to implement command functionality

# File lib/git-pivotal-tracker-integration/command/base.rb, line 43
def run
  raise NotImplementedError
end