Skip to content

Commit f5d44bd

Browse files
committed
Initial commit
0 parents  commit f5d44bd

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print 'Hello World'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'rspec'
2+
3+
describe 'Your code' do
4+
it 'prints out "Hello World"' do
5+
expect { [['solution::code']] }.to output('Hello World').to_stdout
6+
end
7+
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Say Hello World in Ruby
2+
3+
In Ruby you can print to the standard output by using the *print* method.
4+
If you want to print a new line you can use the *puts* (or the shorter *p*)
5+
method.
6+
7+
*print* and *puts* take one or multiple comma-separated objects as parameter
8+
and turns them into a String before printing to the the standard output
9+
*$stdout*.
10+
11+
`print 'a'` just prints out *a*.
12+
`print 'a', 'b', 'c'` prints out *abc*.
13+
14+
The two *''* declare a Ruby String object. You can also use *""* to create a
15+
String. We will discuss the difference of *''* and *""* later on.
16+
17+
## For now, let's do the Hello World example in Ruby:
18+
19+
-----
20+
21+
Print out *Hello* *World* to the standard output!
22+
23+
-----

0 commit comments

Comments
 (0)