Class: GithubPivotalFlow::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/github_pivotal_flow/command.rb

Direct Known Subclasses

Finish, Publish, Start

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Command

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



14
15
16
17
18
19
20
21
22
# File 'lib/github_pivotal_flow/command.rb', line 14

def initialize(*args)
  @options = {}
  args = parse_argv(*args)
  @options[:args] = args
  @configuration = Configuration.new(@options)
  # Validate the configuration to make sure everything is set up correctly
  @configuration.validate
  @project = @configuration.project
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



6
7
8
# File 'lib/github_pivotal_flow/command.rb', line 6

def configuration
  @configuration
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/github_pivotal_flow/command.rb', line 6

def options
  @options
end

Instance Method Details

#run!Object

This method is abstract.

Override this method to implement command functionality

The main entry point to the command’s execution

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/github_pivotal_flow/command.rb', line 26

def run!
  raise NotImplementedError
end