konacha icon indicating copy to clipboard operation
konacha copied to clipboard

Improve command line interface

Open ebeigarts opened this issue 11 years ago • 2 comments

I think it would be easier to just write konacha instead of rake konacha.

rake konacha:serve
rake konacha:run
rake konacha:run SPEC=foo_spec,bar_spec

=>

konacha serve
konacha
konacha spec/javascripts/foo_spec.coffee spec/javascripts/bar_spec.coffee

This would be similiar to how rspec command works and would also provide easier tab completion for specifying files on command line.

I could create a pull request for this. What do you think?

I have already created a working example:

#!/usr/bin/env ruby

require_relative '../config/environment'

if ARGV == ["serve"]
  Konacha.serve
else
  if ARGV.size > 0
    base_path = File.expand_path(Konacha.config.spec_dir, Rails.root)
    spec_paths = ARGV.map do |path|
      path = File.expand_path(path, Rails.root)
      path[base_path.size+1..-1]
    end
    ENV["SPEC"] = spec_paths.join(",")
  end

  passed = Konacha.run
  exit 1 unless passed
end

ebeigarts avatar Sep 06 '13 09:09 ebeigarts

I'd be happy to see a pull request for this.

jfirebaugh avatar Dec 22 '13 02:12 jfirebaugh

+1

matthijsgroen avatar Apr 23 '14 07:04 matthijsgroen