Class: IRuby::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/iruby/command.rb

Constant Summary collapse

IRUBYDIR =
'~/.config/iruby'

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Command

Returns a new instance of Command.



7
8
9
# File 'lib/iruby/command.rb', line 7

def initialize(args)
  @args = args
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
# File 'lib/iruby/command.rb', line 11

def run
  raise 'Use --iruby-dir instead of --ipython-dir!' unless @args.grep(/\A--ipython-dir=.*\Z/).empty?

  if @args.first == 'kernel'
    run_kernel
  else
    run_ipython
  end
end