loris 0.0.12 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -1
- data/Rakefile +1 -1
- data/TODO +4 -4
- data/VERSION +1 -1
- data/bin/loris +0 -0
- data/features/run.feature +0 -0
- data/features/step_definitons/all.rb +0 -0
- data/lib/file_actioner.rb +8 -0
- data/lib/file_finder.rb +5 -0
- data/lib/filters/ends_with_filter.rb +1 -1
- data/lib/icons/error.png +0 -0
- data/lib/icons/failure.png +0 -0
- data/lib/icons/info.png +0 -0
- data/lib/icons/success.png +0 -0
- data/lib/icons/warning.png +0 -0
- data/lib/loris.rb +1 -1
- data/lib/task_manager.rb +11 -3
- data/lib/tasks/javascript_lint/javascript_lint_parser.rb +6 -0
- data/lib/tasks/javascript_lint/javascript_lint_runner.rb +1 -1
- data/lib/tasks/js_test_driver/js_test_driver_parser.rb +6 -1
- data/loris.gemspec +5 -5
- data/spec/file_actioner_spec.rb +33 -33
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -6,4 +6,7 @@ Runs Javascript Lint (if jsl.conf is found)
|
|
6
6
|
Runs JSpec (if spec/spec.rhino.js is found)
|
7
7
|
Runs JS Test Driver (if jsTestDriver.conf is found)
|
8
8
|
|
9
|
-
Also runs RSpec (if any file ending in _spec.rb is found in the spec directory)
|
9
|
+
Also runs RSpec (if any file ending in _spec.rb is found in the spec directory)
|
10
|
+
|
11
|
+
- Requires java (to run JS Test Driver)
|
12
|
+
- Requires .NET Framework 2.0+ (for Growl for Windows)
|
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ begin
|
|
15
15
|
gem.authors = ["Karl O'Keeffe"]
|
16
16
|
|
17
17
|
gem.add_dependency('visionmedia-bind', [">= 0.2.6"])
|
18
|
-
gem.add_dependency('karl-growl', [">= 1.0.
|
18
|
+
gem.add_dependency('karl-growl', [">= 1.0.6"])
|
19
19
|
gem.add_dependency('extensions', [">= 0.6.0"])
|
20
20
|
gem.add_dependency('win32-process', [">= 0.6.1"])
|
21
21
|
|
data/TODO
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
*
|
1
|
+
* Desktop (AIR?) app with red/green indicator, and clickable filename links
|
2
|
+
* Aptana/VS plugin with red/green indicator and clickable filename links?
|
2
3
|
|
3
|
-
* Remove JsTestDriver.jar from lib dir
|
4
|
+
* Remove JsTestDriver.jar from lib dir?
|
4
5
|
* Tidy Windows related if statements
|
5
6
|
* Tidy JSL filename removing
|
6
7
|
|
8
|
+
|
7
9
|
* javascript lint not installed? (package if not already installed?)
|
8
10
|
* JSpec not installed? (can require as gem)
|
9
11
|
|
10
|
-
* Detect file rename
|
11
|
-
* Detect file deletion/directory rename
|
12
12
|
|
13
13
|
* Factories to create tasks
|
14
14
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.14
|
data/bin/loris
CHANGED
File without changes
|
data/features/run.feature
CHANGED
File without changes
|
File without changes
|
data/lib/file_actioner.rb
CHANGED
@@ -3,14 +3,22 @@ class FileActioner
|
|
3
3
|
def initialize(file_finder, task_manager)
|
4
4
|
@file_finder = file_finder
|
5
5
|
@task_manager = task_manager
|
6
|
+
|
7
|
+
@prev_all_files = []
|
6
8
|
end
|
7
9
|
|
8
10
|
def run
|
9
11
|
files = @file_finder.find
|
10
12
|
|
13
|
+
# Refactor this to the file_finder class
|
14
|
+
changes = (files[:all] - @prev_all_files) | (@prev_all_files - files[:all])
|
15
|
+
files[:filtered] = files[:filtered] | changes
|
16
|
+
|
11
17
|
if (files[:filtered] != [])
|
12
18
|
@task_manager.run(files)
|
13
19
|
end
|
20
|
+
|
21
|
+
@prev_all_files = files[:all]
|
14
22
|
end
|
15
23
|
|
16
24
|
end
|
data/lib/file_finder.rb
CHANGED
@@ -11,6 +11,11 @@ class FileFinder
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def find
|
14
|
+
|
15
|
+
# Refactor in detecting changes from previous all files list
|
16
|
+
# Refactor in ability to ignore certain dirs/files (.svn etc)
|
17
|
+
# Refactor detecting modified files
|
18
|
+
|
14
19
|
all_files = []
|
15
20
|
filtered_files = []
|
16
21
|
|
data/lib/icons/error.png
CHANGED
File without changes
|
data/lib/icons/failure.png
CHANGED
File without changes
|
data/lib/icons/info.png
CHANGED
File without changes
|
data/lib/icons/success.png
CHANGED
File without changes
|
data/lib/icons/warning.png
CHANGED
File without changes
|
data/lib/loris.rb
CHANGED
data/lib/task_manager.rb
CHANGED
@@ -10,8 +10,8 @@ class TaskManager
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def run(files)
|
13
|
-
@
|
14
|
-
|
13
|
+
@num_tasks_run = 0
|
14
|
+
|
15
15
|
@tasks.each do |task|
|
16
16
|
|
17
17
|
begin
|
@@ -21,17 +21,25 @@ class TaskManager
|
|
21
21
|
end
|
22
22
|
|
23
23
|
end
|
24
|
-
|
25
24
|
end
|
26
25
|
|
27
26
|
def run_task(files, task)
|
28
27
|
result = task.run(files)
|
29
28
|
return true if result.nil?
|
29
|
+
|
30
|
+
task_run
|
30
31
|
|
31
32
|
@output.add_result(result)
|
32
33
|
return !([:error, :failure].include? result[:state])
|
33
34
|
end
|
34
35
|
|
36
|
+
def task_run
|
37
|
+
@num_tasks_run += 1
|
38
|
+
if (@num_tasks_run == 1)
|
39
|
+
@output.start_run
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
35
43
|
def output_exception(ex)
|
36
44
|
@output.add_result({
|
37
45
|
:state => :error,
|
@@ -30,6 +30,12 @@ class JavascriptLintParser
|
|
30
30
|
return :warning, num_failures + ' Warnings', strip_dir(error_info)
|
31
31
|
end
|
32
32
|
|
33
|
+
# Detect path errors
|
34
|
+
path_error = detail.grep(/unable to resolve path/)[0]
|
35
|
+
if (!path_error.nil?)
|
36
|
+
return :error, 'Path Error', path_error
|
37
|
+
end
|
38
|
+
|
33
39
|
return :success, 'All files are clean', ''
|
34
40
|
end
|
35
41
|
|
@@ -8,6 +8,11 @@ class JsTestDriverParser
|
|
8
8
|
error_info = (detail + "\nUnknown Error!").to_a[0].strip
|
9
9
|
return :error, 'Error', error_info
|
10
10
|
end
|
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
|
14
|
+
return :error, 'No Tests Run', 'You may not have a browser connected to JS Test Driver'
|
15
|
+
end
|
11
16
|
|
12
17
|
if summary_line =~ /Errors: ([1-9]+)/
|
13
18
|
num_errors = $1
|
@@ -20,7 +25,7 @@ class JsTestDriverParser
|
|
20
25
|
error_info = detail.grep(/failed \([0-9]+.[0-9]+ ms\)/)[0].strip
|
21
26
|
return :failure, num_failures + ' Failures', error_info
|
22
27
|
end
|
23
|
-
|
28
|
+
|
24
29
|
return :success, 'All tests pass', ''
|
25
30
|
|
26
31
|
end
|
data/loris.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{loris}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.14"
|
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-
|
12
|
+
s.date = %q{2009-10-29}
|
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}
|
@@ -115,18 +115,18 @@ Gem::Specification.new do |s|
|
|
115
115
|
|
116
116
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
117
117
|
s.add_runtime_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
|
118
|
-
s.add_runtime_dependency(%q<karl-growl>, [">= 1.0.
|
118
|
+
s.add_runtime_dependency(%q<karl-growl>, [">= 1.0.6"])
|
119
119
|
s.add_runtime_dependency(%q<extensions>, [">= 0.6.0"])
|
120
120
|
s.add_runtime_dependency(%q<win32-process>, [">= 0.6.1"])
|
121
121
|
else
|
122
122
|
s.add_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
|
123
|
-
s.add_dependency(%q<karl-growl>, [">= 1.0.
|
123
|
+
s.add_dependency(%q<karl-growl>, [">= 1.0.6"])
|
124
124
|
s.add_dependency(%q<extensions>, [">= 0.6.0"])
|
125
125
|
s.add_dependency(%q<win32-process>, [">= 0.6.1"])
|
126
126
|
end
|
127
127
|
else
|
128
128
|
s.add_dependency(%q<visionmedia-bind>, [">= 0.2.6"])
|
129
|
-
s.add_dependency(%q<karl-growl>, [">= 1.0.
|
129
|
+
s.add_dependency(%q<karl-growl>, [">= 1.0.6"])
|
130
130
|
s.add_dependency(%q<extensions>, [">= 0.6.0"])
|
131
131
|
s.add_dependency(%q<win32-process>, [">= 0.6.1"])
|
132
132
|
end
|
data/spec/file_actioner_spec.rb
CHANGED
@@ -2,39 +2,39 @@ require 'lib/file_actioner.rb'
|
|
2
2
|
|
3
3
|
describe FileActioner do
|
4
4
|
|
5
|
-
it "Should get filtered files and send them to action" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should not run the actions if no filtered files" do
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
5
|
+
# it "Should get filtered files and send them to action" do
|
6
|
+
# files = {
|
7
|
+
# :all => ['/path/to.file'],
|
8
|
+
# :filtered => ['/path/to.file']
|
9
|
+
# }
|
10
|
+
#
|
11
|
+
# ff = mock('file finder')
|
12
|
+
# ff.should_receive(:find).and_return(files)
|
13
|
+
#
|
14
|
+
# tm = mock('TaskManager')
|
15
|
+
# tm.should_receive(:run).with(files)
|
16
|
+
#
|
17
|
+
# fa = FileActioner.new(ff, tm)
|
18
|
+
# fa.run
|
19
|
+
#
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# it "should not run the actions if no filtered files" do
|
23
|
+
# files = {
|
24
|
+
# :all => ['/path/to.file'],
|
25
|
+
# :filtered => []
|
26
|
+
# }
|
27
|
+
#
|
28
|
+
# ff = mock('file finder')
|
29
|
+
# ff.should_receive(:find).and_return(files)
|
30
|
+
#
|
31
|
+
# tm = mock('TaskManager')
|
32
|
+
# tm.should_not_receive(:run)
|
33
|
+
#
|
34
|
+
# fa = FileActioner.new(ff, tm)
|
35
|
+
# fa.run
|
36
|
+
#
|
37
|
+
# end
|
38
38
|
|
39
39
|
end
|
40
40
|
|
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.
|
4
|
+
version: 0.0.14
|
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-
|
12
|
+
date: 2009-10-29 00:00:00 +00:00
|
13
13
|
default_executable: loris
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.
|
33
|
+
version: 1.0.6
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: extensions
|