js-test-server 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ def run_suite
28
28
  end
29
29
 
30
30
  PKG_NAME = "js-test-server"
31
- PKG_VERSION = "0.2.7"
31
+ PKG_VERSION = "0.2.8"
32
32
  PKG_FILES = FileList[
33
33
  '[A-Z]*',
34
34
  '*.rb',
@@ -12,8 +12,8 @@ module JsTestServer
12
12
  end
13
13
  end
14
14
 
15
- attr_reader :host, :port, :spec_path, :root_path, :framework_path, :framework_name
16
- attr_writer :host, :port, :framework_path, :framework_name
15
+ attr_reader :host, :port, :spec_path, :root_path, :framework_path, :framework_name, :javascript_test_file_glob
16
+ attr_writer :host, :port, :framework_path, :framework_name, :javascript_test_file_glob
17
17
 
18
18
  def initialize(params={})
19
19
  params = Server::DEFAULTS.dup.merge(params)
@@ -23,6 +23,7 @@ module JsTestServer
23
23
  @port = params[:port]
24
24
  @framework_path = params[:framework_path]
25
25
  @framework_name = params[:framework_name]
26
+ @javascript_test_file_glob = params[:javascript_test_file_glob]
26
27
  end
27
28
 
28
29
  def suite_view_class
@@ -4,6 +4,7 @@ module JsTestServer::Server
4
4
  :port => 8080,
5
5
  :spec_path => File.expand_path("./spec/javascripts"),
6
6
  :root_path => File.expand_path("./public"),
7
+ :javascript_test_file_glob => "**/*_spec.js"
7
8
  }
8
9
  end
9
10
 
@@ -14,7 +14,7 @@ class JsTestServer::Server::Resources::SpecFile < JsTestServer::Server::Resource
14
14
  def do_get
15
15
  if ::File.exists?(absolute_path)
16
16
  if ::File.directory?(absolute_path)
17
- spec_files = ::Dir["#{absolute_path}/**/*.js"].map do |file|
17
+ spec_files = ::Dir["#{absolute_path}/#{JsTestServer.javascript_test_file_glob}"].map do |file|
18
18
  ["#{relative_path}#{file.gsub(absolute_path, "")}"]
19
19
  end
20
20
  get_generated_spec(absolute_path, spec_files)
@@ -44,6 +44,12 @@ class JsTestServer::Server::Runner
44
44
  :type => String,
45
45
  :default => ""
46
46
  )
47
+ opt(
48
+ :javascript_test_file_glob,
49
+ "The glob to find the javascript files",
50
+ :type => String,
51
+ :default => DEFAULTS[:javascript_test_file_glob]
52
+ )
47
53
  end
48
54
 
49
55
  JsTestServer.port = opts[:port]
@@ -51,6 +57,7 @@ class JsTestServer::Server::Runner
51
57
  JsTestServer.framework_path = opts[:framework_path]
52
58
  JsTestServer.spec_path = opts[:spec_path]
53
59
  JsTestServer.root_path = opts[:root_path]
60
+ JsTestServer.javascript_test_file_glob = opts[:javascript_test_file_glob]
54
61
  suite_view_class = JsTestServer::Configuration.instance.suite_view_class
55
62
  suite_view_class.project_js_files.push(*opts[:javascript_files].split(","))
56
63
  suite_view_class.project_css_files.push(*opts[:css_files].split(","))
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: js-test-server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 7
10
- version: 0.2.7
9
+ - 8
10
+ version: 0.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Takita
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-01 00:00:00 -07:00
18
+ date: 2010-07-06 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency