Commit 9b5788e9 authored by Eloy Duran's avatar Eloy Duran

Exit early when using an old RubyGems version (< 1.4.0).

Closes #398.

Unfortunately, OS X >= 10.7 ships with 1.3.6 :(
parent 5a32b8f4
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
- Relaxed linter to accepts pod that only specify paths to preserve (like TuneupJS). - Relaxed linter to accepts pod that only specify paths to preserve (like TuneupJS).
- Gender neutralization of podfile documentation. [#384](http://git.io/MAsHXg) - Gender neutralization of podfile documentation. [#384](http://git.io/MAsHXg)
- Exit early when using an old RubyGems version (< 1.4.0). These versions contain subtle bugs
related to prelrease version comparisons. Unfortunately, OS X >= 10.7 ships with 1.3.6. [#398](http://git.io/Lr7DoA)
## 0.8.0 ## 0.8.0
......
...@@ -43,7 +43,7 @@ Now that you've got CocoaPods installed you can easily add it to your project. ...@@ -43,7 +43,7 @@ Now that you've got CocoaPods installed you can easily add it to your project.
1. If you're using a fresh out of the box Mac with Lion using Xcode from the Mac App Store, you will need to install the Command Line Tools for Xcode first: [here](https://developer.apple.com/downloads/index.action) 1. If you're using a fresh out of the box Mac with Lion using Xcode from the Mac App Store, you will need to install the Command Line Tools for Xcode first: [here](https://developer.apple.com/downloads/index.action)
2. CocoaPods re-uses some of the RubyGems 1.3.6 classes. If you have an older version (pre OS X 10.7), you will have to update RubyGems: `$ gem update --system`. 2. CocoaPods re-uses some of the RubyGems classes. If you have a version older than 1.4.0, you will have to update RubyGems: `$ gem update --system`.
## Adding it to your project ## Adding it to your project
......
require 'rubygems'
# Better to fail early and clear then during installation of pods.
#
# RubyGems 1.3.6 (which ships with OS X >= 10.7) up to 1.4.0 have a couple of
# bugs related to comparing prerelease versions.
#
# 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
module Pod module Pod
VERSION = '0.8.0' VERSION = '0.8.0'
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
require 'rbconfig' require 'rbconfig'
require 'cgi' require 'cgi'
require 'rubygems'
module Pod module Pod
class Command class Command
......
module Gem
end
require 'rubygems/dependency'
require 'open-uri' require 'open-uri'
module Pod module Pod
......
module Gem
end
require 'rubygems/version'
module Pod module Pod
class Version < Gem::Version class Version < Gem::Version
......
require File.expand_path('../../spec_helper', __FILE__)
module Pod
describe Version do
it "returns wether or not it's a `bleeding edge' version" do
version = Version.new('1.2.3')
version.should.not.be.head
version.head = true
version.should.be.head
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