Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve command line interface #149

Open
ebeigarts opened this issue Sep 6, 2013 · 2 comments
Open

Improve command line interface #149

ebeigarts opened this issue Sep 6, 2013 · 2 comments

Comments

@ebeigarts
Copy link

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
@jfirebaugh
Copy link
Owner

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

@matthijsgroen
Copy link
Collaborator

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants