Class: Pod::Command::Gen
- Inherits:
-
Pod::Command
- Object
- Pod::Command
- Pod::Command::Gen
- Defined in:
- lib/cocoapods-modularization/command/gen.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Configuration
readonly
The configuration used when generating workspaces.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Gen
constructor
A new instance of Gen.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Gen
Returns a new instance of Gen.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/cocoapods-modularization/command/gen.rb', line 42 def initialize(argv) = Generate::Configuration..each_with_object({}) do |option, | value = if option.name == :podspec_paths argv.arguments! elsif option.flag? argv.flag?(option.cli_name) else argv.option(option.cli_name) end next if value.nil? [option.name] = option.coerce(value) end UI.puts "options_hash: #{}" @configuration = merge_configuration() super end |
Instance Attribute Details
#configuration ⇒ Configuration (readonly)
Returns the configuration used when generating workspaces.
40 41 42 |
# File 'lib/cocoapods-modularization/command/gen.rb', line 40 def configuration @configuration end |
Class Method Details
.options ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/cocoapods-modularization/command/gen.rb', line 23 def self. super.concat(Generate::Configuration..map do |option| next unless option.cli_name flag = "--#{option.cli_name}" flag += "=#{option.arg_name}" if option.arg_name [flag, option.] end.compact) end |
Instance Method Details
#run ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/cocoapods-modularization/command/gen.rb', line 61 def run UI.puts "[pod gen] Running with #{configuration.to_s.gsub("\n", " \n")}" if configuration.pod_config.verbose? # this is done here rather than in the installer so we only update sources once, # even if there are multiple podspecs update_sources if configuration.repo_update? Generate::PodfileGenerator.new(configuration).podfiles_by_spec.each do |spec, podfile| Generate::Installer.new(configuration, spec, podfile).install! end remove_warnings(UI.warnings) end |
#validate! ⇒ Object
75 76 77 78 79 80 |
# File 'lib/cocoapods-modularization/command/gen.rb', line 75 def validate! super config_errors = configuration.validate help! config_errors.join("\n ") if config_errors.any? end |