Commit a21d1e73 authored by Fabio Pelosin's avatar Fabio Pelosin

[Push] Support for podspec argument.

parent 439a7912
...@@ -6,11 +6,11 @@ module Pod ...@@ -6,11 +6,11 @@ module Pod
def self.banner def self.banner
%{Pushing new specifications to a spec-repo: %{Pushing new specifications to a spec-repo:
$ pod push [REPO] $ pod push REPO [NAME.podspec]
Validates `*.podspec' in the current working dir, updates Validates NAME.podspec or `*.podspec' in the current working dir, updates
the local copy of the repository named REPO, adds specifications the local copy of the repository named REPO, adds the specifications
to REPO, and finally it pushes REPO to its remote.} to the REPO, and finally it pushes REPO to its remote.}
end end
def self.options def self.options
...@@ -23,6 +23,7 @@ module Pod ...@@ -23,6 +23,7 @@ module Pod
def initialize(argv) def initialize(argv)
@allow_warnings = argv.option('--allow-warnings') @allow_warnings = argv.option('--allow-warnings')
@repo = argv.shift_argument @repo = argv.shift_argument
@podspec = argv.shift_argument
super unless argv.empty? && @repo super unless argv.empty? && @repo
end end
...@@ -61,7 +62,7 @@ module Pod ...@@ -61,7 +62,7 @@ module Pod
end end
def podspec_files def podspec_files
files = Pathname.glob("*.podspec") files = Pathname.glob(@podspec || "*.podspec")
raise Informative, "[!] Couldn't find .podspec file in current directory".red if files.empty? raise Informative, "[!] Couldn't find .podspec file in current directory".red if files.empty?
files files
end end
...@@ -71,8 +72,10 @@ module Pod ...@@ -71,8 +72,10 @@ module Pod
lint_argv = ["lint"] lint_argv = ["lint"]
lint_argv << "--only-errors" if @allow_warnings lint_argv << "--only-errors" if @allow_warnings
lint_argv << "--silent" if config.silent lint_argv << "--silent" if config.silent
lint_argv += podspec_files.map(&:to_s) all_valid = true
all_valid = Spec.new(ARGV.new(lint_argv)).run podspec_files.each do |podspec|
Spec.new(ARGV.new(lint_argv + [podspec.to_s])).run
end
end end
def add_specs_to_repo def add_specs_to_repo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment