flowerbox/bin/flowerbox
2012-03-14 19:53:04 -04:00

38 lines
998 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'flowerbox'
require 'thor'
class Flowerbox::CLI < Thor
desc "test DIR FILES...", "Run the specs found in spec dir, loading spec_helper.rb for configuration details"
method_options :pwd => :string, :env_options => nil, :runners => :string, :runner => :string, :verbose_server => false
def test(dir = "spec/javascripts", *files)
Dir.chdir(pwd) do
exit Flowerbox.run(dir, options.dup.merge(:files => files))
end
end
desc "debug DIR", "Start the Flowerbox server to help debug loading issues."
method_options :pwd => :string, :env_options => nil, :runners => :string, :runner => :string, :verbose_server => false
def debug(dir = "spec/javascripts")
Dir.chdir(pwd) do
Flowerbox.debug(dir, options.dup)
end
end
default_task :test
no_tasks do
def pwd
options[:pwd] || Dir.pwd
end
def asset_paths
Flowerbox.asset_paths.collect { |path| File.join(pwd, path) }
end
end
end
Flowerbox::CLI.start