Class: Cartage::Manifest::InstallDefaultIgnoreCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/cartage/manifest/commands.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Command

#execute, #with_plugins

Constructor Details

#initialize(cartage) ⇒ InstallDefaultIgnoreCommand


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/cartage/manifest/commands.rb', line 53

def initialize(cartage)
  super(cartage, 'install-ignore')
  takes_commands(false)
  short_desc('Installs the default ignore file.')

  self.options do |opts|
    opts.on('-f', '--force', 'Force write .cartignore.') {
      @mode = :force
    }
    opts.on('-m', '--merge', 'Merge .cartignore with the default.') {
      @mode = :merge
    }
  end

  @manifest = cartage.manifest
  @mode = nil
end

Instance Method Details

#performObject


71
72
73
# File 'lib/cartage/manifest/commands.rb', line 71

def perform(*)
  @manifest.install_default_ignore(mode: @mode)
end