Class: Jank::GofmtCommand
Instance Method Summary collapse
- #dispatch ⇒ Object
-
#initialize(args, config, janker, executor) ⇒ GofmtCommand
constructor
A new instance of GofmtCommand.
Constructor Details
#initialize(args, config, janker, executor) ⇒ GofmtCommand
Returns a new instance of GofmtCommand.
5 6 7 8 9 10 11 12 13 |
# File 'lib/gofmt_command.rb', line 5 def initialize(args, config, janker, executor) super(args, config, janker, executor) @gofmt = ENV['JANK_GOFMT'] || `which gofmt`.chomp if @gofmt.empty? STDERR.puts "gofmt is not installed. See: https://golang.org/cmd/gofmt/" exit(1) end end |
Instance Method Details
#dispatch ⇒ Object
15 16 17 18 19 |
# File 'lib/gofmt_command.rb', line 15 def dispatch @janker.link @exec.execute(@gofmt, @args) @janker.sync_results end |