Add 'RubyFun/' from commit 'b01c6826131196ba58b5288a3182f2526c89c249'
git-subtree-dir: RubyFun git-subtree-mainline:a04a502787
git-subtree-split:b01c682613
This commit is contained in:
5
RubyFun/wikibooks-tutorial/bus-schedules.rb
Normal file
5
RubyFun/wikibooks-tutorial/bus-schedules.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
puts <<'BUS_SCHEDULES'
|
||||
c:\napolean's documents\tomorrow's bus schedule.txt
|
||||
c:\new documents\sam spade's bus schedule.txt
|
||||
c:\bus schedules\the #9 bus schedule.txt
|
||||
BUS_SCHEDULES
|
38
RubyFun/wikibooks-tutorial/grocery-list.rb
Normal file
38
RubyFun/wikibooks-tutorial/grocery-list.rb
Normal file
@@ -0,0 +1,38 @@
|
||||
puts <<GROCERY_LIST
|
||||
Grocery list
|
||||
------------
|
||||
1. Salad mix.
|
||||
2. Strawberries.*
|
||||
3. Cereal.
|
||||
4. Milk.*
|
||||
|
||||
* Organic
|
||||
|
||||
GROCERY_LIST
|
||||
|
||||
puts '
|
||||
Categorized Grocery list
|
||||
------------------------
|
||||
'
|
||||
|
||||
puts 'Produce', '-------', <<PRODUCE, 'Dairy', '-----', <<DAIRY, '* Organic'
|
||||
1. Strawberries*
|
||||
2. Blueberries
|
||||
|
||||
PRODUCE
|
||||
1. Yogurt
|
||||
2. Milk*
|
||||
3. Cottage Cheese
|
||||
|
||||
|
||||
DAIRY
|
||||
|
||||
|
||||
puts
|
||||
puts 'Indented Grocery list',
|
||||
'---------------------', <<-GROCERY_LIST
|
||||
1. Salad mix.
|
||||
2. Strawberries.
|
||||
3. Cereal.
|
||||
4. Milk.
|
||||
GROCERY_LIST
|
2
RubyFun/wikibooks-tutorial/hello-world.rb
Executable file
2
RubyFun/wikibooks-tutorial/hello-world.rb
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env ruby
|
||||
puts 'Hello World'
|
2
RubyFun/wikibooks-tutorial/hello-world.sh
Executable file
2
RubyFun/wikibooks-tutorial/hello-world.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ruby -e "puts 'Hello World'"
|
8
RubyFun/wikibooks-tutorial/quiz.rb
Normal file
8
RubyFun/wikibooks-tutorial/quiz.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
name = 'Charlie Brown'
|
||||
|
||||
puts <<"QUIZ"
|
||||
Student: #{name}
|
||||
|
||||
1.\tQuestion: What is 4+5?
|
||||
\tAnswer: The sum of 4 and 5 is #{4+5}
|
||||
QUIZ
|
19
RubyFun/wikibooks-tutorial/strings.rb
Normal file
19
RubyFun/wikibooks-tutorial/strings.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
print "Enter name: "
|
||||
name = gets.chomp
|
||||
puts "Your name is #{name}"
|
||||
|
||||
|
||||
adjective = "dusty"
|
||||
|
||||
puts %q{These runes are "#{adjective}," wouldn't you say?}
|
||||
puts %Q{These runes are "#{adjective}," wouldn't you say?}
|
||||
|
||||
|
||||
puts %Q{Math isn't exactly my "strong suit," what with 2 + 1 being #{2 + 2}}
|
||||
|
||||
puts %Q{
|
||||
Perhaps a multiline alternate quoting is of your liking, #{name}?
|
||||
One in which 'single' and "double" quotes are both safe without
|
||||
#{adjective} quoting? Smashing!
|
||||
|
||||
}
|
1
RubyFun/wikibooks-tutorial/tutorial-url.txt
Normal file
1
RubyFun/wikibooks-tutorial/tutorial-url.txt
Normal file
@@ -0,0 +1 @@
|
||||
http://en.wikibooks.org/wiki/Ruby_Programming
|
Reference in New Issue
Block a user