six-updater 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ require 'rake/testtask'
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.platform = "x86-mingw32"
15
15
  s.name = 'six-updater'
16
- s.version = '0.17.3'
16
+ s.version = '0.17.4'
17
17
  s.has_rdoc = true
18
18
  s.extra_rdoc_files = ['README', 'LICENSE']
19
19
  s.summary = 'Your summary here'
@@ -35,7 +35,7 @@ end
35
35
  spec3 = Gem::Specification.new do |s|
36
36
  s.platform = "x86-mswin32"
37
37
  s.name = 'six-updater'
38
- s.version = '0.17.3'
38
+ s.version = '0.17.4'
39
39
  s.has_rdoc = true
40
40
  s.extra_rdoc_files = ['README', 'LICENSE']
41
41
  s.summary = 'Your summary here'
@@ -56,7 +56,7 @@ end
56
56
 
57
57
  spec2 = Gem::Specification.new do |s|
58
58
  s.name = 'six-updater'
59
- s.version = '0.17.3'
59
+ s.version = '0.17.4'
60
60
  s.has_rdoc = true
61
61
  s.extra_rdoc_files = ['README', 'LICENSE']
62
62
  s.summary = 'Your summary here'
@@ -15,21 +15,33 @@ module Six
15
15
  pid = File.open(PID_FILE) {|file| file.read}
16
16
  pid = pid.to_i
17
17
  found = false
18
+
18
19
  begin
19
- out = %x[tasklist]
20
- out.split("\n").each do |line|
21
- line[/\Aruby\.exe[\t| ]*([0-9]*)/]
22
- p = $1
23
- if p
24
- if p.size > 0
25
- found = true if pid == p.to_i
20
+ case RUBY_PLATFORM
21
+ when /-mingw32$/, /-mswin32$/
22
+ out = %x[tasklist]
23
+ out.split("\n").each do |line|
24
+ line[/\Aruby\.exe[\t| ]*([0-9]*)/]
25
+ p = $1
26
+ if p
27
+ if p.size > 0
28
+ found = true if pid == p.to_i
29
+ end
30
+ end
31
+ end
32
+ else
33
+ %x[ps -A | grep #{pid}].split("\n").each do |line|
34
+ unless line[/grep/]
35
+ line[/^\s*([0-9]*)/]
36
+ found = true if $1 == pid.to_s
37
+ end
26
38
  end
27
- end
28
39
  end
29
40
  rescue
30
41
  log.warn "Failed checking tasklist for #{pid}"
31
42
  log.debug "#{$!}"
32
43
  end
44
+
33
45
  if found
34
46
  log.error "The program seems to be already running (PID: #{pid}). Please wait/close the other application first."
35
47
  log.info "If you believe this is in error, please delete #{PID_FILE}"
@@ -38,7 +38,7 @@ end
38
38
  module Six
39
39
  # TODO: Evaluate if this module should be a class instead?
40
40
  module Updater
41
- VERSION = '0.17.3'
41
+ VERSION = '0.17.4'
42
42
  COMPONENT = 'six-updater'
43
43
  LOG_LIMIT = 9999
44
44
  FOLDER = /(.*)\/(.*)/
@@ -209,7 +209,7 @@ module Six
209
209
 
210
210
  unless File.exists?(config)
211
211
  log.error "ERROR: #{config} config missing!"
212
- wait
212
+ wait if @config[:wait]
213
213
  exit
214
214
  end
215
215
 
@@ -257,12 +257,12 @@ module Six
257
257
  @config[:app_path].gsub!('\\', '/')
258
258
  else
259
259
  log.error "No valid ArmA installation folder found, please abort!"
260
- wait
260
+ wait if @config[:wait]
261
261
  exit
262
262
  end
263
263
  else
264
264
  log.error "No valid ArmA installation folder found, please abort!"
265
- wait
265
+ wait if @config[:wait]
266
266
  exit
267
267
  end
268
268
 
@@ -272,7 +272,7 @@ module Six
272
272
  @config[:app_modpath].gsub!('\\', '/')
273
273
  else
274
274
  log.error "No valid Mod installation folder found, please abort!"
275
- wait
275
+ wait if @config[:wait]
276
276
  exit
277
277
  end
278
278
  else
@@ -284,7 +284,7 @@ module Six
284
284
  a_prio = a[:priority] ? a[:priority] : 9999
285
285
  b_prio = b[:priority] ? b[:priority] : 9999
286
286
  a_prio <=> b_prio
287
- end
287
+ end procs
288
288
  log.debug "@config #{@config}"
289
289
 
290
290
  procs = find_process(process_name)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 17
8
- - 3
9
- version: 0.17.3
8
+ - 4
9
+ version: 0.17.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy