Class: Xcov::CommandsGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



13
14
15
16
17
18
# File 'lib/xcov/commands_generator.rb', line 13

def self.start
  FastlaneCore::UpdateChecker.start_looking_for_update("xcov")
  new.run
 ensure
   FastlaneCore::UpdateChecker.show_update_status("xcov", Xcov::VERSION)
end

Instance Method Details

#convert_options(options) ⇒ Object



20
21
22
23
24
# File 'lib/xcov/commands_generator.rb', line 20

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

#runObject



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

def run
  program :version, Xcov::VERSION
  program :description, Xcov::DESCRIPTION
  program :help, "Author", "Carlos Vidal <[email protected]>"
  program :help, "Website", "http://www.nakiostudio.com"
  program :help, "GitHub", "https://github.com/nakiostudio/xcov"
  program :help_formatter, :compact

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

  command :report do |c|
    c.syntax = "Xcov"
    c.description = Xcov::DESCRIPTION
    c.action do |_args, options|
      config = FastlaneCore::Configuration.create(Xcov::Options.available_options, convert_options(options))
      Xcov::Manager.new.work(config)
    end
  end

  default_command :report
  run!
end