six-updater 0.17.5 → 0.17.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -3
- data/lib/six/updater/mod.rb +19 -10
- data/lib/six/updater.rb +6 -5
- metadata +2 -2
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.
|
16
|
+
s.version = '0.17.6'
|
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.
|
38
|
+
s.version = '0.17.6'
|
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.
|
59
|
+
s.version = '0.17.6'
|
60
60
|
s.has_rdoc = true
|
61
61
|
s.extra_rdoc_files = ['README', 'LICENSE']
|
62
62
|
s.summary = 'Your summary here'
|
data/lib/six/updater/mod.rb
CHANGED
@@ -200,10 +200,7 @@ module Six
|
|
200
200
|
log.info "Found #{@folder_str}.7z, using it"
|
201
201
|
#Six::Updater.zipcheck
|
202
202
|
FileUtils.mkdir_p @path
|
203
|
-
|
204
|
-
log.debug cmd
|
205
|
-
output = %x[#{cmd}]
|
206
|
-
log.debug output
|
203
|
+
log.debug unpack(file, @path)
|
207
204
|
|
208
205
|
if File.exists?(File.join(@path, ".rsync", "config.yml"))
|
209
206
|
begin
|
@@ -257,6 +254,22 @@ module Six
|
|
257
254
|
end
|
258
255
|
end
|
259
256
|
|
257
|
+
def unpack(file, path = nil)
|
258
|
+
cmd = "7z x -y"
|
259
|
+
cmd << " -o#{esc(path)}" if path
|
260
|
+
cmd << " #{esc(file)}"
|
261
|
+
case RUBY_PLATFORM
|
262
|
+
when /-mingw32$/, /-mswin32$/
|
263
|
+
cmd.gsub!("/", "\\")
|
264
|
+
end
|
265
|
+
|
266
|
+
log.debug cmd
|
267
|
+
out = %x[#{cmd}]
|
268
|
+
log.warn "WARNING: Error unpacking #{path}: #{out}" if $? != 0
|
269
|
+
log.debug out
|
270
|
+
out
|
271
|
+
end
|
272
|
+
|
260
273
|
def cleanup
|
261
274
|
log.warn "CLEANUP Action unimplemented atm, please pick different action"
|
262
275
|
end
|
@@ -304,9 +317,7 @@ module Six
|
|
304
317
|
end
|
305
318
|
else
|
306
319
|
# TODO: Cleanup old keys, Ruby Tar library, examine content? - tarruby doesn't build on 1.9.1. mingw
|
307
|
-
|
308
|
-
cmd.gsub!("/", "\\")
|
309
|
-
system cmd
|
320
|
+
unpack(path, @config[:app_path])
|
310
321
|
end
|
311
322
|
end
|
312
323
|
end
|
@@ -337,9 +348,7 @@ module Six
|
|
337
348
|
FileUtils::mkdir_p uconfig unless File.exists?(uconfig)
|
338
349
|
FileUtils::cp_r(path, uconfigpath)
|
339
350
|
else
|
340
|
-
|
341
|
-
cmd.gsub!("/", "\\")
|
342
|
-
system cmd
|
351
|
+
unpack(path, @config[:app_path])
|
343
352
|
end
|
344
353
|
end
|
345
354
|
end
|
data/lib/six/updater.rb
CHANGED
@@ -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.
|
41
|
+
VERSION = '0.17.6'
|
42
42
|
COMPONENT = 'six-updater'
|
43
43
|
LOG_LIMIT = 9999
|
44
44
|
FOLDER = /(.*)\/(.*)/
|
@@ -437,7 +437,10 @@ module Six
|
|
437
437
|
mods = @mods.clone
|
438
438
|
mods.gsub!(/\//, '-')
|
439
439
|
mods2 = @mods.clone
|
440
|
-
|
440
|
+
case RUBY_PLATFORM
|
441
|
+
when /-mingw32$/, /-mswin32$/
|
442
|
+
mods2.gsub!('/', '\\')
|
443
|
+
end
|
441
444
|
name = "Play ArmA2 with #{mods}.lnk"
|
442
445
|
Win32::Shortcut.new(name) do |shortcut|
|
443
446
|
shortcut.description = "Start Arma2 with #{mods2}"
|
@@ -445,9 +448,7 @@ module Six
|
|
445
448
|
shortcut.working_directory = @config[:app_path]
|
446
449
|
shortcut.arguments = "#{@config[:app_params]} -mod=#{mods2}"
|
447
450
|
end
|
448
|
-
|
449
|
-
str.gsub!('/', '\\')
|
450
|
-
log.info "Created shortcut (in #{str}): #{name}"
|
451
|
+
log.info "Created shortcut (in #{path}): #{name}"
|
451
452
|
Dir.chdir cwd
|
452
453
|
else
|
453
454
|
log.warn "Unsupported on current Platform: #{RUBY_PLATFORM}"
|