Class: Specjour::CLI
- Inherits:
-
Thor
- Object
- Thor
- Specjour::CLI
- Defined in:
- lib/specjour/cli.rb
Class Method Summary (collapse)
- + (Object) dispatcher_option
- + (Object) rsync_port_option
-
+ (Object) start(original_args = ARGV, config = {})
allow specjour to be called with path arguments.
- + (Object) worker_option
Instance Method Summary (collapse)
- - (Object) dispatch(*paths)
- - (Object) listen
- - (Object) load
- - (Object) prepare(path = Dir.pwd)
- - (Object) version
Class Method Details
+ (Object) dispatcher_option
9 10 11 |
# File 'lib/specjour/cli.rb', line 9 def self.dispatcher_option method_option :alias, :aliases => "-a", :desc => "Project name advertised to listeners" end |
+ (Object) rsync_port_option
13 14 15 |
# File 'lib/specjour/cli.rb', line 13 def self.rsync_port_option method_option :rsync_port, :type => :numeric, :default => 23456, :desc => "Port to use for rsync daemon" end |
+ (Object) start(original_args = ARGV, config = {})
allow specjour to be called with path arguments
18 19 20 21 22 23 24 25 |
# File 'lib/specjour/cli.rb', line 18 def self.start(original_args=ARGV, config={}) Specjour.trap_interrupt real_tasks = all_tasks.keys | @map.keys unless real_tasks.include? original_args.first original_args.unshift default_task end super(original_args) end |
+ (Object) worker_option
5 6 7 |
# File 'lib/specjour/cli.rb', line 5 def self.worker_option method_option :workers, :aliases => "-w", :type => :numeric, :desc => "Number of concurent processes to run. Defaults to your system's available cores." end |
Instance Method Details
- (Object) dispatch(*paths)
73 74 75 76 77 78 79 |
# File 'lib/specjour/cli.rb', line 73 def dispatch(*paths) handle_logging handle_workers handle_dispatcher(paths) append_to_program_name "dispatch" Specjour::Dispatcher.new(args).start end |
- (Object) listen
38 39 40 41 42 43 44 |
# File 'lib/specjour/cli.rb', line 38 def listen handle_logging handle_workers args[:registered_projects] = args.delete(:projects) || [File.basename(Dir.pwd)] append_to_program_name "listen" Specjour::Manager.new(args).start end |
- (Object) load
53 54 55 56 57 58 |
# File 'lib/specjour/cli.rb', line 53 def load handle_logging handle_workers append_to_program_name "load" Specjour::Loader.new(args).start end |
- (Object) prepare(path = Dir.pwd)
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/specjour/cli.rb', line 89 def prepare(path = Dir.pwd) handle_logging handle_workers args[:project_path] = File.(path) args[:project_alias] = args.delete(:alias) args[:test_paths] = [] args[:worker_task] = 'prepare' append_to_program_name "prepare" Specjour::Dispatcher.new(args).start end |
- (Object) version
102 103 104 |
# File 'lib/specjour/cli.rb', line 102 def version puts Specjour::VERSION end |