Skip to content

Commit

Permalink
Use $? instead of $CHILD_STATUS
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed Aug 19, 2014
1 parent aadc1a3 commit b2128b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions lib/cocoapods-downloader.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
module Pod
module Downloader
if RUBY_VERSION >= '1.9.3'
require 'English'
else
# rubocop:disable Style/SpecialGlobalVars
alias $CHILD_STATUS $?
# rubocop:enable Style/SpecialGlobalVars
end

require 'cocoapods-downloader/gem_version'
require 'cocoapods-downloader/api'
require 'cocoapods-downloader/api_exposable'
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods-downloader/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def execute_command(executable, command, raise_on_failure = false)
# @return [void]
#
def check_exit_code!(executable, command, output)
if $CHILD_STATUS.to_i != 0
if $?.to_i != 0

This comment has been minimized.

Copy link
@alloy

alloy Sep 25, 2014

Member

Not sure if you knew this one, but $? is a Process::Status object and has a exitstatus method: http://apidock.com/ruby/Process/Status/exitstatus.

I have no further opinion on which is better, though ;)

This comment has been minimized.

Copy link
@fabiopelosin

fabiopelosin Sep 25, 2014

Author Member

Iirc, I though about it but I didn't wanted to change all the $?.to_i calls to $?.exitstatus in all the repos and aliases are bad :-)

However, now that I rethink about it would have been a more sensible choice and should be changed everywhere.

This comment has been minimized.

Copy link
@alloy

alloy Sep 25, 2014

Member

Sorry for that :P

raise DownloaderError, "Error on `#{executable} #{command}`.\n#{output}"
end
end
Expand Down

0 comments on commit b2128b1

Please sign in to comment.