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