six-updater-web 0.13.3 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'six-updater-web'
10
- s.version = '0.13.3'
10
+ s.version = '0.13.4'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -180,35 +180,18 @@ class MainController < ApplicationController
180
180
  preset = Sixconfig.new
181
181
  preset.name = "Dynamic"
182
182
  preset.mods += Mod.find(:all)
183
- elsif preset
184
- else
185
- @msg << "No preset selected!"
186
- act
187
- return
188
- end
189
- @msg << "Using preset: #{preset.name}" if preset
190
- unless params["all"]
191
- if server
192
- @msg << "Override server: #{server.name}"
193
- else
194
- if preset
195
- if preset.server
196
- server = preset.server
197
- @msg << "Preset server: #{server.name}"
198
- end
199
- end
200
- end
201
183
  end
184
+ end
185
+
186
+ if preset
187
+ @msg << "Using preset: #{preset.name}"
202
188
  else
203
- # TODO: Automatically handle all this stuff better :)
204
- if preset
205
- @msg << "Using preset: #{preset.name}"
206
- else
207
- @msg << "No preset selected!"
208
- act
209
- return
210
- end
189
+ @msg << "No preset selected!"
190
+ act
191
+ return
192
+ end
211
193
 
194
+ unless params["all"]
212
195
  if server
213
196
  @msg << "Override server: #{server.name}"
214
197
  else
@@ -217,24 +200,24 @@ class MainController < ApplicationController
217
200
  @msg << "Preset server: #{server.name}"
218
201
  end
219
202
  end
203
+ end
220
204
 
221
- unless reset
222
- if setting
223
- @msg << "Override settings profile: #{setting.name}"
224
- else
225
- if preset.appsetting
226
- setting = preset.appsetting
227
- @msg << "Preset settings profile: #{setting.name}"
228
- end
205
+ unless reset
206
+ if setting
207
+ @msg << "Override settings profile: #{setting.name}"
208
+ else
209
+ if preset.appsetting
210
+ setting = preset.appsetting
211
+ @msg << "Preset settings profile: #{setting.name}"
229
212
  end
213
+ end
230
214
 
231
- if action
232
- @msg << "Override action: #{action.name}"
233
- else
234
- if preset.action
235
- action = preset.action
236
- @msg << "Preset action: #{action.name}"
237
- end
215
+ if action
216
+ @msg << "Override action: #{action.name}"
217
+ else
218
+ if preset.action
219
+ action = preset.action
220
+ @msg << "Preset action: #{action.name}"
238
221
  end
239
222
  end
240
223
  end
@@ -302,10 +285,10 @@ class MainController < ApplicationController
302
285
  Mod.read_modfolders(setting)
303
286
  end
304
287
 
305
- @skip.sort! {|a, b| a.name <=> b.name}
306
- @check.sort! {|a, b| a.name <=> b.name}
307
- @install.sort! {|a, b| a.name <=> b.name}
308
- @disabled.sort! {|a, b| a.name <=> b.name}
288
+ @skip.sort! { |a, b| a.name <=> b.name }
289
+ @check.sort! { |a, b| a.name <=> b.name }
290
+ @install.sort! { |a, b| a.name <=> b.name }
291
+ @disabled.sort! { |a, b| a.name <=> b.name }
309
292
  act
310
293
  end
311
294
 
@@ -382,7 +365,7 @@ class MainController < ApplicationController
382
365
  @cloghash = Hash.new
383
366
  Mod.find(:all).each do |mod|
384
367
  clog = File.join(path, mod.real_name, "changelog.txt")
385
- @cloghash[mod.real_name] = File.open(clog) {|f| f.readlines } if File.exists?(clog)
368
+ @cloghash[mod.real_name] = File.open(clog) { |f| f.readlines } if File.exists?(clog)
386
369
  end
387
370
  end
388
371
 
@@ -37,7 +37,7 @@ class Mod < ActiveRecord::Base
37
37
  return unless path && self.real_name
38
38
  cfg = File.join(path, self.real_name, '.rsync', '.repository.yml')
39
39
  if File.exists?(cfg)
40
- conf = YAML::load(File.open(cfg))
40
+ conf = YAML::load_file(cfg)
41
41
  if conf
42
42
  conf[:version]
43
43
  else
@@ -17,14 +17,16 @@ class SystemSetting < ActiveRecord::Base
17
17
  def update_gamespy
18
18
  self.gamespied_at = Time.now
19
19
  self.save
20
- cl = "sync:gamespy RAILS_ENV=#{ENV['RAILS_ENV']} BASE_PATH=\'#{SixUpdaterWeb::BASE_PATH}\'" # + cl
20
+ cl = "sync:gamespy RAILS_ENV=#{ENV['RAILS_ENV']}" # + cl
21
+ cl += " BASE_PATH=\'#{ENV['BASE_PATH']}\'" if ENV['BASE_PATH']
21
22
  SixUpdaterWeb.run_program(exec, RAILS_ROOT, cl)
22
23
  end
23
24
 
24
25
  def update_gamespy_nogeo
25
26
  self.gamespied_at = Time.now
26
27
  self.save
27
- cl = "sync:gamespy RAILS_ENV=#{ENV['RAILS_ENV']} NOGEO=1 BASE_PATH=\'#{SixUpdaterWeb::BASE_PATH}\'" # + cl
28
+ cl = "sync:gamespy RAILS_ENV=#{ENV['RAILS_ENV']} NOGEO=1" # + cl
29
+ cl += " BASE_PATH=\'#{ENV['BASE_PATH']}\'" if ENV['BASE_PATH']
28
30
  SixUpdaterWeb.run_program(exec, RAILS_ROOT, cl)
29
31
  end
30
32
 
@@ -7,9 +7,9 @@ module SixUpdaterWeb
7
7
  ENV['BASE_PATH'] ? ENV['BASE_PATH'] : Dir.pwd
8
8
  end
9
9
 
10
- unless ENV['BASE_PATH']
11
- ENV['BASE_PATH'] = OLDLOCATION
12
- end
10
+ # unless ENV['BASE_PATH']
11
+ # ENV['BASE_PATH'] = OLDLOCATION
12
+ # end
13
13
 
14
14
  SPECIAL = true
15
15
  SIX_ADMIN = true
@@ -19,7 +19,7 @@ case RUBY_VERSION
19
19
  end
20
20
 
21
21
  module SixUpdaterWeb
22
- VERSION = "0.13.3"
22
+ VERSION = "0.13.4"
23
23
  COMPONENT = "six-updater-web"
24
24
 
25
25
  DEFAULT_IP = "127.0.0.1" unless defined?(DEFAULT_IP)
@@ -30,7 +30,7 @@ module SixUpdaterWeb
30
30
  LOCAL_URL = "http://#{SIX_HOST == "0.0.0.0" ? DEFAULT_IP : SIX_HOST}:#{SIX_PORT}"
31
31
 
32
32
  bpath = if ENV['BASE_PATH']
33
- OLDLOCATION = "#{ENV['BASE_PATH']}" unless defined?(OLDLOCATION)
33
+ OLDLOCATION = "#{ENV['BASE_PATH']}" unless defined?(OLDLOCATION)
34
34
  "#{ENV['BASE_PATH']}"
35
35
  elsif defined?(OLDLOCATION)
36
36
  OLDLOCATION
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 13
8
- - 3
9
- version: 0.13.3
8
+ - 4
9
+ version: 0.13.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy