/ruby-hard-way

Doing the exercises from the book - LRTHW

Primary LanguageRuby

Exercise 7

Exercise 11

Exercise 13

ruby ex13.rb 12 17 29

Exercise 16

ruby ex16.rb test.txt

Exercise 17

echo "This is a test file." > test.txt
ruby ex17.rb test.txt new_file.txt

Exercise 18

Exercise 20

ruby ex20.rb test.txt
ri File#seek

Exercise 24

Exercise 25

irb
require "./ex25.rb"
sentence = "All good things come to those who wait."
words = Ex25.break_words(sentence)
sorted_words = Ex25.sort_words(words)
Ex25.print_first_word(words)
Ex25.print_last_word(words)
Ex25.print_first_word(sorted_words)
Ex25.print_last_word(sorted_words)
sorted_words = Ex25.sort_sentence(sentence)
Ex25.print_first_and_last(sentence)
Ex25.print_first_and_last_sorted(sentence)

Exercise 37

Exercise 41

Exercise 46

rake test

Exercise 47

cp -r ex46 ex47
mv NAME.gemspec ex47.gemspec
mv bin/NAME bin/ex47
mv tests/test_NAME.rb tests/test_ex47.rb
mv lib/NAME lib/ex47
mv lib/NAME.rb lib/ex47.rb
find . -name "*NAME*" -print