Class: Souyuz::CommandsGenerator

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/souyuz/commands_generator.rb

Constant Summary collapse

UI =
FastlaneCore::UI

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



14
15
16
# File 'lib/souyuz/commands_generator.rb', line 14

def self.start
  new.run
end

Instance Method Details

#convert_options(options) ⇒ Object



18
19
20
21
22
# File 'lib/souyuz/commands_generator.rb', line 18

def convert_options(options)
  o = options.__hash__.dup
  o.delete(:verbose)
  o
end

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/souyuz/commands_generator.rb', line 24

def run
  program :version, Souyuz::VERSION
  program :description, Souyuz::DESCRIPTION
  program :help, "Author", "Felix Rudat <[email protected]>"
  program :help_formatter, :compact

  global_option("--verbose") { $verbose = true }

  command :build do |c|
    c.syntax = "souyuz"
    c.description = "Just builds your app"
    c.action do |_args, options|
      config = FastlaneCore::Configuration.create(Souyuz::Options.available_options,
                                                  convert_options(options))
      Souyuz::Manager.new.work(config)
    end
  end

  default_command :build

  run!
end