Module: Splot

Defined in:
lib/splot.rb,
lib/splot/runner.rb,
lib/splot/command.rb,
lib/splot/version.rb,
lib/splot/corresponding_file.rb

Defined Under Namespace

Classes: Command, CorrespondingFile, CucumberCommand, RSpecCommand, Runner, TestUnitCommand

Constant Summary collapse

RunnerNotFoundError =
Class.new StandardError
VERSION =
"0.5.3"

Class Method Summary collapse

Class Method Details

.build_command_from_argvObject



22
23
24
25
26
27
# File 'lib/splot.rb', line 22

def self.build_command_from_argv
  Runner.new.tap(&:parse).command
rescue RunnerNotFoundError => e
  warn "Warning: #{e}; will not run any test"
  exit 2
end

.command(params = {}) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/splot.rb', line 13

def self.command(params = {})
  new_file = CorrespondingFile.fetch params[:file]
  unless new_file == params[:file]
    params[:file] = new_file
    params.delete(:line)
  end
  Command.for(params[:file]).new(params).command
end