Created
October 8, 2015 14:48
-
-
Save allolex/bbac6d0821b7886a047f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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