six-updater-web 0.14.7 → 0.14.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/six-updater-web/config/six-updater-web.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090826185820_create_repositories.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090826185836_create_mods.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090826185847_create_servers.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090826185930_create_appsettings.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090826190008_create_sixconfigs.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090829165545_create_actions.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090916174120_create_logs.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090916174333_create_logsessions.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090921092253_create_sessions.rb +1 -1
- data/lib/six-updater-web/db/migrate/20090928163554_create_system_settings.rb +1 -1
- data/lib/six-updater-web/db/migrate/20100327164004_create_queryservers.rb +1 -1
- data/lib/six-updater-web/db/migrate/20100425121901_create_networks.rb +1 -1
- data/lib/six-updater-web/db/schema.rb +1 -2
- data/lib/six-updater-web/init.rb +31 -11
- metadata +2 -2
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ class CreateNetworks < ActiveRecord::Migration
|
|
10
10
|
t.boolean :disabled
|
11
11
|
t.integer :priority
|
12
12
|
|
13
|
-
t.timestamps :
|
13
|
+
t.timestamps :lock_version => false
|
14
14
|
end
|
15
15
|
six_join(["mod", "network"], :up, true)
|
16
16
|
add_column :repositories, :network_id, :string, :limit => 36
|
@@ -210,7 +210,6 @@ ActiveRecord::Schema.define(:version => 20100425143140) do
|
|
210
210
|
t.boolean "disabled"
|
211
211
|
t.integer "priority"
|
212
212
|
t.datetime "created_at"
|
213
|
-
t.datetime "deleted_at"
|
214
213
|
t.datetime "updated_at"
|
215
214
|
end
|
216
215
|
|
@@ -223,7 +222,7 @@ ActiveRecord::Schema.define(:version => 20100425143140) do
|
|
223
222
|
t.string "name"
|
224
223
|
t.string "ip"
|
225
224
|
t.integer "port"
|
226
|
-
t.integer "failures"
|
225
|
+
t.integer "failures", :default => 0
|
227
226
|
t.datetime "created_at"
|
228
227
|
t.datetime "updated_at"
|
229
228
|
t.text "mod", :limit => 1048576
|
data/lib/six-updater-web/init.rb
CHANGED
@@ -8,17 +8,23 @@ module SixUpdaterWeb
|
|
8
8
|
|
9
9
|
OPEN_BROWSER = true
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
SIX_HOST =
|
14
|
-
|
11
|
+
# Process commandline args to setup host and port
|
12
|
+
argvs = ARGV.join(" ")
|
13
|
+
SIX_HOST = case argvs
|
14
|
+
when /-b *(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/
|
15
|
+
$1
|
16
|
+
when /--bindi?n?g?=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/
|
17
|
+
$1
|
15
18
|
else
|
16
19
|
ARGV << "--binding=#{DEFAULT_IP}"
|
17
20
|
DEFAULT_IP
|
18
21
|
end
|
19
22
|
|
20
|
-
SIX_PORT =
|
21
|
-
|
23
|
+
SIX_PORT = case argvs
|
24
|
+
when /--port=([0-9]+)/
|
25
|
+
$1
|
26
|
+
when /-p *([0-9]+)/
|
27
|
+
$1
|
22
28
|
else
|
23
29
|
ARGV << "--port=#{DEFAULT_PORT}"
|
24
30
|
DEFAULT_PORT
|
@@ -37,10 +43,12 @@ module SixUpdaterWeb
|
|
37
43
|
puts "Database Missing, creating and loading default schema and system data..."
|
38
44
|
File.open(db, 'w') {|f| }
|
39
45
|
Dir.chdir(File.dirname(__FILE__)) do
|
40
|
-
system "ruby -rubygems \"_rake.rb\" db:schema:
|
46
|
+
system "ruby -rubygems \"_rake.rb\" db:migrate goldberg:migrate db:schema:dump sync:system"
|
41
47
|
end
|
42
48
|
#FileUtils.cp(File.join(BASE_PATH, "db", "production.sqlite3"), db)
|
49
|
+
return true
|
43
50
|
end
|
51
|
+
false
|
44
52
|
end
|
45
53
|
end
|
46
54
|
|
@@ -52,12 +60,24 @@ puts "This window needs to remain running during GUI operations"
|
|
52
60
|
puts ""
|
53
61
|
|
54
62
|
#if defined?(SixUpdaterWeb::OLDLOCATION)
|
55
|
-
SixUpdaterWeb.prepare_data_path
|
63
|
+
done = SixUpdaterWeb.prepare_data_path
|
56
64
|
#end
|
57
65
|
|
58
|
-
|
59
|
-
|
60
|
-
|
66
|
+
unless done
|
67
|
+
=begin
|
68
|
+
# Fix older db's. TODO: convert into code
|
69
|
+
begin
|
70
|
+
if "SELECT * FROM plugin_schema_migrations WHERE plugin_name = 'goldberg'"
|
71
|
+
[1, 2, 3, 4].each {|i| "INSERT INTO plugin_schema_migrations VALUES('goldberg', '#{i}')" }
|
72
|
+
end
|
73
|
+
rescue => e
|
74
|
+
puts "Something went wrong processing plugin_schema_migrations. #{e.class} #{e.message}: #{e.backtrace.join("\n")}"
|
75
|
+
end
|
76
|
+
=end
|
77
|
+
puts "Checking for required Database migrations..."
|
78
|
+
Dir.chdir(File.dirname(__FILE__)) do
|
79
|
+
system "ruby -rubygems \"_rake.rb\" db:migrate"
|
80
|
+
end
|
61
81
|
end
|
62
82
|
|
63
83
|
# Check for required data updates?
|