loris 0.0.16 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,6 +21,7 @@ begin
21
21
 
22
22
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
23
23
  end
24
+ Jeweler::GemcutterTasks.new
24
25
  rescue LoadError
25
26
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
26
27
  end
data/TODO CHANGED
@@ -1,12 +1,12 @@
1
+ * Keep track of number of tests run/files linted. Let user know if this drops
2
+
1
3
  * Desktop (AIR?) app with red/green indicator, and clickable filename links
2
4
  * Aptana/VS plugin with red/green indicator and clickable filename links?
3
5
 
4
- * Remove JsTestDriver.jar from lib dir?
5
6
  * Tidy Windows related if statements
6
7
  * Tidy JSL filename removing
7
8
 
8
9
 
9
- * javascript lint not installed? (package if not already installed?)
10
10
  * JSpec not installed? (can require as gem)
11
11
 
12
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.16
1
+ 0.1.0
Binary file
@@ -98,7 +98,7 @@ module Loris
98
98
 
99
99
  tm = TaskManager.new(oc)
100
100
  tm.add(ListTask.new) if debug
101
- tm.add(CommandLineTask.new(JavascriptLintRunner.new(dir, ExtensionFilter.new(File, 'js')), JavascriptLintParser.new(dir)))
101
+ tm.add(javascript_lint_task(dir))
102
102
  tm.add(CommandLineTask.new(JSpecRunner.new(dir, ExtensionFilter.new(File, 'js')), JSpecParser.new)) unless is_windows
103
103
  tm.add(jsTestDriverTask(dir))
104
104
  tm.add(CommandLineTask.new(RSpecRunner.new(dir, ExtensionFilter.new(File, 'rb'), EndsWithFilter.new('_spec.rb')), RSpecParser.new))
@@ -114,6 +114,21 @@ module Loris
114
114
 
115
115
  end
116
116
 
117
+ # Refactor into factory
118
+ def javascript_lint_task(dir)
119
+ is_windows = RUBY_PLATFORM =~ /mswin32/
120
+ binary = File.join(LIBDIR, 'javascript-lint' , is_windows ? 'jsl.exe' : 'jsl');
121
+
122
+ return CommandLineTask.new(
123
+ JavascriptLintRunner.new(
124
+ binary,
125
+ dir,
126
+ ExtensionFilter.new(File, 'js')
127
+ ),
128
+ JavascriptLintParser.new(dir)
129
+ )
130
+ end
131
+
117
132
  # Will need to be refactored into a factory
118
133
  def jsTestDriverTask(dir)
119
134
  require 'tasks/js_test_driver/js_test_driver_runner'
@@ -121,7 +136,7 @@ module Loris
121
136
  require 'tasks/js_test_driver/js_test_driver_config'
122
137
  require 'tasks/js_test_driver/js_test_driver_server'
123
138
 
124
- jar = File.join(LIBDIR, 'js-test-driver/JsTestDriver-1.1.jar')
139
+ jar = File.join(LIBDIR, 'js-test-driver/JsTestDriver-1.2.jar')
125
140
  is_windows = RUBY_PLATFORM =~ /mswin32/
126
141
 
127
142
  if is_windows
@@ -1,6 +1,7 @@
1
1
  class JavascriptLintRunner
2
2
 
3
- def initialize(dir, filter)
3
+ def initialize(binary, dir, filter)
4
+ @binary = binary
4
5
  @config = dir + '/jsl.conf'
5
6
  @dir = dir
6
7
  @filter = filter
@@ -11,7 +12,7 @@ class JavascriptLintRunner
11
12
  end
12
13
 
13
14
  def execute
14
- return `jsl -conf "#{@config}" -nologo -nofilelisting 2>&1`
15
+ return `#{@binary} -conf "#{@config}" -nologo -nofilelisting 2>&1`
15
16
  end
16
17
 
17
18
  def is_configured?(all_files)
@@ -9,8 +9,7 @@ class JsTestDriverParser
9
9
  return :error, 'Error', error_info
10
10
  end
11
11
 
12
- lost_a_browser = !detail.grep(/The browser \d+ is not available anymore/)[0].nil?
13
- if summary_line =~ /Total 0 tests/ && lost_a_browser
12
+ if summary_line =~ /Total 0 tests/
14
13
  return :error, 'No Tests Run', 'You may not have a browser connected to JS Test Driver'
