|
|
|
|
|
by Xylakant
4897 days ago
|
|
> That seems to both imply and endorse a convention. Sure. The convention endorsed is "should, but not required". That's exactly what happens. A pattern I see often is something along the lines of def ssl?(url)
url.match /^https/
end
which returns nil in the case the url doesn't start with https and a matchdata object if it does. jruby-1.6.8 :092 > def ssl?(url)
jruby-1.6.8 :093?> url.match /^https/
jruby-1.6.8 :094?> end
=> nil
jruby-1.6.8 :095 > ssl? "https://google.com"
=> #<MatchData "https">
jruby-1.6.8 :096 > ssl? "http://google.com"
=> nil
|
|
Now in that whole Rails hoopla, it turned into "it's not required and neither defined? nor nonzero? do it," ignoring the whole "should" part. And now people are pointing at Rails as another example, reinforcing their own bias.