Class: Appifier::CLI::Subcommands::Configuration

Inherits:
Thor
  • Object
show all
Defined in:
lib/appifier/cli/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Configuration

Returns a new instance of Configuration.



8
9
10
11
12
# File 'lib/appifier/cli/configuration.rb', line 8

def initialize(*args)
  super
  @output = Carioca::Registry.get.get_service name: :output
  @finisher = Carioca::Registry.get.get_service name: :finisher
end

Instance Method Details

#resetObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/appifier/cli/configuration.rb', line 29

def reset
 begin 
   raise "[DANGER] please add -F if you sure : appifier configuration reset -F" unless options[:force]
   @output.warn "Appifier reset configuration" 
   Appifier::Configuration.setup force: true
   @finisher.terminate exit_case: :quiet_exit
 rescue RuntimeError => e
   @output.error e.message
   @finisher.terminate exit_case: :error_exit
 end 

end

#sanitycheckObject



16
17
18
19
# File 'lib/appifier/cli/configuration.rb', line 16

def sanitycheck 
  Appifier::Configuration::Checker.sanitycheck

end

#versionObject



44
45
46
47
48
49
50
51
# File 'lib/appifier/cli/configuration.rb', line 44

def version; 
  @output.info "Querying version"
  puts 'Appifier (c) Ultragreen Software'
  puts "Camille PAQUET - Romain GEORGES "
  puts TTY::Link.link_to("http://www.ultragreen.net", "http://www.ultragreen.net") 
  puts "Version #{Appifier::VERSION}"
  @finisher.terminate exit_case: :quiet_exit
end