Commit 066aac5d authored by Fabio Pelosin's avatar Fabio Pelosin

[UI] Adaptation for Core extraction.

parent 1c129859
module Pod module Pod
require 'colored'
#
#
module UserInterface module UserInterface
autoload :UIPod, 'cocoapods/user_interface/ui_pod' require 'colored'
@title_colors = %w|yellow green| @title_colors = %w|yellow green|
@title_level = 0 @title_level = 0
...@@ -10,6 +12,7 @@ module Pod ...@@ -10,6 +12,7 @@ module Pod
@treat_titles_as_messages = false @treat_titles_as_messages = false
class << self class << self
include Config::Mixin include Config::Mixin
attr_accessor :indentation_level, :title_level attr_accessor :indentation_level, :title_level
...@@ -22,8 +25,8 @@ module Pod ...@@ -22,8 +25,8 @@ module Pod
# to their level. In normal mode titles are printed only if # to their level. In normal mode titles are printed only if
# they have nesting level smaller than 2. # they have nesting level smaller than 2.
# #
# TODO: refactor to title (for always visible titles like search) # TODO: Refactor to title (for always visible titles like search)
# and sections (titles that reppresent collapsible sections). # and sections (titles that represent collapsible sections).
# #
def section(title, verbose_prefix = '', relative_indentation = 0) def section(title, verbose_prefix = '', relative_indentation = 0)
if config.verbose? if config.verbose?
...@@ -114,7 +117,7 @@ module Pod ...@@ -114,7 +117,7 @@ module Pod
# #
# return [void] # return [void]
# #
def warn(message, actions) def warn(message, actions = [])
puts("\n[!] #{message}".yellow) puts("\n[!] #{message}".yellow)
actions.each do |action| actions.each do |action|
indented = wrap_string(action, " - ") indented = wrap_string(action, " - ")
...@@ -140,7 +143,7 @@ module Pod ...@@ -140,7 +143,7 @@ module Pod
if mode == :name if mode == :name
puts_indented set.name puts_indented set.name
else else
pod = UIPod.new(set) pod = Specification::Set::Presenter.new(set)
title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do
puts_indented pod.summary puts_indented pod.summary
labeled('Homepage', pod.homepage) labeled('Homepage', pod.homepage)
......
...@@ -6,7 +6,7 @@ describe Pod::UI do ...@@ -6,7 +6,7 @@ describe Pod::UI do
before do before do
@set = Pod::Source.search(Pod::Dependency.new('CocoaLumberjack')) @set = Pod::Source.search(Pod::Dependency.new('CocoaLumberjack'))
Pod::Specification::Statistics.instance.cache_file = nil Pod::Specification::Set::Statistics.instance.cache_file = nil
end end
it "presents the name, version, description, homepage and source of a specification set" do it "presents the name, version, description, homepage and source of a specification set" 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