Commit 7fc60b51 authored by Eloy Durán's avatar Eloy Durán

Merge branch 'master' of github.com:CocoaPods/CocoaPods

parents 92d7a92e 8fe74160
...@@ -14,7 +14,8 @@ module Pod ...@@ -14,7 +14,8 @@ module Pod
end end
def self.options def self.options
[["--allow-warnings", "Allows to push if warnings are not evitable"]].concat(super) [ ["--allow-warnings", "Allows to push if warnings are not evitable"],
["--local-only", "Does not perform the step of pushing REPO to its remote"] ].concat(super)
end end
extend Executable extend Executable
...@@ -22,6 +23,7 @@ module Pod ...@@ -22,6 +23,7 @@ module Pod
def initialize(argv) def initialize(argv)
@allow_warnings = argv.option('--allow-warnings') @allow_warnings = argv.option('--allow-warnings')
@local_only = argv.option('--local-only')
@repo = argv.shift_argument @repo = argv.shift_argument
@podspec = argv.shift_argument @podspec = argv.shift_argument
super unless argv.empty? && @repo super unless argv.empty? && @repo
...@@ -32,7 +34,7 @@ module Pod ...@@ -32,7 +34,7 @@ module Pod
check_repo_status check_repo_status
update_repo update_repo
add_specs_to_repo add_specs_to_repo
push_repo push_repo unless @local_only
puts puts
end end
......
module Pod module Pod
class Podfile class Podfile
class Informative < ::Pod::Informative
def podfile_line
@podfile_line ||= self.backtrace.find {|t| t =~ /Podfile/}
end
def message
if podfile_line
super + " (#{podfile_line})\n".red
else
super
end
end
end
class UserProject class UserProject
include Config::Mixin include Config::Mixin
...@@ -200,7 +214,7 @@ module Pod ...@@ -200,7 +214,7 @@ module Pod
when :osx when :osx
target = '10.6' target = '10.6'
else else
raise Informative, "Unsupported platform: platform must be one of [:ios, :osx]" raise ::Pod::Podfile::Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
end end
end end
@target_definition.platform = Platform.new(name, target) @target_definition.platform = Platform.new(name, target)
......
...@@ -19,7 +19,14 @@ describe "Pod::Podfile" do ...@@ -19,7 +19,14 @@ describe "Pod::Podfile" do
it "raise error if unsupported platform is supplied" do it "raise error if unsupported platform is supplied" do
lambda { lambda {
Pod::Podfile.new { platform :iOS } Pod::Podfile.new { platform :iOS }
}.should.raise(StandardError, "Unsupported platform") }.should.raise Pod::Podfile::Informative
begin
Pod::Podfile.new { platform :iOS }
rescue Pod::Podfile::Informative => e
e.stubs(:podfile_line).returns("./podfile_spec.rb:1")
e.message.should.be =~ /podfile_spec\.rb:1/
end
end end
it "adds dependencies" do it "adds dependencies" do
......
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