Class: Dosh::Require
Instance Method Summary collapse
-
#initialize(filename, args) ⇒ Require
constructor
A new instance of Require.
- #run ⇒ Object
Methods inherited from Script
#candidate_files, #resolve_file, #script
Constructor Details
#initialize(filename, args) ⇒ Require
Returns a new instance of Require.
96 97 98 99 |
# File 'lib/script.rb', line 96 def initialize(filename, args) @filename = filename @args = args end |
Instance Method Details
#run ⇒ Object
101 102 103 104 105 106 |
# File 'lib/script.rb', line 101 def run raise "File '#{command}' not found" if @filename.nil? ARGV.clear @args.each { |a| ARGV << a } require(@filename) end |