loris 0.1.0 → 0.1.1

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.
@@ -1,12 +1,114 @@
1
- == Autotest for Javascript ==
1
+ == Loris
2
2
 
3
- Run your javascript unit tests any time a file in your project changes.
3
+ Loris will monitor your project and run Javascript Lint (http://www.javascriptlint.com/) and JS Test Driver (http://code.google.com/p/js-test-driver/) whenever a file changes, it will report the results to the command line and using Growl (http://growl.info/). If required, Loris will automatically start the JS Test Driver server and register your default browser with it.
4
4
 
5
- Runs Javascript Lint (if jsl.conf is found)
6
- Runs JSpec (if spec/spec.rhino.js is found)
7
- Runs JS Test Driver (if jsTestDriver.conf is found)
5
+ === Installing
8
6
 
9
- Also runs RSpec (if any file ending in _spec.rb is found in the spec directory)
7
+ Loris is hosted on Gemcutter (http://gemcutter.org/), so you need to install their gem if you haven't already.
10
8
 
11
- - Requires java (to run JS Test Driver)
12
- - Requires .NET Framework 2.0+ (for Growl for Windows)
9
+ sudo gem update --system
10
+ sudo gem install gemcutter
11
+ gem tumble
12
+
13
+ Then to install Loris, just run the following:
14
+
15
+ sudo gem install loris
16
+
17
+ On Windows you will also need to install the win32-process gem
18
+
19
+ gem install win32-process
20
+
21
+ Loris has no command line options, and no configuration file (at the moment). It looks for configurations files to decide which tasks to run.
22
+
23
+ === Configuring Javascript Lint
24
+
25
+ To enable Javascript Lint, create a `jsl.conf` file in the folder where you run Loris. This should be a standard Javascript Lint config file. If you need here is an example Javascript Lint config file (http://mike.kruckenberg.com/archives/2009/03/configuration-options-for-javascript-lint.html)
26
+
27
+ You just need to specify which files Javascipt Lint should process. For example:
28
+
29
+ ### Files
30
+ # Specify which files to lint
31
+ # Use "+recurse" to enable recursion (disabled by default).
32
+ # To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
33
+ # or "+process Folder\Path\*.htm".
34
+ #
35
+ +process src/js/*.js
36
+ +process tests/js/*.js
37
+
38
+ If no `jsl.conf` file is found, the Javascript Lint task is silently skipped.
39
+
40
+
41
+ === Configuring JS Test Driver
42
+
43
+ To enable JS Test Driver, create a `jsTestDriver.conf` file in the folder where you run Loris. This should be a standard JS Test Driver config file (http://code.google.com/p/js-test-driver/wiki/ConfigurationFile).
44
+
45
+ This should specify which files JS Test Driver should process, and how it connects to the JS Test Driver server. For example:
46
+
47
+ server: http://localhost:9876
48
+
49
+ load:
50
+ - tests/qunit/equiv.js
51
+ - tests/qunit/QUnitAdapter.js
52
+
53
+ - src/js/*.js
54
+ - tests/js/*.js
55
+
56
+ If no `jsTestDriver.conf` file is found, the JS Test Driver task is silently skipped.
57
+
58
+ To make it really simple to run JS Test Driver tests, if the server is set to run on `localhost`, and Loris doesn't detect one running, it will automatically start one, and register your default browser with it.
59
+
60
+ This makes it a one step process to get automated tests up and running.
61
+
62
+ === Running
63
+
64
+ To run, open a command line window, navigate to the root folder of your project, and run:
65
+
66
+ loris
67
+
68
+ Loris will run Javascript Lint, and JS Test Driver tasks (if it finds their configuration files), and will output the results on the command line.
69
+
70
+ #### Example output
71
+ Javascript Lint
72
+ success
73
+ All files are clean
74
+
75
+ 0 error(s), 0 warning(s)
76
+ JS Test Driver
77
+ success
78
+ All tests pass
79
+ [PASSED] GreeterTest.testGreet
80
+ [LOG] JsTestDriver Hello World!
81
+ [PASSED] GreeterTest.testGoodbye
82
+ [PASSED] GreeterTest.testSetName
83
+ [PASSED] GreeterTest.testSetNameAndNameParamter
84
+ [PASSED] Asserts.test OK true succeeds
85
+ [PASSED] Asserts.test Equals succeeds
86
+ [LOG] about to call assertEquals
87
+ [PASSED] Asserts.test Same assert succeeds
88
+ [PASSED] Lifecycle.test Setup and Teardown are run, and can contain assertions
89
+ Total 8 tests (Passed: 8; Fails: 0; Errors: 0) (3.00 ms)
90
+ Firefox 1.9.1.4 MacIntel: Run 8 tests (Passed: 8; Fails: 0; Errors 0) (3.00 ms)
91
+
92
+ Every time you make a change to a Javascript file, or a configuration file, Loris will automatically re-run Javascript Lint and JS Test Driver. So you can instant feedback on your changes.
93
+
94
+ Loris will clear the command line when re-running tasks. So the latest run is always at the top of you command line.
95
+
96
+ Loris will also report a summary of each task using Growl (http://growl.info/) (if it is installed). This allows you to get quick feedback without needing to refer back to the command line on every change.
97
+
98
+ === Requirements
99
+
100
+ JS Test Driver is written in Java, so you will need to have Java installed to run it.
101
+
102
+ To get Growl notifications, you will need to install either Growl for OSX (http://growl.info/) or Growl for Windows (http://www.growlforwindows.com/). Growl for Windows requires the .NET Framework 2.0+ (http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en).
103
+
104
+ === Caveat
105
+
106
+ Loris is pretty limited at the moment, I just wired up the basics to get it running for a work project.
107
+
108
+ It doesn't have any configuration options at the moment, so you have to follow it's assumptions for now. I'm happy to add configuration options for any element as required.
109
+
110
+ Loris only comes with a few tasks (Javascript Lint, JS Test Driver, JSpec, and RSpec), but I hope to allow it have new tasks added via new gems (kind of similar to Autotest).
111
+
112
+ It comes packaged with a version of Javascript Lint, and JS Test Driver, and will use it's own versions. It only includes the OSX and Windows versions of Javascript Lint.
113
+
114
+ If you want to modify the code, just fork the Loris github project (http://github.com/karl/loris)
data/Rakefile CHANGED
@@ -17,7 +17,6 @@ begin
17
17
  gem.add_dependency('visionmedia-bind', [">= 0.2.6"])
18
18
  gem.add_dependency('karl-growl', [">= 1.0.6"])
19
19
  gem.add_dependency('extensions', [">= 0.6.0"])
20
- gem.add_dependency('win32-process', [">= 0.6.1"])
21
20
 
22
21
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
23
22
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -14,7 +14,7 @@ class JsTestDriverRunner
14
14
 
15
15
  def execute
16
16
  @server.start_if_required
17
- return `java -jar "#{@jar}" --config "#{@config}" --tests all --verbose 2>&1`
17
+ return `java -jar "#{@jar}" --config "#{@config}" --reset˝˝ --tests all 2>&1`
18
18
  end
19
19
 
20
20
  def is_configured?(all_files)
@@ -1,4 +1,9 @@
1
- require 'win32/process'
1
+ begin
2
+ require 'win32/process'
3
+ rescue LoadError
4
+ warn "You must 'gem install win32-process to run Loris on Windows"
5
+ exit 1
6
+ end
2
7
 
3
8
  class WindowsProcess
4
9
 
@@ -1,21 +1,22 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{loris}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
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-11-06}
12
+ s.date = %q{2010-03-26}
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}
16
16
  s.executables = ["loris"]
17
17
  s.extra_rdoc_files = [
18
- "README.rdoc"
18
+ "README.rdoc",
19
+ "TODO"
19
20
  ]
20
21
  s.files = [
21
22
  ".gitignore",
@@ -92,7 +93,7 @@ Gem::Specification.new do |s|
92
93
  s.homepage = %q{http://github.com/karl/loris}
93
94
  s.rdoc_options = ["--charset=UTF-8"]
94
95
  s.require_paths = ["lib"]
95
- s.rubygems_version = %q{1.3.5}
96
+ s.rubygems_version = %q{1.3.6}
96
97
  s.summary = %q{Automatically run javascript unit tests}
97
98
  s.test_files = [
98
99
  "spec/file_actioner_spec.rb",
@@ -119,17 +120,15 @@ Gem::Specification.new do |s|
119
120
  s.add_runtime_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
120
121
  s.add_runtime_dependency(%q<karl-growl>, [">= 1.0.6"])
121
122
  s.add_runtime_dependency(%q<extensions>, [">= 0.6.0"])
122
- s.add_runtime_dependency(%q<win32-process>, [">= 0.6.1"])
123
123
  else
124
124
  s.add_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
125
125
  s.add_dependency(%q<karl-growl>, [">= 1.0.6"])
126
126
  s.add_dependency(%q<extensions>, [">= 0.6.0"])
127
- s.add_dependency(%q<win32-process>, [">= 0.6.1"])
128
127
  end
129
128
  else
130
129
  s.add_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
131
130
  s.add_dependency(%q<karl-growl>, [">= 1.0.6"])
132
131
  s.add_dependency(%q<extensions>, [">= 0.6.0"])
133
- s.add_dependency(%q<win32-process>, [">= 0.6.1"])
134
132
  end
135
133
  end
134
+
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>currentDocument</key>
6
- <string>lib/tasks/js_test_driver/js_test_driver_parser.rb</string>
6
+ <string>lib/file_actioner.rb</string>
7
7
  <key>documents</key>
8
8
  <array>
9
9
  <dict>
@@ -91,44 +91,28 @@
91
91
  <key>firstVisibleLine</key>
92
92
  <integer>0</integer>
93
93
  </dict>
94
- <key>lib/loris.rb</key>
94
+ <key>lib/outputs/growl_output.rb</key>
95
95
  <dict>
96
96
  <key>caret</key>
97
97
  <dict>
98
98
  <key>column</key>
99
- <integer>9</integer>
99
+ <integer>15</integer>
100
100
  <key>line</key>
101
- <integer>7</integer>
101
+ <integer>6</integer>
102
102
  </dict>
103
- <key>columnSelection</key>
104
- <false/>
105
103
  <key>firstVisibleColumn</key>
106
104
  <integer>0</integer>
107
105
  <key>firstVisibleLine</key>
108
106
  <integer>0</integer>
109
- <key>selectFrom</key>
110
- <dict>
111
- <key>column</key>
112
- <integer>9</integer>
113
- <key>line</key>
114
- <integer>7</integer>
115
- </dict>
116
- <key>selectTo</key>
117
- <dict>
118
- <key>column</key>
119
- <integer>14</integer>
120
- <key>line</key>
121
- <integer>7</integer>
122
- </dict>
123
107
  </dict>
124
- <key>lib/poller.rb</key>
108
+ <key>lib/outputs/output_collection.rb</key>
125
109
  <dict>
126
110
  <key>caret</key>
127
111
  <dict>
128
112
  <key>column</key>
129
- <integer>0</integer>
113
+ <integer>22</integer>
130
114
  <key>line</key>
131
- <integer>2</integer>
115
+ <integer>8</integer>
132
116
  </dict>
133
117
  <key>firstVisibleColumn</key>
134
118
  <integer>0</integer>
@@ -221,49 +205,33 @@
221
205
  <key>firstVisibleLine</key>
222
206
  <integer>0</integer>
223
207
  </dict>
224
- <key>lib/tasks/list_task.rb</key>
208
+ <key>lib/tasks/js_test_driver/js_test_driver_runner.rb</key>
225
209
  <dict>
226
210
  <key>caret</key>
227
211
  <dict>
228
212
  <key>column</key>
229
213
  <integer>61</integer>
230
214
  <key>line</key>
231
- <integer>13</integer>
215
+ <integer>16</integer>
232
216
  </dict>
233
217
  <key>firstVisibleColumn</key>
234
218
  <integer>0</integer>
235
219
  <key>firstVisibleLine</key>
236
220
  <integer>0</integer>
237
221
  </dict>
238
- <key>spec/file_actioner_spec.rb</key>
222
+ <key>lib/tasks/list_task.rb</key>
239
223
  <dict>
240
224
  <key>caret</key>
241
225
  <dict>
242
226
  <key>column</key>
243
- <integer>7</integer>
227
+ <integer>61</integer>
244
228
  <key>line</key>
245
- <integer>36</integer>
229
+ <integer>13</integer>
246
230
  </dict>
247
- <key>columnSelection</key>
248
- <false/>
249
231
  <key>firstVisibleColumn</key>
250
232
  <integer>0</integer>
251
233
  <key>firstVisibleLine</key>
252
234
  <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>
267
235
  </dict>
268
236
  <key>spec/filters/ends_with_filter_spec.rb</key>
269
237
  <dict>
@@ -285,15 +253,15 @@
285
253
  <string>TODO</string>
286
254
  <string>lib/tasks/javascript_lint/javascript_lint_parser.rb</string>
287
255
  <string>lib/tasks/js_test_driver/js_test_driver_parser.rb</string>
256
+ <string>lib/tasks/js_test_driver/js_test_driver_runner.rb</string>
257
+ <string>lib/outputs/growl_output.rb</string>
258
+ <string>lib/outputs/output_collection.rb</string>
288
259
  <string>lib/filters/ends_with_filter.rb</string>
289
260
  <string>lib/tasks/javascript_lint/javascript_lint_runner.rb</string>
290
261
  <string>Rakefile</string>
291
262
  <string>lib/task_manager.rb</string>
292
263
  <string>lib/file_finder.rb</string>
293
264
  <string>lib/file_actioner.rb</string>
294
- <string>spec/file_actioner_spec.rb</string>
295
- <string>lib/poller.rb</string>
296
- <string>lib/loris.rb</string>
297
265
  <string>lib/tasks/list_task.rb</string>
298
266
  <string>lib/tasks/command_line_task.rb</string>
299
267
  </array>
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
5
10
  platform: ruby
6
11
  authors:
7
12
  - Karl O'Keeffe
@@ -9,49 +14,51 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-11-06 00:00:00 +00:00
17
+ date: 2010-03-26 00:00:00 +00:00
13
18
  default_executable: loris
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: visionmedia-bind
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 2
30
+ - 6
23
31
  version: 0.2.6
24
- version:
32
+ type: :runtime
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: karl-growl
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 1
43
+ - 0
44
+ - 6
33
45
  version: 1.0.6
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  - !ruby/object:Gem::Dependency
36
49
  name: extensions
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
40
52
  requirements:
41
53
  - - ">="
42
54
  - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ - 6
58
+ - 0
43
59
  version: 0.6.0
44
- version:
45
- - !ruby/object:Gem::Dependency
46
- name: win32-process
47
60
  type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 0.6.1
54
- version:
61
+ version_requirements: *id003
55
62
  description: Automatically run javascript unit tests
56
63
  email: loris@monket.net
57
64
  executables:
@@ -60,6 +67,7 @@ extensions: []
60
67
 
61
68
  extra_rdoc_files:
62
69
  - README.rdoc
70
+ - TODO
63
71
  files:
64
72
  - .gitignore
65
73
  - README.rdoc
@@ -144,18 +152,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
152
  requirements:
145
153
  - - ">="
146
154
  - !ruby/object:Gem::Version
155
+ segments:
156
+ - 0
147
157
  version: "0"
148
- version:
149
158
  required_rubygems_version: !ruby/object:Gem::Requirement
150
159
  requirements:
151
160
  - - ">="
152
161
  - !ruby/object:Gem::Version
162
+ segments:
163
+ - 0
153
164
  version: "0"
154
- version:
155
165
  requirements: []
156
166
 
157
167
  rubyforge_project:
158
- rubygems_version: 1.3.5
168
+ rubygems_version: 1.3.6
159
169
  signing_key:
160
170
  specification_version: 3
161
171
  summary: Automatically run javascript unit tests