Sha256: ec715b1c8a38909994743cd8cc8269c78753451cf6a4fe36ba0ae2cabffe6033

Contents?: true

Size: 1.86 KB

Versions: 7

Compression:

Stored size: 1.86 KB

Contents

# Git Pivotal Tracker Integration
# Copyright (c) 2013 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'git-pivotal-tracker-integration/command/command'
require 'git-pivotal-tracker-integration/command/configuration'
require 'git-pivotal-tracker-integration/util/git'
require 'pivotal-tracker'
require 'parseconfig'

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

  # 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
  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

  # The main entry point to the command's execution
  # @abstract Override this method to implement command functionality
  def run
    raise NotImplementedError
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
v2gpti-0.2.0.6 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.5 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.4 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.3 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.2 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.b2 lib/git-pivotal-tracker-integration/command/base.rb
v2gpti-0.2.0.b1 lib/git-pivotal-tracker-integration/command/base.rb