ruby -run -e httpd . -p 8080
module Adding
class SomeSpace
def ugly_text
<<HERE
Such ugly indentation
isn't it?
HERE
end
end
end
module Adding
class SomeSpace
def beautiful_text
<<-HERE.strip_heredoc
Beautifully indented
isn't it?
HERE
end
end
end
printf "super\nsize\nme" | ruby -ne 'puts $_.upcase'
require 'active_support/core_ext'
params = {
scope: "read, write & profit",
url: "http://referralcandy.com"
}
params.to_query
# => "scope=read%2C+write+%26+profit&url=http%3A%2F%2Freferralcandy.com"
require 'rack'
query = "url=http%3A%2F%2Freferralcandy.com&scope=read%26profit"
Rack::Utils.parse_nested_query(query)
# => {"url"=>"http://referralcandy.com", "scope"=>"read&profit"}
loop do begin
booom
rescue Exception => e
end
end
Exception
NoMemoryError
ScriptError
LoadError
NotImplementedError
SyntaxError
SignalException
Interrupt
StandardError
ArgumentError
IOError
EOFError
IndexError
LocalJumpError
NameError
NoMethodError
RangeError
FloatDomainError
RegexpError
RuntimeError
Timeout::Error
SecurityError
SocketError
SystemCallError
SystemStackError
ThreadError
TypeError
ZeroDivisionError
SystemExit
fatal
begin
booom
rescue => e
end