#!/usr/bin/env ruby

if RUBY_VERSION > '1.8.7' && Encoding.default_external != Encoding::UTF_8
  puts <<-DOC
\e[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
See https://github.com/CocoaPods/guides.cocoapods.org/issues/26 for
possible solutions.\e[0m\n
  DOC
end

if $PROGRAM_NAME == __FILE__ && !ENV['COCOAPODS_NO_BUNDLER']
  ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
  require "rubygems"
  require "bundler/setup"
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
elsif ENV['COCOAPODS_NO_BUNDLER']
  require "rubygems"
  gem "cocoapods"
end

STDOUT.sync = true if ENV['CP_STDOUT_SYNC'] == 'TRUE'

require 'cocoapods'
Pod::Command.run(ARGV)
