codersdojo 1.1.15 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/argument_parser.rb +1 -1
- data/app/codersdojo.rb +4 -2
- data/app/console_view.rb +14 -0
- data/app/controller.rb +2 -1
- data/app/property_file_missing_exception.rb +9 -0
- data/app/shell_argument_exception.rb +6 -0
- data/app/shell_wrapper.rb +12 -1
- data/templates/clojure.is-test/.meta +2 -0
- data/templates/csharp.nunit/.meta +1 -0
- data/templates/forth.tester/.meta +1 -0
- data/templates/java.junit/.meta +2 -0
- data/templates/javascript.jspec/.meta +1 -0
- data/templates/javascript.vows/.meta +2 -0
- data/templates/python.pytest/.meta +2 -0
- data/templates/python.pyunit/.meta +2 -0
- data/templates/ruby.test-unit/.meta +2 -0
- metadata +5 -4
data/app/argument_parser.rb
CHANGED
data/app/codersdojo.rb
CHANGED
@@ -22,8 +22,10 @@ class CodersDojo
|
|
22
22
|
begin
|
23
23
|
arg_parser = ArgumentParser.new controller
|
24
24
|
command = arg_parser.parse @params
|
25
|
-
rescue ShellArgumentException
|
26
|
-
|
25
|
+
rescue ShellArgumentException => e
|
26
|
+
view.show_unknwon_command_message e.command
|
27
|
+
rescue PropertyFileMissingException => e
|
28
|
+
view.show_properties_file_missing_error e.filename
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
data/app/console_view.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'shell_wrapper'
|
2
2
|
require 'text_template_machine'
|
3
|
+
require 'property_file_missing_exception'
|
3
4
|
|
4
5
|
class ConsoleView
|
5
6
|
|
@@ -113,6 +114,11 @@ Command #{command} not known. Try '#{current_command_path} help' to list the sup
|
|
113
114
|
helptext
|
114
115
|
end
|
115
116
|
|
117
|
+
def show_unknwon_command_message command
|
118
|
+
show "Command #{command} not known.\n\n"
|
119
|
+
show_usage
|
120
|
+
end
|
121
|
+
|
116
122
|
def show_start_kata command, file, framework
|
117
123
|
show "Starting CodersDojo-Client with command #{command} and kata file #{file} with framework #{framework}. Use Ctrl+C to finish the kata."
|
118
124
|
end
|
@@ -149,6 +155,14 @@ You finished your kata. Choose your next action:
|
|
149
155
|
r) Resume the kata.
|
150
156
|
msg
|
151
157
|
end
|
158
|
+
|
159
|
+
def show_properties_file_missing_error filename
|
160
|
+
show <<-msg
|
161
|
+
Property file #{filename} is missing.
|
162
|
+
Maybe you created the directory structure with an older version of CodersDojo?
|
163
|
+
Recreate the directory structure with the current version with 'codersdojo setup ...'.
|
164
|
+
msg
|
165
|
+
end
|
152
166
|
|
153
167
|
def show_kata_upload_hint
|
154
168
|
show "You finished your kata. Now upload it with 'codersdojo upload'."
|
data/app/controller.rb
CHANGED
@@ -5,6 +5,7 @@ require 'filename_formatter'
|
|
5
5
|
class Controller
|
6
6
|
|
7
7
|
def initialize shell, view, scaffolder, hostname
|
8
|
+
@property_filename = '.meta'
|
8
9
|
@shell = shell
|
9
10
|
@view = view
|
10
11
|
@scaffolder = scaffolder
|
@@ -74,7 +75,7 @@ class Controller
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def properties
|
77
|
-
|
78
|
+
@shell.read_properties @property_filename
|
78
79
|
end
|
79
80
|
|
80
81
|
end
|
data/app/shell_wrapper.rb
CHANGED
@@ -66,6 +66,13 @@ class ShellWrapper
|
|
66
66
|
Dir.new(dir).entries - ["..", "."]
|
67
67
|
end
|
68
68
|
|
69
|
+
def files_in_dir dir
|
70
|
+
Dir.new(dir).entries.find_all{|entry|
|
71
|
+
File.file? entry
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
|
69
76
|
def newest_dir_entry dir
|
70
77
|
Dir.new(dir).sort_by do |entry|
|
71
78
|
complete_path = File.join dir, entry
|
@@ -82,7 +89,11 @@ class ShellWrapper
|
|
82
89
|
end
|
83
90
|
|
84
91
|
def read_properties filename
|
85
|
-
|
92
|
+
begin
|
93
|
+
YAML.load_file filename
|
94
|
+
rescue
|
95
|
+
raise PropertyFileMissingException.new filename
|
96
|
+
end
|
86
97
|
end
|
87
98
|
|
88
99
|
def remove_command_name
|
data/templates/java.junit/.meta
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codersdojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 16
|
10
|
+
version: 1.1.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- CodersDojo-Team
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-11 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- app/controller.rb
|
66
66
|
- app/filename_formatter.rb
|
67
67
|
- app/progress.rb
|
68
|
+
- app/property_file_missing_exception.rb
|
68
69
|
- app/runner.rb
|
69
70
|
- app/scaffolder.rb
|
70
71
|
- app/scheduler.rb
|