15
14
  end
16
15
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{loris}
8
- s.version = "0.0.16"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Karl O'Keeffe"]
12
- s.date = %q{2009-10-29}
12
+ s.date = %q{2009-11-06}
13
13
  s.default_executable = %q{loris}
14
14
  s.description = %q{Automatically run javascript unit tests}
15
15
  s.email = %q{loris@monket.net}
@@ -44,8 +44,10 @@ Gem::Specification.new do |s|
44
44
  "lib/icons/info.png",
45
45
  "lib/icons/success.png",
46
46
  "lib/icons/warning.png",
47
- "lib/js-test-driver/JsTestDriver-1.1.jar",
48
- "lib/js-test-driver/plugins/coverage-1.1.jar",
47
+ "lib/javascript-lint/jsl",
48
+ "lib/javascript-lint/jsl.exe",
49
+ "lib/js-test-driver/JsTestDriver-1.2.jar",
50
+ "lib/js-test-driver/plugins/coverage-1.2.jar",
49
51
  "lib/loris.rb",
50
52
  "lib/outputs/growl_output.rb",
51
53
  "lib/outputs/output_collection.rb",
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>currentDocument</key>
6
- <string>Rakefile</string>
6
+ <string>lib/tasks/js_test_driver/js_test_driver_parser.rb</string>
7
7
  <key>documents</key>
8
8
  <array>
9
9
  <dict>
@@ -13,8 +13,6 @@
13
13
  <string>loris</string>
14
14
  <key>regexFolderFilter</key>
15
15
  <string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
16
- <key>selected</key>
17
- <true/>
18
16
  <key>sourceDirectory</key>
19
17
  <string></string>
20
18
  </dict>
@@ -23,42 +21,56 @@
23
21
  <integer>200</integer>
24
22
  <key>metaData</key>
25
23
  <dict>
26
- <key>README.rdoc</key>
24
+ <key>Rakefile</key>
27
25
  <dict>
28
26
  <key>caret</key>
29
27
  <dict>
30
28
  <key>column</key>
31
- <integer>71</integer>
29
+ <integer>47</integer>
32
30
  <key>line</key>
33
- <integer>2</integer>
31
+ <integer>17</integer>
34
32
  </dict>
35
33
  <key>firstVisibleColumn</key>
36
34
  <integer>0</integer>
37
35
  <key>firstVisibleLine</key>
38
36
  <integer>0</integer>
39
37
  </dict>
40
- <key>Rakefile</key>
38
+ <key>TODO</key>
41
39
  <dict>
42
40
  <key>caret</key>
43
41
  <dict>
44
42
  <key>column</key>
45
- <integer>5</integer>
43
+ <integer>0</integer>
46
44
  <key>line</key>
47
- <integer>3</integer>
45
+ <integer>0</integer>
48
46
  </dict>
49
47
  <key>firstVisibleColumn</key>
50
48
  <integer>0</integer>
51
49
  <key>firstVisibleLine</key>
52
50
  <integer>0</integer>
53
51
  </dict>
54
- <key>TODO</key>
52
+ <key>lib/file_actioner.rb</key>
55
53
  <dict>
56
54
  <key>caret</key>
57
55
  <dict>
58
56
  <key>column</key>
59
- <integer>0</integer>
57
+ <integer>44</integer>
60
58
  <key>line</key>
61
- <integer>14</integer>
59
+ <integer>12</integer>
60
+ </dict>
61
+ <key>firstVisibleColumn</key>
62
+ <integer>0</integer>
63
+ <key>firstVisibleLine</key>
64
+ <integer>0</integer>
65
+ </dict>
66
+ <key>lib/file_finder.rb</key>
67
+ <dict>
68
+ <key>caret</key>
69
+ <dict>
70
+ <key>column</key>
71
+ <integer>39</integer>
72
+ <key>line</key>
73
+ <integer>16</integer>
62
74
  </dict>
63
75
  <key>firstVisibleColumn</key>
64
76
  <integer>0</integer>
@@ -70,23 +82,23 @@
70
82
  <key>caret</key>
71
83
  <dict>
72
84
  <key>column</key>
73
- <integer>29</integer>
85
+ <integer>47</integer>
74
86
  <key>line</key>
75
- <integer>9</integer>
87
+ <integer>10</integer>
76
88
  </dict>
