Permalink
Browse files

Silence warnings while loading Faraday for Octokit. See #278.

  • Loading branch information...
1 parent c6351ea commit f33f967427b857bf73645fd4d3f19eb05e9be0e0 @alloy alloy committed May 29, 2012
Showing with 25 additions and 22 deletions.
  1. +2 −7 Gemfile
  2. +5 −8 Gemfile.lock
  3. +2 −7 cocoapods.gemspec
  4. +8 −0 lib/cocoapods/command/spec.rb
  5. +8 −0 lib/cocoapods/specification/statistics.rb
View
@@ -5,13 +5,8 @@ gem "escape"
gem "json"
gem "open4"
-# We don't want octokit to pull in faraday 0.8.0, as it prints a warning about
-# the `system_timer` gem being needed, which isn't available on 1.9.x
-#
-# Once faraday 0.8.1 is released this should be resolved:
-# https://github.com/technoweenie/faraday/pull/147
-gem "faraday", "0.7.6"
-gem "octokit", "<= 1.0.3"
+gem "faraday", ">= 0.8.1"
+gem "octokit"
group :development do
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
View
@@ -14,10 +14,8 @@ GEM
colored (1.2)
crack (0.3.1)
escape (0.0.4)
- faraday (0.7.6)
- addressable (~> 2.2)
+ faraday (0.8.1)
multipart-post (~> 1.1)
- rack (~> 1.1)
faraday_middleware (0.8.7)
faraday (>= 0.7.4, < 0.9)
hashie (1.2.0)
@@ -32,9 +30,9 @@ GEM
mocha (>= 0.9.8)
multi_json (1.3.6)
multipart-post (1.1.5)
- octokit (1.0.3)
+ octokit (1.3.0)
addressable (~> 2.2)
- faraday (~> 0.7)
+ faraday (~> 0.8)
faraday_middleware (~> 0.8)
hashie (~> 1.2)
multi_json (~> 1.3)
@@ -43,7 +41,6 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
- rack (1.4.1)
rake (0.9.2.2)
rb-fsevent (0.9.1)
slop (2.4.4)
@@ -60,11 +57,11 @@ DEPENDENCIES
bacon
colored
escape
- faraday (= 0.7.6)
+ faraday (>= 0.8.1)
json
kicker
mocha-on-bacon
- octokit (<= 1.0.3)
+ octokit
open4
pry
rake
View
@@ -28,13 +28,8 @@ Gem::Specification.new do |s|
s.post_install_message = "[!] If this is your first time install of CocoaPods, or if " \
"you are upgrading, first run: $ pod setup"
- # We don't want octokit to pull in faraday 0.8.0, as it prints a warning about
- # the `system_timer` gem being needed, which isn't available on 1.9.x
- #
- # Once faraday 0.8.1 is released this should be resolved:
- # https://github.com/technoweenie/faraday/pull/147
- s.add_runtime_dependency 'faraday', '~> 0.7.6'
- s.add_runtime_dependency 'octokit', '<= 1.0.3'
+ s.add_runtime_dependency 'faraday', '~> 0.8.1'
+ s.add_runtime_dependency 'octokit', '~> 1.3.0'
s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
@@ -48,7 +48,15 @@ def run
def create
if repo_id_match = (@url || @name_or_url).match(/github.com\/([^\/\.]*\/[^\/\.]*)\.*/)
+ # This is to make sure Faraday doesn't warn the user about the `system_timer` gem missing.
+ old_warn, $-w = $-w, nil
+ begin
+ require 'faraday'
+ ensure
+ $-w = old_warn
+ end
require 'octokit'
+
repo_id = repo_id_match[1]
data = github_data_for_template(repo_id)
data[:name] = @name_or_url if @url
@@ -1,4 +1,12 @@
require 'yaml'
+
+# This is to make sure Faraday doesn't warn the user about the `system_timer` gem missing.
+old_warn, $-w = $-w, nil
+begin
+ require 'faraday'
+ensure
+ $-w = old_warn
+end
require 'octokit'
module Pod

0 comments on commit f33f967

Please sign in to comment.