guard-jasmine 1.12.1 → 1.12.2

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.
data/README.md CHANGED
@@ -493,14 +493,14 @@ Guard::Jasmine supports coverage reports generated by [Istanbul](https://github.
493
493
  have `istanbul` in your path in order to make this feature work. You can install it with NPM
494
494
 
495
495
  ```ruby
496
- $ npm install istanbul
496
+ $ npm install -g istanbul
497
497
  ```
498
498
 
499
499
  You also need to explicit enable the coverage support in the options:
500
500
 
501
501
  ```ruby
502
- :coverage => :true # Enable/disable JavaScript coverage support
503
- # default: :false
502
+ :coverage => true # Enable/disable JavaScript coverage support
503
+ # default: false
504
504
  ```
505
505
 
506
506
  ### Instrumentation
@@ -546,11 +546,11 @@ Guard::Jasmine always shows the Istanbul text report after a spec run that conta
546
546
  can also enable two more reports:
547
547
 
548
548
  ```ruby
549
- :coverage_html => :true # Enable Istanbul HTML coverage report
550
- # default: :false
549
+ :coverage_html => true # Enable Istanbul HTML coverage report
550
+ # default: false
551
551
 
552
- :coverage_summary => :true # Enable Istanbul summary coverage report
553
- # default: :false
552
+ :coverage_summary => true # Enable Istanbul summary coverage report
553
+ # default: false
554
554
  ```
555
555
 
556
556
  The `:coverage_summary` options disables the detailed file based coverage report by a small summary coverage report.
@@ -639,6 +639,8 @@ Options:
639
639
  [--specdoc=SPECDOC] # Whether to show successes in the spec runner, either `always`, `never` or `failure`
640
640
  # Default: always
641
641
  [--coverage] # Whether to enable the coverage support or not
642
+ [--coverage-html] # Whether to generate html coverage report. Implies --coverage
643
+ [--coverage-summary] # Whether to generate html coverage summary. Implies --coverage
642
644
  [--statements-threshold=N] # Statements coverage threshold
643
645
  # Default: 0
644
646
  [--functions-threshold=N] # Functions coverage threshold
@@ -97,6 +97,16 @@ module Guard
97
97
  :default => false,
98
98
  :desc => 'Whether to enable the coverage support or not'
99
99
 
100
+ method_option :coverage_html,
101
+ :type => :boolean,
102
+ :default => false,
103
+ :desc => 'Whether to generate html coverage report. Implies --coverage'
104
+
105
+ method_option :coverage_summary,
106
+ :type => :boolean,
107
+ :default => false,
108
+ :desc => 'Whether to generate html coverage summary. Implies --coverage'
109
+
100
110
  method_option :statements_threshold,
101
111
  :type => :numeric,
102
112
  :default => 0,
@@ -139,7 +149,9 @@ module Guard
139
149
  runner_options[:errors] = [:always, :never, :failure].include?(options.errors.to_sym) ? options.errors.to_sym : :failure
140
150
  runner_options[:specdoc] = [:always, :never, :failure].include?(options.specdoc.to_sym) ? options.specdoc.to_sym : :always
141
151
  runner_options[:focus] = options.focus
142
- runner_options[:coverage] = options.coverage
152
+ runner_options[:coverage] = options.coverage || options.coverage_html || options.coverage_summary
153
+ runner_options[:coverage_html] = options.coverage_html
154
+ runner_options[:coverage_summary] = options.coverage_summary
143
155
  runner_options[:statements_threshold] = options.statements_threshold
144
156
  runner_options[:functions_threshold] = options.functions_threshold
145
157
  runner_options[:branches_threshold] = options.branches_threshold
@@ -26,16 +26,12 @@ class JasmineCoverage < Tilt::Template
26
26
 
27
27
  File.write input, data
28
28
 
29
- r, w = IO.pipe
30
- proc = ChildProcess.build(JasmineCoverage.coverage_bin, 'instrument', '--embed-source', input)
31
- proc.io.stdout = proc.io.stderr = w
32
- proc.start
33
- proc.wait
34
- w.close
29
+ result = %x[#{JasmineCoverage.coverage_bin} instrument --embed-source #{input.shellescape}]
35
30
 
36
- raise "Could not generate coverage instrumented file for #{ file }" unless proc.exit_code == 0
31
+ raise "Could not generate coverage instrumented file for #{ file }" unless $?.exitstatus == 0
32
+
33
+ result.gsub input, file
37
34
 
38
- r.read.gsub input, file
39
35
  end
40
36
  end
41
37
 
@@ -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.12.1'
4
+ VERSION = '1.12.2'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-jasmine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  version: 1.3.6
147
147
  requirements: []
148
148
  rubyforge_project: guard-jasmine
149
- rubygems_version: 1.8.24
149
+ rubygems_version: 1.8.25
150
150
  signing_key:
151
151
  specification_version: 3
152
152
  summary: Guard gem for headless testing with Jasmine