Class: Pod::Command::Mod::Config
- Inherits:
-
Pod::Command::Mod
- Object
- Pod::Command
- Pod::Command::Mod
- Pod::Command::Mod::Config
- Defined in:
- lib/cocoapods-modularization/command/mod/config.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Config
constructor
A new instance of Config.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ Config
Returns a new instance of Config.
25 26 27 28 29 30 31 |
# File 'lib/cocoapods-modularization/command/mod/config.rb', line 25 def initialize(argv) @name = argv.shift_argument @url = argv.shift_argument @binary = argv.flag?('binary') @binary ||= false super end |
Class Method Details
.options ⇒ Object
19 20 21 22 23 |
# File 'lib/cocoapods-modularization/command/mod/config.rb', line 19 def self. [ ['--binary', 'Mark NAME as binary repo, is this options is not specified, repo will be marked as source repo'] ].concat(super) end |
Instance Method Details
#run ⇒ Object
44 45 46 47 |
# File 'lib/cocoapods-modularization/command/mod/config.rb', line 44 def run Private::PrivateCache.cache_repo(@name, @url, @binary) `pod repo add #{@name} #{@url}` end |
#validate! ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cocoapods-modularization/command/mod/config.rb', line 33 def validate! super unless @name && @url help! 'Adding a repo needs a `NAME` and a `URL`.' end if @name == 'trunk' raise Informative, "Repo name `trunk` is reserved for CocoaPods' main spec repo accessed via CDN." end end |