flowerbox/bin/flowerbox

38 lines
916 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'flowerbox'
require 'thor'
class Flowerbox::CLI < Thor
desc "test DIR", "Run the specs found in spec dir, loading spec_helper.rb for configuration details"
method_options :pwd => :string, :runners => :string, :runner => :string, :verbose_server => false
def test(dir = "spec/javascripts")
Dir.chdir(pwd) do
exit Flowerbox.run(dir, options.dup)
end
end
desc "debug DIR", "Start the Flowerbox server to help debug loading issues."
method_options :pwd => :string, :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