Class: Pindo::Command::Utils::Repoinit
- Inherits:
-
Pindo::Command::Utils
- Object
- CLAide::Command
- Pindo::Command
- Pindo::Command::Utils
- Pindo::Command::Utils::Repoinit
- Defined in:
- lib/pindo/command/utils/repoinit.rb
Constant Summary
Constants inherited from Pindo::Command
DEFAULT_OPTIONS, DEFAULT_ROOT_OPTIONS
Instance Attribute Summary
Attributes inherited from Pindo::Command
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Repoinit
constructor
A new instance of Repoinit.
- #run ⇒ Object
Methods inherited from Pindo::Command
command_name, #initialize_options, run, use_cache?, #validate!
Methods included from Funlog::Mixin
Methods included from Pindoconfig::Mixin
Constructor Details
#initialize(argv) ⇒ Repoinit
Returns a new instance of Repoinit.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pindo/command/utils/repoinit.rb', line 35 def initialize(argv) @mode = argv.option('mode') || 'minor' @force_retag = argv.flag?('retag', false) unless ['major', 'minor', 'patch'].include?(@mode) raise Informative, "mode参数必须是 major, minor 或 patch" end super @additional_args = argv.remainder! end |
Class Method Details
.options ⇒ Object
30 31 32 33 |
# File 'lib/pindo/command/utils/repoinit.rb', line 30 def self. [ ].concat(super) end |
Instance Method Details
#run ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/pindo/command/utils/repoinit.rb', line 47 def run pindo_project_dir = Dir.pwd build_helper = Pindo::BuildHelper.share_instance Pindo::GitRepoHelper.share_instance.check_check_and_install_cliff(pindo_project_dir) end |