six-updater 0.11.3 → 0.11.4

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/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-updater'
15
- s.version = '0.11.3'
15
+ s.version = '0.11.4'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
@@ -12,11 +12,29 @@ module Six
12
12
  #Signal.trap("KILL") { exit_app }
13
13
 
14
14
  if File.exist?(PID_FILE)
15
- log.error "The program seems to be already running. Please wait/close the other application first."
16
- log.info "If you believe this is in error, please delete #{PID_FILE}"
17
- log.info "If the file doesn't exist, you are probably NOT running this software 'As Administrator'"
18
- sleep 15
19
- Process.exit
15
+ pid = File.open(PID_FILE) {|file| file.read}
16
+ out = %x[tasklist]
17
+ found = false
18
+ out.split("\n").each do |line|
19
+ line[/\Aruby\.exe[\t| ]*([0-9]*)/]
20
+ p = $1
21
+ if p
22
+ if p.size > 0
23
+ pid = pid.to_i
24
+ found = true if pid == p.to_i
25
+ end
26
+ end
27
+ #end
28
+ end
29
+ if found
30
+ log.error "The program seems to be already running (PID: #{pid}). Please wait/close the other application first."
31
+ log.info "If you believe this is in error, please delete #{PID_FILE}"
32
+ log.info "If the file doesn't exist, you are probably NOT running this software 'As Administrator'"
33
+ sleep 15
34
+ Process.exit
35
+ else
36
+ FileUtils.rm_f PID_FILE
37
+ end
20
38
  end
21
39
  File.open(PID_FILE, 'w') {|f| f.puts Process.pid}
22
40
 
data/lib/six/updater.rb CHANGED
@@ -44,7 +44,7 @@ end
44
44
  module Six
45
45
  # TODO: Evaluate if this module should be a class instead?
46
46
  module Updater
47
- VERSION = '0.11.3'
47
+ VERSION = '0.11.4'
48
48
  COMPONENT = 'six-updater'
49
49
 
50
50
  # Configuration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.3
4
+ version: 0.11.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-10 00:00:00 +01:00
12
+ date: 2009-12-11 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency