Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Rubocop] Fix SpecialGlobalVars

  • Loading branch information...
commit 5a909ca61d2f50a332b838f2803512c209d4a7f7 1 parent e76e5fb
@fabiopelosin fabiopelosin authored
View
2  Rakefile
@@ -80,7 +80,7 @@ end
desc 'Print the options of the various downloaders'
task :print_options do
title 'Downloaders options'
- $:.unshift File.expand_path('../lib', __FILE__)
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'cocoapods-downloader'
include Pod::Downloader
View
2  examples/downloading_a_git_repo.rb
@@ -1,4 +1,4 @@
-$:.unshift(File.expand_path('../../lib', __FILE__))
+$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'cocoapods-downloader'
View
2  lib/cocoapods-downloader.rb
@@ -3,7 +3,7 @@ module Downloader
if RUBY_VERSION >= '1.9.3'
require 'English'
else
- alias $CHILD_STATUS $?
+ alias $CHILD_STATUS $CHILD_STATUS
end
require 'cocoapods-downloader/gem_version'
View
2  lib/cocoapods-downloader/api.rb
@@ -21,7 +21,7 @@ def execute_command(executable, command, raise_on_failure = false)
# @return [void]
#
def check_exit_code!(executable, command, output)
- if $?.to_i != 0
+ if $CHILD_STATUS.to_i != 0
raise DownloaderError, "Error on `#{executable} #{command}`.\n#{output}"
end
end
View
6 lib/cocoapods-downloader/git.rb
@@ -143,7 +143,7 @@ def download_branch
def ref_exists?(ref)
if cache_exist?
Dir.chdir(cache_path) { git "rev-list --max-count=1 #{ref}" }
- $? == 0
+ $CHILD_STATUS == 0
else
false
end
@@ -164,7 +164,7 @@ def ensure_ref_exists(ref)
#
def branch_exists?(branch)
Dir.chdir(cache_path) { git "branch --all | grep #{branch}$" } # check for remote branch and do suffix matching ($ anchor)
- $? == 0
+ $CHILD_STATUS == 0
end
# @return [void] Checks if a branch exists in the cache and updates
@@ -175,7 +175,7 @@ def branch_exists?(branch)
def ensure_remote_branch_exists(branch)
return if branch_exists?(branch)
update_cache
- raise DownloaderError, "Cache unable to find git reference `#{branch}' for `#{url}' (#{$?})." unless branch_exists?(branch)
+ raise DownloaderError, "Cache unable to find git reference `#{branch}' for `#{url}' (#{$CHILD_STATUS})." unless branch_exists?(branch)
end
#--------------------------------------#
View
2  rubocop-todo.yml
@@ -23,8 +23,6 @@ RaiseArgs:
Enabled: false
RegexpLiteral:
Enabled: false
-SpecialGlobalVars:
- Enabled: false
TrailingComma:
Enabled: false
UnusedMethodArgument:
View
2  spec/spec_helper.rb
@@ -20,7 +20,7 @@
require 'vcr'
require 'webmock'
-$:.unshift File.expand_path('../../lib', __FILE__)
+$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'cocoapods-downloader'
#-- Output suppression -------------------------------------------------------#
Please sign in to comment.
Something went wrong with that request. Please try again.