Skip to content

Instantly share code, notes, and snippets.

@allolex
Created October 8, 2015 14:48
Show Gist options
  • Select an option

  • Save allolex/bbac6d0821b7886a047f to your computer and use it in GitHub Desktop.

Select an option

Save allolex/bbac6d0821b7886a047f to your computer and use it in GitHub Desktop.
# Here we're demoing how puts and p work,
# as well as logging and commenting.
#1.+()
# puts "Hello World"
# p "Hello World!"
# p "Hello World!\n"
puts "This is the Ruby version (puts)"
puts RUBY_VERSION
puts "This is the Ruby version (p)"
p RUBY_VERSION # you know, the Ruby verssion
# puts 4
# p 4
def printstuff
puts <<-EOP.upcase.gsub(/(\n|\A)[ ]{2}/, "\n")
This
is
stuff
inna
heredoc.
EOP
end
printstuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment