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 +1 -1
- data/lib/six/updater-app.rb +23 -5
- data/lib/six/updater.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/six/updater-app.rb
CHANGED
@@ -12,11 +12,29 @@ module Six
|
|
12
12
|
#Signal.trap("KILL") { exit_app }
|
13
13
|
|
14
14
|
if File.exist?(PID_FILE)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
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.
|
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-
|
12
|
+
date: 2009-12-11 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|