guard-jasmine 1.18.2 → 1.18.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dad3977ff6ae64bcbfadd40d745008ac7e7d4f8f
4
- data.tar.gz: 833453756677888df558cb1135bc631044385f98
3
+ metadata.gz: 23bb53cca2e5b5ce98b0b78b80f5bc7562efead1
4
+ data.tar.gz: 0a7e7b695bc1e37873951d24e851512598eab59a
5
5
  SHA512:
6
- metadata.gz: c63479cc2526d6747ed95099b8940f96ee0a58092b056461ddcab834e6f0cdb9181883703e9d6016f9e77445934d3883290db031af416dd41e2226b7ed0cbf58
7
- data.tar.gz: b56f521141ed31168f4c698e58a949f34b149c89a2b64643051d53e42f5326fa07b4554d28bbf61b72929b146c90e279d0189b4d9d882ec02255eb172133d9a7
6
+ metadata.gz: a7f629189012aba7a3668d774b51b499e356d87714bca03abe83dc3604875eb4e8d4c03c1c760b80d5395e6412c49777b53647432b232a409006c6d2fede7a81
7
+ data.tar.gz: a6799461e50bf9cf5971256f38d91585da535af35df17233c93e6f0a83235e5c27df67bfdaf3585d8f8fc347cff572cd88c6afeb60e2b0ef42c7f54878daa598
data/README.md CHANGED
@@ -577,6 +577,9 @@ can also enable two more reports:
577
577
  coverage_html: true # Enable Istanbul HTML coverage report
578
578
  # default: false
579
579
 
580
+ coverage_html_dir: './coverage' # Directory to write Istanbul HTML coverage report to
581
+ # default: './coverage'
582
+
580
583
  coverage_summary: true # Enable Istanbul summary coverage report
581
584
  # default: false
582
585
  ```
@@ -14,8 +14,6 @@ class JasmineCoverage < Tilt::Template
14
14
  end
15
15
 
16
16
  # Returns a coverage instrumented JavaScript file
17
- # when the environment variable `JSCOVERAGE` is `true`
18
- # and the `jscoverage` binary is in the `$PATH`.
19
17
  #
20
18
  def evaluate(context, locals)
21
19
  return data unless JasmineCoverage.coverage_bin
@@ -277,20 +277,24 @@ module Guard
277
277
  # @option options [Boolean] :hide_success hide success message notification
278
278
  #
279
279
  def notify_coverage_result(coverage, file, options)
280
- FileUtils.mkdir_p(coverage_root) unless File.exist?(coverage_root)
280
+ if coverage_bin
281
+ FileUtils.mkdir_p(coverage_root) unless File.exist?(coverage_root)
281
282
 
282
- update_coverage(coverage, file, options)
283
+ update_coverage(coverage, file, options)
283
284
 
284
- if options[:coverage_summary]
285
- generate_summary_report
286
- else
287
- generate_text_report(file, options)
288
- end
285
+ if options[:coverage_summary]
286
+ generate_summary_report
287
+ else
288
+ generate_text_report(file, options)
289
+ end
289
290
 
290
- check_coverage(options)
291
+ check_coverage(options)
291
292
 
292
- if options[:coverage_html]
293
- generate_html_report(options)
293
+ if options[:coverage_html]
294
+ generate_html_report(options)
295
+ end
296
+ else
297
+ Formatter.error('Skipping coverage report: unable to locate istanbul in your PATH')
294
298
  end
295
299
  end
296
300
 
@@ -312,7 +316,7 @@ module Guard
312
316
 
313
317
  puts ''
314
318
 
315
- `#{ which('istanbul') } report --root #{ coverage_root } text #{ coverage_file }`.each_line do |line|
319
+ `#{coverage_bin} report --root #{ coverage_root } text #{ coverage_file }`.each_line do |line|
316
320
  puts line.sub(/\n$/, '') if line =~ matcher
317
321
  end
318
322
 
@@ -326,7 +330,7 @@ module Guard
326
330
  #
327
331
  def check_coverage(options)
328
332
  if any_coverage_threshold?(options)
329
- coverage = `#{ which('istanbul') } check-coverage #{ istanbul_coverage_options(options) } #{ coverage_file } 2>&1`
333
+ coverage = `#{coverage_bin} check-coverage #{ istanbul_coverage_options(options) } #{ coverage_file } 2>&1`
330
334
  coverage = coverage.split("\n").grep(/ERROR/).join.sub('ERROR:', '')
331
335
  failed = $? && $?.exitstatus != 0
332
336
 
@@ -347,7 +351,7 @@ module Guard
347
351
  #
348
352
  def generate_html_report(options)
349
353
  report_directory = coverage_report_directory(options)
350
- `#{ which('istanbul') } report --dir #{ report_directory } --root #{ coverage_root } html #{ coverage_file }`
354
+ `#{coverage_bin} report --dir #{ report_directory } --root #{ coverage_root } html #{ coverage_file }`
351
355
  Formatter.info "Updated HTML report available at: #{ report_directory }/index.html"
352
356
  end
353
357
 
@@ -359,7 +363,7 @@ module Guard
359
363
 
360
364
  puts ''
361
365
 
362
- `#{ which('istanbul') } report --root #{ coverage_root } text-summary #{ coverage_file }`.each_line do |line|
366
+ `#{coverage_bin} report --root #{ coverage_root } text-summary #{ coverage_file }`.each_line do |line|
363
367
  puts line.sub(/\n$/, '') if line =~ /\)$/
364
368
  end
365
369
 
@@ -640,6 +644,14 @@ module Guard
640
644
  end.reject(&:empty?).join(' ')
641
645
  end
642
646
 
647
+ # Returns the coverage executable path.
648
+ #
649
+ # @return [String] the path
650
+ #
651
+ def coverage_bin
652
+ @coverage_bin ||= which 'istanbul'
653
+ end
654
+
643
655
  # Get the coverage file to save all coverage data.
644
656
  # Creates `tmp/coverage` if not exists.
645
657
  #
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module JasmineVersion
3
3
  # Guard::Jasmine version that is used for the Gem specification
4
- VERSION = '1.18.2'
4
+ VERSION = '1.18.3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.2
4
+ version: 1.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2013-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard