Class: Eceval::CLI::Command

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/eceval/cli.rb

Instance Method Summary collapse

Instance Method Details

#call(path:, require:, load_path:) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/eceval/cli.rb', line 30

def call(path:, require:, load_path:, **)
  $LOAD_PATH.unshift(*load_path)
  require.each { |lib| require lib }

  if path == '-'
    Eceval.augment($stdin, filename: "[STDIN]")
  else
    File.open(path) do |file|
      Eceval.augment(file, filename: path)
    end
  end
end