konacha
konacha copied to clipboard
Improve command line interface
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
I'd be happy to see a pull request for this.
+1