Class: AppRepo::CommandsGenerator
- Inherits:
-
Object
- Object
- AppRepo::CommandsGenerator
- Includes:
- Commander::Methods
- Defined in:
- lib/apprepo/commands_generator.rb
Overview
This class is responsible for providing commands with respective actions
Class Method Summary collapse
Instance Method Summary collapse
- #download_manifest ⇒ Object
- #init ⇒ Object
-
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity rubocop:disable Style/GlobalVars.
Class Method Details
Instance Method Details
#download_manifest ⇒ Object
18 19 20 |
# File 'lib/apprepo/commands_generator.rb', line 18 def download_manifest command :download_manifest end |
#init ⇒ Object
22 23 24 |
# File 'lib/apprepo/commands_generator.rb', line 22 def init command :init end |
#run ⇒ Object
rubocop:disable Metrics/AbcSize rubocop:disable Metrics/MethodLength rubocop:disable Metrics/CyclomaticComplexity rubocop:disable Metrics/PerceivedComplexity rubocop:disable Style/GlobalVars
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/apprepo/commands_generator.rb', line 31 def run program :version, AppRepo::VERSION program :description, AppRepo::DESCRIPTION program :help, 'Author', 'Matej Sychra <[email protected]>' program :help, 'Website', 'https://github.com/suculent/apprepo' program :help, 'GitHub', 'https://github.com/suculent/apprepo/tree/master/apprepo' program :help_formatter, :compact generator = FastlaneCore::CommanderGenerator.new generator.generate(AppRepo::Options.) global_option('--verbose') { $verbose = true } always_trace! command :run do |c| c.syntax = 'apprepo' c.description = 'Upload IPA and metadata to SFTP (e.g. AppRepo)' c.action do |_args, | config = FastlaneCore::Configuration available_opts = AppRepo::Options. = config.create(available_opts, .__hash__) loaded = .load_configuration_file('Repofile') loaded = true if [:repo_description] || [:ipa] unless loaded UI.('[AppRepo::CommandsGenerator] configuration file not loaded') if UI.confirm('No Repofile found. Do you want to setup apprepo?') require 'apprepo/setup' AppRepo::Setup.new.run() return 0 end end AppRepo::Runner.new().run end end command :download_manifest do |c| c.syntax = 'apprepo download_manifest' c.description = 'Download metadata only' c.action do |_args, | config = FastlaneCore::Configuration available_opts = AppRepo::Options. = config.create(available_opts, .__hash__) .load_configuration_file('Repofile') AppRepo::Runner.new().download_manifest end end command :submit do |c| c.syntax = 'apprepo submit' c.description = 'Submit a specific build-nr, use latest.' c.action do |_args, | config = FastlaneCore::Configuration available_opts = AppRepo::Options. = config.create(available_opts, .__hash__) .load_configuration_file('Repofile') AppRepo::Runner.new().run end end command :init do |c| c.syntax = 'apprepo init' c.description = 'Create the initial `apprepo` configuration' c.action do |_args, | if File.exist?('Repofile') || File.exist?('fastlane/Repofile') UI.important('You already got a running apprepo setup.') return 0 end require 'apprepo/setup' config = FastlaneCore::Configuration available_opts = AppRepo::Options. = config.create(available_opts, .__hash__) AppRepo::Runner.new() AppRepo::Setup.new.run() end end # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/MethodLength default_command :run run! end |