Module: Expansions::CLIInterface
Instance Method Summary collapse
- #ensure_expansion_file_provided(file) ⇒ Object
- #get_expansion_file_name(args) ⇒ Object
- #run(*args) ⇒ Object
Instance Method Details
#ensure_expansion_file_provided(file) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/expansions/cli_interface.rb', line 9 def ensure_expansion_file_provided(file) unless File.exist?(file) print "dwp_expand aborted!\nNo Expansionfile found (looking for: ExpansionFile)\n prompt\n exit\n end\nend\n" |
#get_expansion_file_name(args) ⇒ Object
5 6 7 |
# File 'lib/expansions/cli_interface.rb', line 5 def get_expansion_file_name(args) return args.count > 0 ? args[0] : "ExpansionFile" end |
#run(*args) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/expansions/cli_interface.rb', line 19 def run(*args) file_to_run = get_expansion_file_name(args) ensure_expansion_file_provided file_to_run Startup.run load file_to_run Expansion.instance.run end |