Class: Pindo::Command::Utils::Repoinit

Inherits:
Pindo::Command::Utils show all
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

#args_help_flag

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pindo::Command

command_name, #initialize_options, run, use_cache?, #validate!

Methods included from Funlog::Mixin

#pindo_log_instance

Methods included from Pindoconfig::Mixin

#pindo_single_config

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

.optionsObject



30
31
32
33
# File 'lib/pindo/command/utils/repoinit.rb', line 30

def self.options
  [
  ].concat(super)
end

Instance Method Details

#runObject



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