six-updater-web 0.12.3 → 0.12.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.12.3'
10
+ s.version = '0.12.4'
11
11
  s.has_rdoc = false
12
12
  #s.extra_rdoc_files = ['README', 'LICENSE']
13
13
  s.summary = 'Your summary here'
@@ -17,7 +17,7 @@ spec = Gem::Specification.new do |s|
17
17
  s.files = %w(LICENSE README Rakefile) + Dir.glob("{bin,spec}/**/*") + Dir.glob("lib/**/*")
18
18
  s.require_path = "lib"
19
19
  s.bindir = "bin"
20
- s.executables = ['six-updater-web']
20
+ s.executables = ['six-updater-web', 'six-updater-web-rake']
21
21
  s.add_dependency('uuidtools', '>= 2.0.0')
22
22
  s.add_dependency('six-updater', '>= 0.16.0')
23
23
  s.add_dependency('rails', '2.3.5')
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/ruby
2
+ # encoding: utf-8
3
+ require 'rake'
4
+
5
+ begin
6
+ load '_rake.rb'
7
+ rescue => e
8
+ puts e.class, e.message, e.backtrace.join("\n")
9
+ begin
10
+ require 'fileutils'
11
+ path = File.join(SixUpdaterWeb::DATA_PATH, 'logs')
12
+ FileUtils.mkdir_p path unless File.exists?(path)
13
+ File.open(File.join(path, "six-updater-web-error.log"), 'w') {|f| f.puts e.class, e.message, e.backtrace.join("\n")}
14
+ rescue
15
+ puts "ERROR: #{$!}"
16
+ end
17
+ sleep 10
18
+ end
@@ -0,0 +1,19 @@
1
+ require 'common'
2
+
3
+ Dir.chdir(File.dirname(__FILE__)) do
4
+ load 'Rakefile'
5
+ #begin
6
+ # require 'rake'
7
+ # rescue LoadError
8
+ # require 'rubygems'
9
+ # require 'rake'
10
+ # end
11
+ #Rake.application.run
12
+
13
+ # TODO: This doesn't load the Rails initializer always, thus can be using wrong db or whatever (at least for db:create)
14
+ arg = ARGV.clone
15
+ ARGV.clear
16
+ arg.each do |entry|
17
+ Rake.application[entry].invoke
18
+ end
19
+ end
@@ -0,0 +1,44 @@
1
+ module SixUpdaterWeb
2
+ DEFAULT_PORT = 16333
3
+ DEFAULT_IP = '127.0.0.1'
4
+ OLDLOCATION = if defined?(TAR2RUBYSCRIPT)
5
+ oldlocation
6
+ else
7
+ Dir.pwd
8
+ end
9
+ SPECIAL = true
10
+
11
+ SIX_ADMIN = true
12
+ end
13
+
14
+ case RUBY_PLATFORM
15
+ when /-mingw32$/, /-mswin32$/
16
+ begin
17
+ %x[chcp]
18
+ rescue
19
+ puts "WARNING: chcp was not found. If the web-client doesn't start properly, "
20
+ puts "Please follow these steps:"
21
+ puts
22
+ f = File.join(ENV['WINDIR'], 'system32', 'chcp.com').gsub!("/", "\\")
23
+ path = SixUpdaterWeb::OLDLOCATION
24
+ nf = File.join(path, "tools", "ruby", "bin").gsub!("/", "\\")
25
+ puts "Copy #{f} to #{nf}"
26
+ puts "And rename the copy to chcp.EXE. Then restart this program"
27
+ puts
28
+ puts "More info, at: http://dev-heaven.net/wiki/six-arma-updater/Six_Updater_Suite#Known-Issues"
29
+ sleep 10
30
+ end
31
+ end
32
+
33
+ begin
34
+ # If env var VERSION exists and is a number, and no VERSION= argument is passed, migration will likely fail.
35
+ # move original env VERSION value to OS_VERSION, in case it's needed, and reset ENV["VERSION"].
36
+ if not ARGV.any?{ |arg| /^VERSION=/i.match(arg) }
37
+ ENV["OS_VERSION"] = ENV["VERSION"]
38
+ ENV["VERSION"] = nil
39
+ end
40
+ rescue
41
+ puts "ERROR: #{$!}"
42
+ end
43
+
44
+ ENV["RAILS_ENV"] = "production"
@@ -10,7 +10,7 @@ end
10
10
  require 'open3'
11
11
 
12
12
  module SixUpdaterWeb
13
- VERSION = "0.12.3"
13
+ VERSION = "0.12.4"
14
14
 
15
15
  COMPONENT = "six-updater-web"
16
16
  SIX_PORT = 3000 unless defined?(SIX_PORT)
@@ -120,12 +120,13 @@ module SixUpdaterWeb
120
120
  def after_initialize
121
121
  if defined?(OLDLOCATION) #(TAR2RUBYSCRIPT) #|| RUBYSCRIPT2EXE.is_compiling?
122
122
  # Migrate the database to current version if required
123
- Six::Dbmanager.migrate_data
124
- Six::Dbmanager.migrate_system
123
+ #Six::Dbmanager.migrate_data
124
+ #Six::Dbmanager.migrate_system
125
125
 
