Skip to content

Commit

Permalink
[Rubocop] Fix SpecialGlobalVars
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed May 9, 2014
1 parent e76e5fb commit 5a909ca
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ end
desc 'Print the options of the various downloaders' desc 'Print the options of the various downloaders'
task :print_options do task :print_options do
title 'Downloaders options' title 'Downloaders options'
$:.unshift File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'cocoapods-downloader' require 'cocoapods-downloader'
include Pod::Downloader include Pod::Downloader


Expand Down
2 changes: 1 addition & 1 deletion examples/downloading_a_git_repo.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
$:.unshift(File.expand_path('../../lib', __FILE__)) $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))


require 'cocoapods-downloader' require 'cocoapods-downloader'


Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-downloader.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Downloader
if RUBY_VERSION >= '1.9.3' if RUBY_VERSION >= '1.9.3'
require 'English' require 'English'
else else
alias $CHILD_STATUS $? alias $CHILD_STATUS $CHILD_STATUS
end end


require 'cocoapods-downloader/gem_version' require 'cocoapods-downloader/gem_version'
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-downloader/api.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def execute_command(executable, command, raise_on_failure = false)
# @return [void] # @return [void]
# #
def check_exit_code!(executable, command, output) 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}" raise DownloaderError, "Error on `#{executable} #{command}`.\n#{output}"
end end
end end
Expand Down
6 changes: 3 additions & 3 deletions lib/cocoapods-downloader/git.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def download_branch
def ref_exists?(ref) def ref_exists?(ref)
if cache_exist? if cache_exist?
Dir.chdir(cache_path) { git "rev-list --max-count=1 #{ref}" } Dir.chdir(cache_path) { git "rev-list --max-count=1 #{ref}" }
$? == 0 $CHILD_STATUS == 0
else else
false false
end end
Expand All @@ -164,7 +164,7 @@ def ensure_ref_exists(ref)
# #
def branch_exists?(branch) def branch_exists?(branch)
Dir.chdir(cache_path) { git "branch --all | grep #{branch}$" } # check for remote branch and do suffix matching ($ anchor) Dir.chdir(cache_path) { git "branch --all | grep #{branch}$" } # check for remote branch and do suffix matching ($ anchor)
$? == 0 $CHILD_STATUS == 0
end end


# @return [void] Checks if a branch exists in the cache and updates # @return [void] Checks if a branch exists in the cache and updates
Expand All @@ -175,7 +175,7 @@ def branch_exists?(branch)
def ensure_remote_branch_exists(branch) def ensure_remote_branch_exists(branch)
return if branch_exists?(branch) return if branch_exists?(branch)
update_cache 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 end


#--------------------------------------# #--------------------------------------#
Expand Down
2 changes: 0 additions & 2 deletions rubocop-todo.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ RaiseArgs:
Enabled: false Enabled: false
RegexpLiteral: RegexpLiteral:
Enabled: false Enabled: false
SpecialGlobalVars:
Enabled: false
TrailingComma: TrailingComma:
Enabled: false Enabled: false
UnusedMethodArgument: UnusedMethodArgument:
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
require 'vcr' require 'vcr'
require 'webmock' require 'webmock'


$:.unshift File.expand_path('../../lib', __FILE__) $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'cocoapods-downloader' require 'cocoapods-downloader'


#-- Output suppression -------------------------------------------------------# #-- Output suppression -------------------------------------------------------#
Expand Down

0 comments on commit 5a909ca

Please sign in to comment.