six-updater 0.13.4 → 0.13.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/updater.rb +12 -8
  3. metadata +1 -1
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.13.4'
15
+ s.version = '0.13.5'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
@@ -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.13.4'
47
+ VERSION = '0.13.5'
48
48
  COMPONENT = 'six-updater'
49
49
 
50
50
  # Configuration
@@ -83,7 +83,7 @@ module Six
83
83
 
84
84
  DATA_PATH = if ENV['APPDATA']
85
85
  if ENV['APPDATA'].size > 0
86
- if File.exists?(ENV['APPDATA'])
86
+ if File.directory?(ENV['APPDATA'])
87
87
  File.join(ENV['APPDATA'], 'Six-Updater')
88
88
  else
89
89
  BASE_PATH
@@ -97,12 +97,16 @@ module Six
97
97
 
98
98
 
99
99
  lf = File.join(DATA_PATH, "logs")
100
- FileUtils.mkdir_p(lf) unless File.exists?(lf)
100
+ FileUtils.mkdir_p(lf) unless File.directory?(lf)
101
101
 
102
102
  cf = File.join(DATA_PATH, "#{COMPONENT}.yml")
103
103
  unless File.exists?(cf)
104
104
  cfo = File.join(BASE_PATH, "#{COMPONENT}.yml")
105
- FileUtils.mv(cfo, cf) if File.exists?(cfo)
105
+ FileUtils.cp(cfo, cf) if File.exists?(cfo)
106
+ begin
107
+ FileUtils.rm_f(cfo) if File.exists?(cfo)
108
+ rescue
109
+ end
106
110
  end
107
111
 
108
112
  LOG_LIMIT = 9999
@@ -180,7 +184,7 @@ module Six
180
184
  if ARGV[0]
181
185
  # FIXME: This is not a very good catch..
182
186
  if ARGV[0][/.*\..*/]
183
- if FileTest.exist?(ARGV[0])
187
+ if File.exists?(ARGV[0])
184
188
  config = ARGV[0]
185
189
  else
186
190
  log.warn "#{ARGV[0]} not found, trying #{config}"
@@ -188,7 +192,7 @@ module Six
188
192
  end
189
193
  end
190
194
 
191
- unless FileTest.exist?(config)
195
+ unless File.exists?(config)
192
196
  log.error "ERROR: #{config} config missing!"
193
197
  wait
194
198
  exit
@@ -230,7 +234,7 @@ module Six
230
234
  # Verify installation folder
231
235
  if @config[:app_path]
232
236
  log.info "ArmA Path: #{@config[:app_path]}"
233
- if FileTest.exists?(@config[:app_path])
237
+ if File.exists?(@config[:app_path])
234
238
  @config[:app_path].gsub!('\\', '/')
235
239
  else
236
240
  log.error "No valid ArmA installation folder found, please abort!"
@@ -245,7 +249,7 @@ module Six
245
249
 
246
250
  if @config[:app_modpath]
247
251
  log.info "Installation Path: #{@config[:app_modpath]}"
248
- if FileTest.exists?(@config[:app_modpath])
252
+ if File.exists?(@config[:app_modpath])
249
253
  @config[:app_modpath].gsub!('\\', '/')
250
254
  else
251
255
  log.error "No valid Mod installation folder found, please abort!"
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.13.4
4
+ version: 0.13.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy