Week 6 Homework
Quiz
The quiz will posted in Canvas
Code
- extend your test_gem
- define your own exception class to handle a missing config file
- when the gem's binary is run
- if the parameter '--init' is passed:
- call TestGem::init_config
- write a default config file to current directory
- config file should be YAML
- the config file values should be
- default_file_name = 'default_file.txt'
- supported_types = ['txt', 'pdf']
- if no parameter is passed:
- call TestGem::configure and pass a hash of configuration values
- read in the config file from current directory
- raise the exception you defined if config file is missing
- values from file should be used to set @default_file_name and @supported_types
- if the parameter '--init' is passed:
- rebuild the gem after updating the version
- push it to RubyGems.org
Instructions
# update the course repository
cd ruby_core/RubyCoreLanguage2013
git pull origin master
# create a local repository that is a copy of final_project/test_gem
# complete the homework
# create a github repository for week6 and push your code
# submit the assignment by providing the url to the github repository
Reading
Required
- The Ruby Programming Language
- 5.6 Exceptions and Exception Handling