77
89
  <key>firstVisibleColumn</key>
78
90
  <integer>0</integer>
79
91
  <key>firstVisibleLine</key>
80
92
  <integer>0</integer>
81
93
  </dict>
82
- <key>lib/filters/extension_filter.rb</key>
94
+ <key>lib/loris.rb</key>
83
95
  <dict>
84
96
  <key>caret</key>
85
97
  <dict>
86
98
  <key>column</key>
87
- <integer>3</integer>
99
+ <integer>9</integer>
88
100
  <key>line</key>
89
- <integer>19</integer>
101
+ <integer>7</integer>
90
102
  </dict>
91
103
  <key>columnSelection</key>
92
104
  <false/>
@@ -97,77 +109,119 @@
97
109
  <key>selectFrom</key>
98
110
  <dict>
99
111
  <key>column</key>
100
- <integer>0</integer>
112
+ <integer>9</integer>
101
113
  <key>line</key>
102
- <integer>0</integer>
114
+ <integer>7</integer>
103
115
  </dict>
104
116
  <key>selectTo</key>
105
117
  <dict>
106
118
  <key>column</key>
107
- <integer>3</integer>
119
+ <integer>14</integer>
108
120
  <key>line</key>
109
- <integer>19</integer>
121
+ <integer>7</integer>
110
122
  </dict>
111
123
  </dict>
112
- <key>lib/filters/file_filter.rb</key>
124
+ <key>lib/poller.rb</key>
113
125
  <dict>
114
126
  <key>caret</key>
115
127
  <dict>
116
128
  <key>column</key>
117
129
  <integer>0</integer>
118
130
  <key>line</key>
119
- <integer>7</integer>
131
+ <integer>2</integer>
120
132
  </dict>
121
- <key>columnSelection</key>
122
- <false/>
123
133
  <key>firstVisibleColumn</key>
124
134
  <integer>0</integer>
125
135
  <key>firstVisibleLine</key>
126
136
  <integer>0</integer>
127
- <key>selectFrom</key>
137
+ </dict>
138
+ <key>lib/task_manager.rb</key>
139
+ <dict>
140
+ <key>caret</key>
128
141
  <dict>
129
142
  <key>column</key>
130
- <integer>33</integer>
143
+ <integer>0</integer>
131
144
  <key>line</key>
132
- <integer>7</integer>
145
+ <integer>23</integer>
133
146
  </dict>
134
- <key>selectTo</key>
147
+ <key>firstVisibleColumn</key>
148
+ <integer>0</integer>
149
+ <key>firstVisibleLine</key>
150
+ <integer>0</integer>
151
+ </dict>
152
+ <key>lib/tasks/command_line_task.rb</key>
153
+ <dict>
154
+ <key>caret</key>
135
155
  <dict>
136
156
  <key>column</key>
137
- <integer>0</integer>
157
+ <integer>28</integer>
138
158
  <key>line</key>
139
- <integer>7</integer>
159
+ <integer>14</integer>
140
160
  </dict>
161
+ <key>firstVisibleColumn</key>
162
+ <integer>0</integer>
163
+ <key>firstVisibleLine</key>
164
+ <integer>0</integer>
141
165
  </dict>
142
- <key>lib/filters/modified_filter.rb</key>
166
+ <key>lib/tasks/javascript_lint/javascript_lint_parser.rb</key>
143
167
  <dict>
144
168
  <key>caret</key>
145
169
  <dict>
146
170
  <key>column</key>
147
- <integer>0</integer>
171
+ <integer>24</integer>
148
172
  <key>line</key>
149
- <integer>4</integer>
173
+ <integer>32</integer>
150
174
  </dict>
151
175
  <key>firstVisibleColumn</key>
152
176
  <integer>0</integer>
153
177
  <key>firstVisibleLine</key>
154
178
  <integer>0</integer>
155
179
  </dict>
