Class: Wtch::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/wtch/cli.rb

Constant Summary

Constants inherited from Thor

Thor::HELP_MAPPINGS, Thor::THOR_RESERVED_WORDS, Thor::VERSION

Instance Attribute Summary

Attributes included from Thor::Actions

#behavior

Attributes included from Thor::Base

#options

Instance Method Summary collapse

Methods included from Thor::Actions

#action, #append_file, #apply, #chmod, #copy_file, #create_file, #destination_root, #destination_root=, #directory, #empty_directory, #find_in_source_paths, #get, #gsub_file, #in_root, included, #inject_into_class, #inject_into_file, #inside, #prepend_file, #relative_to_original_destination_root, #remove_file, #run, #run_ruby_script, #source_paths, #template, #thor

Methods inherited from Thor

check_unknown_options!, check_unknown_options?, default_task, desc, #help, help, long_desc, map, method_option, method_options, printable_tasks, subcommand, subcommands, task_help

Methods included from Thor::Base

included, register_klass_file, shell, shell=, subclass_files, subclasses

Constructor Details

#initializeCLI

Returns a new instance of CLI.



10
11
12
13
14
15
16
# File 'lib/wtch/cli.rb', line 10

def initialize(*)
  super
  use_shell = options["no-color"] ? Thor::Shell::Basic.new : shell

  Wtch.ui = UI::Shell.new(use_shell)
  Gem::DefaultUserInteraction.ui = UI::RGProxy.new(Wtch.ui)
end

Instance Method Details

#watch(url) ⇒ Object



27
28
29
30
# File 'lib/wtch/cli.rb', line 27

def watch(url)
  Wtch.ui.info "Checking out #{url}"
  Wtch.watch(url)
end