126
126
  if defined?(SPECIAL)
127
127
  case RUBY_PLATFORM
128
128
  when /-mingw32$/, /-mswin32$/
129
+ return unless defined?(OPEN_BROWSER)
129
130
  file_to_use = "#{LOCAL_URL}:#{SIX_PORT}/main"
130
131
  arguments = nil
131
132
  directory = nil
@@ -1,28 +1,14 @@
1
1
  # $stdout, $stderr = # File or String in Memory (any cleanup measures?)
2
2
  #require 'RubyGems'
3
3
 
4
- module SixUpdaterWeb
5
- DEFAULT_PORT = 16333
6
- DEFAULT_IP = '127.0.0.1'
7
- OLDLOCATION = if defined?(TAR2RUBYSCRIPT)
8
- oldlocation
9
- else
10
- Dir.pwd
11
- end
12
- SPECIAL = true
13
-
4
+ puts "Starting the web client... please be patient..."
5
+ puts "This window needs to remain running during GUI operations"
6
+ puts ""
14
7
 
15
- # TODO: TEMPORARY UNTIL GOLDBERG DATAMIGRATIONS ARE VALIDATED
16
- SIX_ADMIN = true
17
- =begin
18
- if ARGV.include?("--admin")
19
- ARGV =- ["--admin"]
20
- true
21
- else
22
- false
23
- end
24
- =end
8
+ require 'common'
25
9
 
10
+ module SixUpdaterWeb
11
+ OPEN_BROWSER = true
26
12
  SIX_PORT = if ARGV.to_s[/--port=([0-9]*)|-p/]
27
13
  $1
28
14
  else
@@ -35,40 +21,13 @@ module SixUpdaterWeb
35
21
  end
36
22
  end
37
23
 
38
- puts "Starting the web client... please be patient..."
39
- puts "This window needs to remain running during GUI operations"
40
-
41
- case RUBY_PLATFORM
42
- when /-mingw32$/, /-mswin32$/
43
- begin
44
- %x[chcp]
45
- rescue
46
- puts "WARNING: chcp was not found. If the web-client doesn't start properly, "
47
- puts "Please follow these steps:"
48
- puts
49
- f = File.join(ENV['WINDIR'], 'system32', 'chcp.com').gsub!("/", "\\")
50
- path = SixUpdaterWeb::OLDLOCATION
51
- nf = File.join(path, "tools", "ruby", "bin").gsub!("/", "\\")
52
- puts "Copy #{f} to #{nf}"
53
- puts "And rename the copy to chcp.EXE. Then restart this program"
54
- puts
55
- puts "More info, at: http://dev-heaven.net/wiki/six-arma-updater/Six_Updater_Suite#Known-Issues"
56
- sleep 10
57
- end
58
- end
24
+ puts "Checking for required Database migrations..."
59
25
 
60
- begin
61
- # If env var VERSION exists and is a number, and no VERSION= argument is passed, migration will likely fail.
62
- # move original env VERSION value to OS_VERSION, in case it's needed, and reset ENV["VERSION"].
63
- if not ARGV.any?{ |arg| /^VERSION=/i.match(arg) }
64
- ENV["OS_VERSION"] = ENV["VERSION"]
65
- ENV["VERSION"] = nil
66
- end
67
- rescue
68
- puts "ERROR: #{$!}"
26
+ Dir.chdir(File.dirname(__FILE__)) do
27
+ system "ruby -rubygems \"_rake.rb\" db:migrate" # goldberg:migrate
69
28
  end
70
29
 
71
- ENV["RAILS_ENV"] = "production"
30
+ puts ""
72
31
 
73
32
  # Kick off Rails
74
33
  load 'script/server'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 12
8
- - 3
9
- version: 0.12.3
8
+ - 4
9
+ version: 0.12.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy
@@ -91,6 +91,7 @@ description: Your summary here
91
91
  email: sb@dev-heaven.net
92
92
  executables:
93
93
  - six-updater-web
94
+ - six-updater-web-rake
94
95
  extensions: []
95
96
 
96
97
  extra_rdoc_files: []
@@ -100,6 +101,7 @@ files:
100
101
  - README
101
102
  - Rakefile
102
103
  - bin/six-updater-web
104
+ - bin/six-updater-web-rake
103
105
  - lib/app/controllers/actions_controller.rb
104
106
  - lib/app/controllers/application_controller.rb
105
107
  - lib/app/controllers/appsettings_controller.rb
@@ -156,6 +158,7 @@ files:
156
158
  - lib/app/views/mods/imp.haml
157
159
  - lib/app/views/Repositories/imp.erb
158
160
  - lib/app/views/servers/imp.erb
161
+ - lib/common.rb
159
162
  - lib/config/boot.rb
160
163
  - lib/config/database.yml
161
164
  - lib/config/database.yml.sample
@@ -846,6 +849,7 @@ files:
846
849
  - lib/vendor/plugins/six-query/lib/six/query/gamespy_master.rb
847
850
  - lib/vendor/plugins/six-query/lib/six/query.rb
848
851
  - lib/vendor/plugins/six-query/Rakefile
852
+ - lib/_rake.rb
849
853
  has_rdoc: true
850
854
  homepage:
851
855
  licenses: []