Class: ConsoleView

Inherits:
Object
  • Object
show all
Defined in:
lib/flote/console_view.rb

Instance Method Summary collapse

Instance Method Details

#current_command_pathObject



44
45
46
# File 'lib/flote/console_view.rb', line 44

def current_command_path
	$0.gsub '/', '%/%'
end

#show(text) ⇒ Object



40
41
42
# File 'lib/flote/console_view.rb', line 40

def show text
	puts text
end

#show_helpObject



3
4
5
6
7
8
9
# File 'lib/flote/console_view.rb', line 3

def show_help
	show <<-helptext
flote (Flow Tester), is a continuous testing tool.

helptext
	show_usage
end

#show_missing_command_argument_error(command, missing_argument) ⇒ Object



30
31
32
33
# File 'lib/flote/console_view.rb', line 30

def show_missing_command_argument_error command, missing_argument
	show "Command <#{command}> recognized but argument <#{missing_argument}> was missing.\n"
	show_detailed_help command
end

#show_run_once_message(modified_file, modification_time) ⇒ Object



24
25
26
27
28
# File 'lib/flote/console_view.rb', line 24

def show_run_once_message modified_file, modification_time
	time = modification_time.strftime("%X")
	date = modification_time.strftime("%x")
	show "\nFile #{modified_file} was modified at #{time} on #{date}. Run tests."
end

#show_start(command) ⇒ Object



20
21
22
# File 'lib/flote/console_view.rb', line 20

def show_start command
  show "Starting flow testing with flote with command #{command}. Use Ctrl+C to stop flote."		
end

#show_unknwon_command_message(command) ⇒ Object



35
36
37
38
# File 'lib/flote/console_view.rb', line 35

def show_unknwon_command_message command
	show "Command #{command} not known.\n\n"
	show_usage
end

#show_usageObject



11
12
13
14
15
16
17
18
# File 'lib/flote/console_view.rb', line 11

def show_usage
	show <<-helptext
Usage: #{current_command_path} command [options] 
start <shell_command>    Watches all the files in the work dir (including subdirs) and runs the given shell command when a file was modified.

Report bugs to <[email protected]>
helptext
end