Быстрый ответ: Добавьте конфигурацию прокси с параметром для обеих установок/обновлений
gem install --http-proxy http://host:port/ package_name
gem update --http-proxy http://host:port/ package_name
I actually prefer that technique in a number of languages, since it's sometimes hard to differentiate between an empty string literal ""
and several other strings (" "
, '"'
).
But there's another reason to avoid theString == ""
in ECMAScript: 0 == ""
evaluates to true
, as does false == ""
and 0.0 == ""
...
...so unless you know that theString
is actually a string, you might end up causing problems for yourself by using the weak comparison. Fortunately, you can avoid this with judicious use of the strict equal (===
) operator:
if ( theString === "" )
// string is a string and is empty
The problem is that if theString
is set to 0
(zero) your 2nd example will evaluate to true.