/
controller.rb
67 lines (49 loc) · 1.01 KB
/
controller.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module Speckle
module CLI
require 'speckle/version'
class Controller
def initialize(options, rake_app)
@options = options
@rake_app = rake_app
end
def rake(task)
@rake_app.invoke_task(task)
end
def show_version
puts VERSION
end
def show_help
puts @options.opts
end
def show_error(msg = @options.error)
puts "Error: #{msg}"
puts
show_help
end
def show_invalid_option
show_error @options.error
end
def show_missing_args
show_error @options.error
end
def show_parser_error
show_error @options.error
end
def show_no_spec_dir
show_error '"spec" directory not found'
end
def compile
rake :compile_tests
end
def compile_and_test
rake :compile_and_test
end
def test
rake :test
end
def watch
puts '--- TODO ---'
end
end
end
end