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 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/github_pivotal_flow/command.rb', line 14 def initialize(*args) @options = {} args = parse_argv(*args) @options[:args] = args @repository_root = Git.repository_root @configuration = Configuration.new(@options) PivotalTracker::Client.token = @configuration.api_token PivotalTracker::Client.use_ssl = true @project = PivotalTracker::Project.find @configuration.project_id # Make sure that all the git flow config options are set up @configuration.development_branch @configuration.master_branch @configuration.feature_prefix @configuration.hotfix_prefix @configuration.release_prefix 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
37 38 39 |
# File 'lib/github_pivotal_flow/command.rb', line 37 def run! raise NotImplementedError end |