Giter VIP home page Giter VIP logo

Comments (5)

aufflick avatar aufflick commented on June 3, 2024

@fabiopelosin are you sure .to_i is required? A big downside to that approach is that if the symbol is nil (eg. when $CHILD_STATUS does not exist as a variable) then .to_i will return zero and thus indicate success.

Β§ ruby -e "print nil.to_i == 0 ? 'yes' : 'no'"
yes
Β§ ruby -e 'print $FLUBBER.to_i == 0 ? "yes" : "no"'
yes

If you do need to force to integer for comparison you should probably check for nil first also. I know

from cocoapods-downloader.

fabiopelosin avatar fabiopelosin commented on June 3, 2024

@aufflick Thanks... I added the .to_i expecting to raise a no method error in case of nil... actually I've read about this behavior but it was completely lost in the inners of my mind.

I will fix it... thanks!

from cocoapods-downloader.

alloy avatar alloy commented on June 3, 2024

@fabiopelosin I don’t particularly like them, but can we just use the default Ruby globals instead? I.e. $? in this situation?

from cocoapods-downloader.

fabiopelosin avatar fabiopelosin commented on June 3, 2024

@alloy I was planning to go back to $? as long as we support Ruby 1.8.7 because it is just not worth it (working on another gem I have disabled this check on the cocoapods configuration of RuboCop exactly for this reason).

from cocoapods-downloader.

alloy avatar alloy commented on June 3, 2024

πŸ‘

from cocoapods-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.