Class: Jank::GocodeCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/gocode_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(args, config, janker, executor) ⇒ GocodeCommand

Returns a new instance of GocodeCommand.



5
6
7
8
9
10
11
12
13
# File 'lib/gocode_command.rb', line 5

def initialize(args, config, janker, executor)
  super(args, config, janker, executor)

  @gocode = ENV['JANK_GOCODE'] || `which gocode`.chomp
  if @gocode.empty?
    puts "gocode is not installed. See https://github.com/nsf/gocode"
    exit(1)
  end
end

Instance Method Details

#dispatchObject



15
16
17
18
# File 'lib/gocode_command.rb', line 15

def dispatch
  @janker.link
  @exec.execute(@gocode, @args)
end