156
- <key>lib/loris.rb</key>
180
+ <key>lib/tasks/javascript_lint/javascript_lint_runner.rb</key>
181
+ <dict>
182
+ <key>caret</key>
183
+ <dict>
184
+ <key>column</key>
185
+ <integer>57</integer>
186
+ <key>line</key>
187
+ <integer>13</integer>
188
+ </dict>
189
+ <key>columnSelection</key>
190
+ <false/>
191
+ <key>firstVisibleColumn</key>
192
+ <integer>0</integer>
193
+ <key>firstVisibleLine</key>
194
+ <integer>0</integer>
195
+ <key>selectFrom</key>
196
+ <dict>
197
+ <key>column</key>
198
+ <integer>43</integer>
199
+ <key>line</key>
200
+ <integer>13</integer>
201
+ </dict>
202
+ <key>selectTo</key>
203
+ <dict>
204
+ <key>column</key>
205
+ <integer>57</integer>
206
+ <key>line</key>
207
+ <integer>13</integer>
208
+ </dict>
209
+ </dict>
210
+ <key>lib/tasks/js_test_driver/js_test_driver_parser.rb</key>
157
211
  <dict>
158
212
  <key>caret</key>
159
213
  <dict>
160
214
  <key>column</key>
161
- <integer>78</integer>
215
+ <integer>2</integer>
162
216
  <key>line</key>
163
- <integer>101</integer>
217
+ <integer>30</integer>
164
218
  </dict>
165
219
  <key>firstVisibleColumn</key>
166
220
  <integer>0</integer>
167
221
  <key>firstVisibleLine</key>
168
- <integer>73</integer>
222
+ <integer>0</integer>
169
223
  </dict>
170
- <key>lib/tasks/rspec/rspec_runner.rb</key>
224
+ <key>lib/tasks/list_task.rb</key>
171
225
  <dict>
172
226
  <key>caret</key>
173
227
  <dict>
@@ -181,19 +235,35 @@
181
235
  <key>firstVisibleLine</key>
182
236
  <integer>0</integer>
183
237
  </dict>
184
- <key>lib/tasks/rspec/rspec_task.rb</key>
238
+ <key>spec/file_actioner_spec.rb</key>
185
239
  <dict>
186
240
  <key>caret</key>
187
241
  <dict>
188
242
  <key>column</key>
189
- <integer>42</integer>
243
+ <integer>7</integer>
190
244
  <key>line</key>
191
- <integer>41</integer>
245
+ <integer>36</integer>
192
246
  </dict>
247
+ <key>columnSelection</key>
248
+ <false/>
193
249
  <key>firstVisibleColumn</key>
194
250
  <integer>0</integer>
195
251
  <key>firstVisibleLine</key>
196
252
  <integer>0</integer>
253
+ <key>selectFrom</key>
254
+ <dict>
255
+ <key>column</key>
256
+ <integer>0</integer>
257
+ <key>line</key>
258
+ <integer>4</integer>
259
+ </dict>
260
+ <key>selectTo</key>
261
+ <dict>
262
+ <key>column</key>
263
+ <integer>7</integer>
264
+ <key>line</key>
265
+ <integer>36</integer>
266
+ </dict>
197
267
  </dict>
198
268
  <key>spec/filters/ends_with_filter_spec.rb</key>
199
269
  <dict>
@@ -213,16 +283,19 @@
213
283
  <key>openDocuments</key>
214
284
  <array>
215
285
  <string>TODO</string>
216
- <string>README.rdoc</string>
217
- <string>lib/tasks/rspec/rspec_task.rb</string>
218
- <string>lib/tasks/rspec/rspec_runner.rb</string>
286
+ <string>lib/tasks/javascript_lint/javascript_lint_parser.rb</string>
287
+ <string>lib/tasks/js_test_driver/js_test_driver_parser.rb</string>
219
288
  <string>lib/filters/ends_with_filter.rb</string>
289
+ <string>lib/tasks/javascript_lint/javascript_lint_runner.rb</string>
220
290
  <string>Rakefile</string>
221
- <string>spec/filters/ends_with_filter_spec.rb</string>
291
+ <string>lib/task_manager.rb</string>
292
+ <string>lib/file_finder.rb</string>
293
+ <string>lib/file_actioner.rb</string>
294
+ <string>spec/file_actioner_spec.rb</string>
295
+ <string>lib/poller.rb</string>
222
296
  <string>lib/loris.rb</string>
223
- <string>lib/filters/modified_filter.rb</string>
224
- <string>lib/filters/file_filter.rb</string>
225
- <string>lib/filters/extension_filter.rb</string>
297
+ <string>lib/tasks/list_task.rb</string>
298
+ <string>lib/tasks/command_line_task.rb</string>
226
299
  </array>
227
300
  <key>showFileHierarchyDrawer</key>
228
301
  <false/>
