Skip to content

Commit

Permalink
Merge pull request #512 from CocoaPods/b0.15.0
Browse files Browse the repository at this point in the history
0.15.0
  • Loading branch information
fabiopelosin committed Sep 21, 2012
2 parents 0cc4fd5 + efba29b commit 3ec34b5
Show file tree
Hide file tree
Showing 38 changed files with 779 additions and 512 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.15.0 (unreleased)

[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/master...b0.15.0)

###### Enhancements

- Added a pre install hook to the Podfile and to root specifications.
[#486](https://github.com/CocoaPods/CocoaPods/issues/486)
- Support for `header_mappings_dir` attribute in subspecs.
- Refactored UI.

###### Bug fixes

- Improvements to the git cache that should be more robust.
[#517](https://github.com/CocoaPods/CocoaPods/issues/517)

## Master

[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.14.0...master)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#
# E.g. https://github.com/CocoaPods/CocoaPods/issues/398
unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(Gem::VERSION))
require 'colored'
STDERR.puts "Your RubyGems version (#{Gem::VERSION}) is too old, please update with: `gem update --system`".red
exit 1
end
Expand Down Expand Up @@ -41,6 +40,7 @@ def message
autoload :Source, 'cocoapods/source'
autoload :Spec, 'cocoapods/specification'
autoload :Specification, 'cocoapods/specification'
autoload :UI, 'cocoapods/user_interface'
autoload :Version, 'cocoapods/version'

autoload :Pathname, 'pathname'
Expand Down
23 changes: 4 additions & 19 deletions lib/cocoapods/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Command
autoload :List, 'cocoapods/command/list'
autoload :Linter, 'cocoapods/command/linter'
autoload :Outdated, 'cocoapods/command/outdated'
autoload :Presenter, 'cocoapods/command/presenter'
autoload :Push, 'cocoapods/command/push'
autoload :Repo, 'cocoapods/command/repo'
autoload :Search, 'cocoapods/command/search'
Expand Down Expand Up @@ -74,6 +73,7 @@ def self.run(*argv)
Setup.new(ARGV.new).run_if_needed
end
sub_command.run
UI.puts

rescue Interrupt
puts "[!] Cancelled".red
Expand Down Expand Up @@ -145,24 +145,9 @@ def verify_lockfile_exists!

def update_spec_repos_if_necessary!
if @update_repo
print_title 'Updating Spec Repositories', true
Repo.new(ARGV.new(["update"])).run
end
end

def print_title(title, only_verbose = true)
if config.verbose?
puts "\n" + title.yellow
elsif !config.silent? && !only_verbose
puts title
end
end

def print_subtitle(title, only_verbose = false)
if config.verbose?
puts "\n" + title.green
elsif !config.silent? && !only_verbose
puts title
UI.section 'Updating Spec Repositories' do
Repo.new(ARGV.new(["update"])).run
end
end
end
end
Expand Down
27 changes: 16 additions & 11 deletions lib/cocoapods/command/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,26 @@ def self.banner
end

def self.options
[["--update", "Run `pod repo update` before listing"]].concat(Presenter.options).concat(super)
[[
"--update", "Run `pod repo update` before listing",
"--stats", "Show additional stats (like GitHub watchers and forks)"
]].concat(super)
end

extend Executable
executable :git

def initialize(argv)
@update = argv.option('--update')
@new = argv.option('new')
@presenter = Presenter.new(argv)
@update = argv.option('--update')
@stats = argv.option('--stats')
@new = argv.option('new')
super unless argv.empty?
end

def list_all
sets = Source.all_sets
sets.each {|s| puts @presenter.describe(s)}
puts "\n#{sets.count} pods were found"
sets.each { |set| UI.pod(set, :name) }
UI.puts "\n#{sets.count} pods were found"
end

def list_new
Expand All @@ -53,16 +56,18 @@ def list_new
days.reverse.each do |d|
sets = groups[d]
next unless sets
puts "\nPods added in the last #{d == 1 ? 'day' : "#{d} days"}".yellow
sets.sort_by {|s| creation_dates[s.name]}.each {|s| puts @presenter.describe(s)}
UI.section("\nPods added in the last #{"day".pluralize(d)}".yellow) do
sorted = sets.sort_by {|s| creation_dates[s.name]}
sorted.each { |set| UI.pod(set, (@stats ? :stats : :name)) }
end
end
end

def run
puts "\nUpdating Spec Repositories\n".yellow if @update && config.verbose?
Repo.new(ARGV.new(["update"])).run if @update
UI.section("\nUpdating Spec Repositories\n".yellow) do
Repo.new(ARGV.new(["update"])).run
end if @update && config.verbose?
@new ? list_new : list_all
puts
end
end
end
Expand Down
61 changes: 0 additions & 61 deletions lib/cocoapods/command/presenter.rb

This file was deleted.

118 changes: 0 additions & 118 deletions lib/cocoapods/command/presenter/cocoa_pod.rb

This file was deleted.

15 changes: 7 additions & 8 deletions lib/cocoapods/command/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,20 @@ def run
update_repo
add_specs_to_repo
push_repo unless @local_only
puts
end

private

def update_repo
puts "Updating the `#{@repo}' repo\n".yellow unless config.silent
UI.puts "Updating the `#{@repo}' repo\n".yellow unless config.silent
# show the output of git even if not verbose
# TODO: use the `git!' and find a way to show the output in realtime.
Dir.chdir(repo_dir) { puts `git pull 2>&1` }
Dir.chdir(repo_dir) { UI.puts `git pull 2>&1` }
end

def push_repo
puts "\nPushing the `#{@repo}' repo\n".yellow unless config.silent
Dir.chdir(repo_dir) { puts `git push 2>&1` }
UI.puts "\nPushing the `#{@repo}' repo\n".yellow unless config.silent
Dir.chdir(repo_dir) { UI.puts `git push 2>&1` }
end

def repo_dir
Expand All @@ -72,7 +71,7 @@ def podspec_files
end

def validate_podspec_files
puts "\nValidating specs".yellow unless config.silent
UI.puts "\nValidating specs".yellow unless config.silent
lint_argv = ["lint"]
lint_argv << "--only-errors" if @allow_warnings
lint_argv << "--silent" if config.silent
Expand All @@ -83,7 +82,7 @@ def validate_podspec_files
end

def add_specs_to_repo
puts "\nAdding the specs to the #{@repo} repo\n".yellow unless config.silent
UI.puts "\nAdding the specs to the #{@repo} repo\n".yellow unless config.silent
podspec_files.each do |spec_file|
spec = Pod::Specification.from_file(spec_file)
output_path = File.join(repo_dir, spec.name, spec.version.to_s)
Expand All @@ -94,7 +93,7 @@ def add_specs_to_repo
else
message = "[Add] #{spec}"
end
puts " - #{message}" unless config.silent
UI.puts " - #{message}" unless config.silent

FileUtils.mkdir_p(output_path)
FileUtils.cp(Pathname.new(spec.name+'.podspec'), output_path)
Expand Down
Loading

0 comments on commit 3ec34b5

Please sign in to comment.