Commit 5c8361cc authored by Fabio Pelosin's avatar Fabio Pelosin

[UI] Redirect cocoapdods-core UI & send warnings to STDERR & improve support in specs.

parent 8d13719d
...@@ -6,9 +6,13 @@ end ...@@ -6,9 +6,13 @@ end
gemspec gemspec
group :development do group :development do
gem "cocoapods-core", :git => "git://github.com/CocoaPods/Core.git" gem "cocoapods-core", :git => "git://github.com/CocoaPods/Core.git"
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git" gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
gem "cocoapods-downloader", :path => '../cocoapods-downloader' gem "cocoapods-downloader", :git => "git://github.com/CocoaPods/cocoapods-downloader"
# gem "cocoapods-core", :path => "../Core"
# gem "xcodeproj", :path => "../Xcodeproj"
# gem "cocoapods-downloader", :path => "../cocoapods-downloader"
gem "mocha", "~> 0.11.4" gem "mocha", "~> 0.11.4"
gem "bacon" gem "bacon"
......
GIT
remote: git://github.com/CocoaPods/Core.git
revision: 163c8f3d20aadb91b1987acb57e266ed839040ba
specs:
cocoapods-core (0.17.0.alpha)
activesupport (~> 3.2.6)
faraday (~> 0.8.1)
octokit (~> 1.7)
GIT GIT
remote: git://github.com/CocoaPods/Xcodeproj.git remote: git://github.com/CocoaPods/Xcodeproj.git
revision: e3dc945c7fdbbd9f977f6bc14b3e6023b99dc5e1 revision: e3dc945c7fdbbd9f977f6bc14b3e6023b99dc5e1
...@@ -15,6 +6,12 @@ GIT ...@@ -15,6 +6,12 @@ GIT
activesupport (~> 3.2.6) activesupport (~> 3.2.6)
colored (~> 1.2) colored (~> 1.2)
GIT
remote: git://github.com/CocoaPods/cocoapods-downloader
revision: 21f5a7b118d4071f21f810694d026c3a4e00df50
specs:
cocoapods-downloader (0.1.0)
GIT GIT
remote: https://github.com/alloy/kicker.git remote: https://github.com/alloy/kicker.git
revision: 6430787ebf8b9305acc2d2f89ae5cf01d2cd5488 revision: 6430787ebf8b9305acc2d2f89ae5cf01d2cd5488
...@@ -41,9 +38,12 @@ PATH ...@@ -41,9 +38,12 @@ PATH
xcodeproj (~> 0.4.0) xcodeproj (~> 0.4.0)
PATH PATH
remote: ../cocoapods-downloader remote: ../Core
specs: specs:
cocoapods-downloader (0.1.0) cocoapods-core (0.17.0.alpha)
activesupport (~> 3.2.6)
faraday (~> 0.8.1)
octokit (~> 1.7)
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
......
...@@ -121,7 +121,7 @@ module Pod ...@@ -121,7 +121,7 @@ module Pod
# return [void] # return [void]
# #
def warn(message, actions = []) def warn(message, actions = [])
puts("\n[!] #{message}".yellow) STDERR.puts("\n[!] #{message}".yellow)
actions.each do |action| actions.each do |action|
indented = wrap_string(action, " - ") indented = wrap_string(action, " - ")
puts(indented) puts(indented)
...@@ -223,4 +223,19 @@ module Pod ...@@ -223,4 +223,19 @@ module Pod
end end
end end
UI = UserInterface UI = UserInterface
# Redirect copods-core UI.
#
module CoreUI
class << self
def puts(message)
UI.puts message
end
def warn(message)
UI.warn message
end
end
end
end end
module Pod module Pod
module UI module UI
@output = '' @output = ''
@warnings = ''
class << self class << self
attr_accessor :output attr_accessor :output
attr_accessor :warnings
def puts(message = '') def puts(message = '')
# Wrapping can bite in tests. # Wrapping can bite in tests.
@output << "#{message}".gsub(/\n/,'') @output << "#{message}".gsub(/\n/,'')
end end
def warn(message = '', actions = [])
# Wrapping can bite in tests.
@warnings << "#{message}".gsub(/\n/,'')
end
end end
end end
end end
...@@ -68,7 +68,7 @@ module Pod ...@@ -68,7 +68,7 @@ module Pod
it "warns if the podfile does not contain any dependency" do it "warns if the podfile does not contain any dependency" do
Podfile::TargetDefinition.any_instance.stubs(:empty?).returns(true) Podfile::TargetDefinition.any_instance.stubs(:empty?).returns(true)
@integrator.integrate! @integrator.integrate!
UI.output.should.include?('The Podfile does not contain any dependency') UI.warnings.should.include?('The Podfile does not contain any dependency')
end end
end end
end end
......
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