@@ -10,10 +10,11 @@ describe JavascriptLintRunner do
10
10
 
11
11
  it "should return true if jsl.conf exists" do
12
12
 
13
+ binary = 'jsl'
13
14
  dir = '/a/dir/structure'
14
15
  all_files = ['/a/dir/structure/jsl.conf']
15
16
 
16
- runner = JavascriptLintRunner.new(dir, @filter)
17
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
17
18
 
18
19
  runner.is_configured?(all_files).should be_true
19
20
 
@@ -21,10 +22,11 @@ describe JavascriptLintRunner do
21
22
 
22
23
  it "should return false if jsl.conf does not exists" do
23
24
 
25
+ binary = 'jsl'
24
26
  dir = '/a/dir/structure'
25
27
  all_files = ['/a/dir/structure/other.conf']
26
28
 
27
- runner = JavascriptLintRunner.new(dir, @filter)
29
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
28
30
 
29
31
  runner.is_configured?(all_files).should be_false
30
32
 
@@ -36,11 +38,12 @@ describe JavascriptLintRunner do
36
38
 
37
39
  it "should return true if a file ends with a js extension" do
38
40
 
41
+ binary = 'jsl'
39
42
  dir = '/a/dir/structure'
40
43
  modified_files = ['/a/dir/structure/another_dir/example.js']
41
44
  @filter.should_receive(:filter).and_return(true)
42
45
 
43
- runner = JavascriptLintRunner.new(dir, @filter)
46
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
44
47
 
45
48
  runner.should_run?(modified_files).should be_true
46
49
 
@@ -48,12 +51,13 @@ describe JavascriptLintRunner do
48
51
 
49
52
  it "should return true if any file ends with a js extension" do
50
53
 
54
+ binary = 'jsl'
51
55
  dir = '/a/dir/structure'
52
56
  modified_files = ['/a/dir/structure/nonjs.file', '/a/dir/structure/another_dir/example.js']
53
57
  @filter.should_receive(:filter).ordered.and_return(false)
54
58
  @filter.should_receive(:filter).ordered.and_return(true)
55
59
 
56
- runner = JavascriptLintRunner.new(dir, @filter)
60
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
57
61
 
58
62
  runner.should_run?(modified_files).should be_true
59
63
 
@@ -61,11 +65,12 @@ describe JavascriptLintRunner do
61
65
 
62
66
  it "should return false if no file ends with a js extension" do
63
67
 
68
+ binary = 'jsl'
64
69
  dir = '/a/dir/structure'
65
70
  modified_files = ['/a/dir/structure/nonjs.file']
66
71
  @filter.should_receive(:filter).ordered.and_return(false)
67
72
 
68
- runner = JavascriptLintRunner.new(dir, @filter)
73
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
69
74
 
70
75
  runner.should_run?(modified_files).should be_false
71
76
 
@@ -73,11 +78,12 @@ describe JavascriptLintRunner do
73
78
 
74
79
  it "should return true if the jsl.conf file was modified" do
75
80
 
81
+ binary = 'jsl'
76
82
  dir = '/a/dir/structure'
77
83
  modified_files = ['/a/dir/structure/jsl.conf']
78
84
  @filter.should_receive(:filter).ordered.and_return(false)
79
85
 
80
- runner = JavascriptLintRunner.new(dir, @filter)
86
+ runner = JavascriptLintRunner.new(binary, dir, @filter)
81
87
 
82
88
  runner.should_run?(modified_files).should be_true
83
89
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl O'Keeffe
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-29 00:00:00 +00:00
12
+ date: 2009-11-06 00:00:00 +00:00
13
13
  default_executable: loris
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -87,8 +87,10 @@ files:
87
87
  - lib/icons/info.png
88
88
  - lib/icons/success.png
89
89
  - lib/icons/warning.png
90
- - lib/js-test-driver/JsTestDriver-1.1.jar
91
- - lib/js-test-driver/plugins/coverage-1.1.jar
90
+ - lib/javascript-lint/jsl
91
+ - lib/javascript-lint/jsl.exe
92
+ - lib/js-test-driver/JsTestDriver-1.2.jar
93
+ - lib/js-test-driver/plugins/coverage-1.2.jar
92
94
  - lib/loris.rb
93
95
  - lib/outputs/growl_output.rb
94
96
  - lib/outputs/output_collection.rb