Class: Buildkite::Builder::Commands::Abstract
- Inherits:
-
Object
- Object
- Buildkite::Builder::Commands::Abstract
- Defined in:
- lib/buildkite/builder/commands/abstract.rb
Constant Summary collapse
- PIPELINES_DIRECTORY =
'pipelines'
- POSSIBLE_PIPELINE_PATHS =
[ File.join('.buildkite', Pipeline::PIPELINE_DEFINITION_FILE), File.join('buildkite', Pipeline::PIPELINE_DEFINITION_FILE), File.join(Pipeline::PIPELINE_DEFINITION_FILE) ].freeze
- POSSIBLE_PIPELINES_PATHS =
[ File.join('.buildkite', PIPELINES_DIRECTORY), File.join('buildkite', PIPELINES_DIRECTORY), File.join(PIPELINES_DIRECTORY) ].freeze
Class Attribute Summary collapse
-
.description ⇒ Object
Returns the value of attribute description.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ Abstract
constructor
A new instance of Abstract.
Constructor Details
#initialize ⇒ Abstract
Returns a new instance of Abstract.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/buildkite/builder/commands/abstract.rb', line 31 def initialize @options = {} parser = OptionParser.new do |opts| opts. = "Usage: buildkite-builder #{command_name} [OPTIONS] [PIPELINE]" opts.on('-h', '--help', 'Prints this help') do [:help] = opts end (opts) end parser.parse! end |
Class Attribute Details
.description ⇒ Object
Returns the value of attribute description.
22 23 24 |
# File 'lib/buildkite/builder/commands/abstract.rb', line 22 def description @description end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
29 30 31 |
# File 'lib/buildkite/builder/commands/abstract.rb', line 29 def @options end |
Class Method Details
.execute ⇒ Object
24 25 26 |
# File 'lib/buildkite/builder/commands/abstract.rb', line 24 def execute new.execute end |
Instance Method Details
#execute ⇒ Object
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/buildkite/builder/commands/abstract.rb', line 46 def execute if [:help] puts [:help] return elsif !pipeline_path abort "Unable to find pipeline" end run end |