Class: PEM::CommandsGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



10
11
12
13
14
15
# File 'lib/pem/commands_generator.rb', line 10

def self.start
  FastlaneCore::UpdateChecker.start_looking_for_update('pem')
  self.new.run
ensure
  FastlaneCore::UpdateChecker.show_update_status('pem', PEM::VERSION)
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/pem/commands_generator.rb', line 17

def run
  program :name, 'pem'
  program :version, PEM::VERSION
  program :description, 'CLI for \'PEM\' - Automatically generate and renew your push notification profiles'
  program :help, 'Author', 'Felix Krause <[email protected]>'
  program :help, 'Website', 'https://fastlane.tools'
  program :help, 'GitHub', 'https://github.com/fastlane/PEM'
  program :help_formatter, :compact

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

  FastlaneCore::CommanderGenerator.new.generate(PEM::Options.available_options)

  command :renew do |c|
    c.syntax = 'pem renew'
    c.description = 'Renews the certificate (in case it expired) and shows the path to the generated pem file'

    c.action do |args, options|
      PEM.config = FastlaneCore::Configuration.create(PEM::Options.available_options, options.__hash__)
      PEM::Manager.start
    end
  end

  default_command :renew

  run!
end