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
end
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
extend Executable
......@@ -22,6 +23,7 @@ module Pod
def initialize(argv)
@allow_warnings = argv.option('--allow-warnings')
@local_only = argv.option('--local-only')
@repo = argv.shift_argument
@podspec = argv.shift_argument
super unless argv.empty? && @repo
......@@ -32,7 +34,7 @@ module Pod
check_repo_status
update_repo
add_specs_to_repo
push_repo
push_repo unless @local_only
puts
end
......
module Pod
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
include Config::Mixin
......@@ -200,7 +214,7 @@ module Pod
when :osx
target = '10.6'
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
@target_definition.platform = Platform.new(name, target)
......
......@@ -19,7 +19,14 @@ describe "Pod::Podfile" do
it "raise error if unsupported platform is supplied" do
lambda {
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
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