Reading External Configuration from Files
External configuration allows a user to control the behavior of an app without using command-line options and arguments, in a more transparent and persistent way. The intent is to give users the ease of use provided by the default behavior but customized for their needs.
As an example, suppose Bob, our sysadmin, is using db_backup.rb to test the effect of changing the settings of a MySQL server. Bob wants to see how these settings affect the speed with which db_backup.rb can complete a backup. Bob is not particularly interested in the backup file that results, only the speed with which it’s produced. To do this, Bob will need to run db_backup.rb like so:
| | $ db_backup.rb --username=bob.sysadmin ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access