Commit 054fe5c8 authored by Eloy Durán's avatar Eloy Durán

Update to the latest version of CLAide.

parent 178ceade
......@@ -3,7 +3,7 @@ source "http://rubygems.org"
gemspec
# TODO
gem "cli_aide", :git => "git://github.com/alloy/CLAide.git"
gem "claide", :git => "git://github.com/alloy/CLAide.git"
group :development do
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
......
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
revision: cc71c669a05934886c56169bbe209014a7a1af8e
revision: eaab002f308e2641232630b1b5d4ab3c2f10a10a
specs:
xcodeproj (0.4.0.rc1)
xcodeproj (0.4.0.rc3)
activesupport (~> 3.2.6)
colored (~> 1.2)
GIT
remote: git://github.com/alloy/CLAide.git
revision: 914c38cabeae22c946e96952b32708edf5e5030a
revision: fdcc73837ff0c67b440fa9a20dc6366c78f06f09
specs:
cli_aide (0.0.1)
claide (0.0.1)
GIT
remote: https://github.com/alloy/kicker.git
......@@ -93,7 +93,7 @@ PLATFORMS
DEPENDENCIES
awesome_print
bacon
cli_aide!
claide!
cocoapods!
github-markup
kicker!
......
......@@ -12,16 +12,15 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(
end
require 'cocoapods/version'
require 'cli_aide'
module Pod
class PlainInformative < CLIAide::Command::Informative
class PlainInformative < StandardError
end
class Informative < PlainInformative
def message
# TODO: remove formatting from raise calls and remove conditional
super !~ /\[!\]/ ? "[!] #{super}\n".red : super
super !~ /\[!\]/ ? "[!] #{super}".red : super
end
end
......
require 'colored'
require 'claide'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/string/strip.rb'
# TODO why does this not automatically occur even though colored is required first?
CLAide::Command.colorize_output = true
module Pod
class Command < CLIAide::Command
class PlainInformative
include CLAide::Command::InformativeError
end
class Command < CLAide::Command
autoload :ErrorReport, 'cocoapods/command/error_report'
autoload :Linter, 'cocoapods/command/linter'
......@@ -12,76 +20,35 @@ module Pod
def self.options
[
['--silent', 'Print nothing'],
['--no-color', 'Print output without color'],
['--version', 'Prints the version of CocoaPods'],
['--silent', 'Show nothing'],
['--version', 'Show the version of CocoaPods'],
].concat(super)
end
#def self.run(argv)
#super
#p Config.instance.verbose?
#end
#def self.run(*argv)
#sub_command = parse(*argv)
#unless sub_command.is_a?(Setup) || ENV['SKIP_SETUP']
#Setup.new(ARGV.new).run_if_needed
#end
#sub_command.run
#UI.puts
#rescue Interrupt
#puts "[!] Cancelled".red
#Config.instance.verbose? ? raise : exit(1)
#rescue Exception => e
#if e.is_a?(PlainInformative) || ENV['COCOA_PODS_ENV'] == 'development' # also catches Informative
#puts e.message
#puts *e.backtrace if Config.instance.verbose? || ENV['COCOA_PODS_ENV'] == 'development'
#else
#puts ErrorReport.report(e)
#end
#exit 1
#end
#def self.parse(*argv)
#argv = ARGV.new(argv)
#if argv.option('--version')
#puts VERSION
#exit!(0)
#end
#show_help = argv.option('--help')
#Config.instance.silent = argv.option('--silent')
#Config.instance.verbose = argv.option('--verbose')
#String.send(:define_method, :colorize) { |string , _| string } if argv.option( '--no-color' )
#command_class = case command_argument = argv.shift_argument
#when 'install' then Install
#when 'list' then List
#when 'outdated' then Outdated
#when 'push' then Push
#when 'repo' then Repo
#when 'search' then Search
#when 'setup' then Setup
#when 'spec' then Spec
#when 'update' then Update
#end
def self.parse(argv)
command = super
unless command.is_a?(Setup) || ENV['SKIP_SETUP']
Setup.new(CLAide::ARGV.new([])).run_if_needed
end
command
end
#if command_class.nil?
#raise Help.new(self, argv, command_argument)
#elsif show_help
#raise Help.new(command_class, argv)
#else
#command_class.new(argv)
#end
#end
def self.report_error(error)
if error.is_a?(Interrupt)
puts "[!] Cancelled".red
Config.instance.verbose? ? raise : exit(1)
else
puts ErrorReport.report(error)
exit 1
end
end
def initialize(argv)
config.silent = argv.flag?('silent')
super
config.verbose = verbose?
config.verbose = self.verbose?
# TODO we should probably not even load colored unless needed
String.send(:define_method, :colorize) { |string , _| string } unless self.colorize_output?
end
include Config::Mixin
......
module Pod
class Command
class List < Command
self.summary = 'Lists all available pods.'
self.summary = 'List pods'
self.description = 'Lists all available pods.'
def self.options
[[
......@@ -36,7 +37,7 @@ module Pod
end
class New < List
self.summary = 'Lists the pods introduced in the master repository since the last check.'
self.summary = 'Lists pods introduced in the master spec-repo since the last check'
def run
update_if_necessary!
......
module Pod
class Command
class Outdated < Command
self.summary = 'Show outdated project dependencies.'
self.summary = 'Show outdated project dependencies'
self.description = <<-DESC
Shows the outdated pods in the current Podfile.lock, but only those from
......
......@@ -29,7 +29,7 @@ module Pod
class Install < Command
include Project
self.summary = 'Installs dependencies of a project.'
self.summary = 'Install project dependencies'
self.description = <<-DESC
Downloads all dependencies defined in `Podfile' and creates an Xcode
......@@ -57,7 +57,7 @@ module Pod
class Update < Command
include Project
self.summary = 'Update outdated project dependencies.'
self.summary = 'Update outdated project dependencies'
def run
verify_podfile_exists!
......
......@@ -4,7 +4,7 @@ require 'active_support/core_ext/string/inflections'
module Pod
class Command
class Push < Command
self.summary = 'Push new specifications to a spec-repo.'
self.summary = 'Push new specifications to a spec-repo'
self.description = <<-DESC
Validates NAME.podspec or `*.podspec' in the current working dir, creates
......@@ -31,7 +31,7 @@ module Pod
super
end
def validate_argv!
def validate!
super
help! "A spec-repo name is required." unless @repo
end
......
......@@ -6,7 +6,7 @@ module Pod
self.abstract_command = true
# TODO should not show a usage banner!
self.summary = 'Managed spec repos.'
self.summary = 'Manage spec-repositories'
class Add < Repo
self.summary = 'Add a spec repo.'
......@@ -23,7 +23,7 @@ module Pod
super
end
def validate_argv!
def validate!
super
unless @name && @url
help! "Adding a repo needs a `NAME' and a `URL."
......
module Pod
class Command
class Search < Command
self.summary = 'Search available pods.'
self.summary = 'Search pods'
self.description = <<-DESC
Searches for pods, ignoring case, whose name matches `QUERY'. If the
......@@ -25,7 +25,7 @@ module Pod
super
end
def validate_argv!
def validate!
super
help! "A search query is required." unless @query
end
......
module Pod
class Command
class Setup < Command
self.summary = 'Setup the CocoaPods environment.'
self.summary = 'Setup the CocoaPods environment'
self.description = <<-DESC
Creates a directory at `~/.cocoapods' which will hold your spec-repos.
......
......@@ -5,8 +5,7 @@ require 'active_support/core_ext/string/inflections'
module Pod
class Command
class Spec < Command
# TODO should not show a usage banner!
self.summary = 'Managing PodSpec files'
self.summary = 'Manage pod specs'
class Create < Spec
self.summary = 'Create spec file stub.'
......@@ -23,7 +22,7 @@ module Pod
super
end
def validate_argv!
def validate!
super
help! "A pod name or repo URL is required." unless @name_or_url
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