- https://dev.to/lofiandcode/ruby-puts-vs-print-vs-p-vs-pp-vs-awesome-5akl
- https://www.rubyguides.com/2018/10/puts-vs-print
ruby ex13.rb 12 17 29
ruby ex16.rb test.txt
- https://thoughtbot.com/blog/io-in-ruby#the-io-class
- https://thoughtbot.com/blog/io-in-ruby#file
- https://rubyapi.org/3.1/o/file#method-c-truncate
- https://rubyapi.org/3.1/o/io#method-i-seek
- https://stackoverflow.com/questions/27977368/seek-to-0-or-use-rewind-method
echo "This is a test file." > test.txt
ruby ex17.rb test.txt new_file.txt
- https://rubyapi.org/3.1/o/file#method-c-exist-3F
- https://stackoverflow.com/questions/8590098/how-to-check-for-file-existence
- https://www.justinweiss.com/articles/fun-with-keyword-arguments
- https://github.com/JuanitoFatas/what-do-you-call-this-in-ruby
ruby ex20.rb test.txt
ri File#seek
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)
- https://learnrubythehardway.org/book/ex37.html + https://docs.ruby-lang.org/en/2.2.0/keywords_rdoc.html + https://rubyreferences.github.io/rubyref/language/globals.html + https://rubyreferences.github.io/rubyref/language/keywords.html
- https://rubyapi.org/3.0/o/uri#method-c-open
- https://www.rubydoc.info/stdlib/open-uri/OpenURI
- https://github.com/ruby/open-uri
- https://janko.io/improving-open-uri
- https://github.com/yegor256/iri
- https://medium.com/@rainerborene/7-ways-to-encode-urls-in-ruby-c15078a7d6bc
rake test
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