Class: PPL::Command::Publish
- Inherits:
-
PPL::Command
- Object
- CLAide::Command
- PPL::Command
- PPL::Command::Publish
- Defined in:
- lib/pod-pipeline/command/publish.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Publish
constructor
A new instance of Publish.
- #run ⇒ Object
Methods inherited from PPL::Command
#argv_extension, ensure_not_root_or_allowed!, git_version, options_extension, run, verify_minimum_git_version!, verify_xcode_license_approved!
Constructor Details
#initialize(argv) ⇒ Publish
Returns a new instance of Publish.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/pod-pipeline/command/publish.rb', line 36 def initialize(argv) @path = argv.arguments! @repo = argv.option('repo', '').split(',').first @projectPath = @path.count.zero? ? Pathname.pwd.to_s : @path.first @is_master = false unless @repo @repo = 'master' @is_master = true end super end |
Class Method Details
.options ⇒ Object
22 23 24 25 26 |
# File 'lib/pod-pipeline/command/publish.rb', line 22 def self. [ ['--repo=master', 'Pod库所属的repo。(默认使用官方repo:master)'], ].concat(super).concat() end |
Instance Method Details
#run ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/pod-pipeline/command/publish.rb', line 50 def run PPL::Command::Update.run([@projectPath] + argv_extension['update']) PPL::Scanner.new(@projectPath, ['all']).run podspec_file = PPL::Scanner.linter.file if @is_master puts "[发布 #{podspec_file}]" push_argv = [podspec_file] + argv_extension['trunk-push'] Pod::Command::Trunk::Push.run(push_argv) else puts "[发布 #{@repo} #{podspec_file}]" push_argv = [@repo, podspec_file] + argv_extension['repo-push'] Pod::Command::Repo::Push.run(push_argv) end end |