Class: GithubPivotalFlow::Command
- Defined in:
- lib/github_pivotal_flow/command.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Command
constructor
Common initialization functionality for all command classes.
-
#run! ⇒ Object
abstract
The main entry point to the command’s execution.
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
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/github_pivotal_flow/command.rb', line 6 def configuration @configuration end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/github_pivotal_flow/command.rb', line 6 def @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
26 27 28 |
# File 'lib/github_pivotal_flow/command.rb', line 26 def run! raise NotImplementedError end |