quality 0.2.4 → 0.2.5

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.
@@ -82,18 +82,22 @@ module Quality
82
82
  options,
83
83
  &process_output_line)
84
84
 
85
+ gives_error_code_on_violations ||= options[:gives_error_code_on_violations]
85
86
  args ||= options[:args]
86
87
  emacs_format ||= options[:emacs_format]
87
88
 
88
-
89
-
90
89
  violations = 0
91
90
  out = ""
92
91
  found_output = false
93
- if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
94
- ext='.bat'
92
+ if defined? RUBY_ENGINE && RUBY_ENGINE == 'jruby'
93
+ full_cmd = "jruby -S #{cmd}"
94
+ elsif RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
95
+ full_cmd = "#{cmd}.bat"
96
+ else
97
+ full_cmd = cmd
95
98
  end
96
- full_cmd = "#{cmd}#{ext}"
99
+
100
+
97
101
  if !args.nil?
98
102
  full_cmd = "#{full_cmd} #{args}"
99
103
  end
@@ -117,8 +121,10 @@ module Quality
117
121
  end
118
122
  end
119
123
  exit_status = $?.exitstatus
120
- if !found_output
121
- fail "#{full_cmd} execution failed! Exit status is #{exit_status}"
124
+ if !gives_error_code_on_violations
125
+ if exit_status != 0
126
+ fail "Error detected running #{full_cmd}. Exit status is #{exit_status}, output is [#{out}]"
127
+ end
122
128
  end
123
129
  filename = "#{cmd}_high_water_mark"
124
130
  if File.exist?(filename)
@@ -202,8 +208,9 @@ module Quality
202
208
 
203
209
  def quality_rubocop
204
210
  ratchet_quality_cmd("rubocop",
211
+ gives_error_code_on_violations: true,
205
212
  args: "--format emacs #{ruby_files}") { |line|
206
- if line =~ /^.* files inspected, (.*) offences detected$/
213
+ if line =~ /^.* file[s|] inspected, (.*) offence[s|] detected$/
207
214
  $1.to_i
208
215
  else
209
216
  0
@@ -1,3 +1,3 @@
1
1
  module Quality
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -166,12 +166,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  - - ! '>='
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
+ segments:
170
+ - 0
171
+ hash: 249556879
169
172
  required_rubygems_version: !ruby/object:Gem::Requirement
170
173
  none: false
171
174
  requirements:
172
175
  - - ! '>='
173
176
  - !ruby/object:Gem::Version
174
177
  version: '0'
178
+ segments:
179
+ - 0
180
+ hash: 249556879
175
181
  requirements: []
176
182
  rubyforge_project:
177
183
  rubygems_version: 1.8.23