side_do 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +61 -0
- data/README.md +36 -0
- data/README.rdoc +6 -0
- data/Rakefile +44 -0
- data/bin/game.rb +109 -0
- data/bin/side_do +74 -0
- data/bin/side_do.rc.yaml +25 -0
- data/features/side_do.feature +8 -0
- data/features/step_definitions/side_do_steps.rb +6 -0
- data/features/support/env.rb +15 -0
- data/lib/side_do/version.rb +3 -0
- data/lib/side_do.rb +4 -0
- data/man/side_do.1 +61 -0
- data/man/side_do.1.html +124 -0
- data/man/side_do.1.ronn +36 -0
- data/side_do.gemspec +24 -0
- data/side_do.rdoc +5 -0
- data/test/default_test.rb +14 -0
- data/test/test_helper.rb +9 -0
- metadata +158 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MzNlNmNhZmUxMDkxZGYxMTJlYzkzOGQxMWNjMjY0MGYxN2FmOWU1Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MmYyYjA2YTVmZjRmNWVhNTczZjllMTU5MzZjOWNhODc0MzA2Y2E2OQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjNkMDc4MDljYzNmZDAyNGI5NzUxYmEwZDViNzhmY2VkM2EzYmRlNGU4ODZj
|
10
|
+
YTRlNTljNTU2Njg1ZjI0ZjhkYzUwNjZlZTBhMTdkMzhiMWQxYzg5ZmRiMDI4
|
11
|
+
ODZjOWNiOWU4ZTA4YzYxYjFiMzg3YjgzYTFiN2EyYzk0YmYzMDc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OGQxYjMwYmEzNjMzY2RmMWI2MmQ2NTE2ZDZkNWJiZGNkNzQ0MTdkNTFjM2Jh
|
14
|
+
ZGMzMTNhYzM5NWM2NDE2M2YwNTE5MzFjZDA3NTRjM2IxZDUzZjIwNmQyMDAz
|
15
|
+
NzFiOWQ4YjIwMDU5MmIyYWQwNDcyZTkwMjIwM2VmYTU1NmQ1YmU=
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/pkg/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
side_do (0.0.4)
|
5
|
+
activerecord
|
6
|
+
gli (= 2.9.0)
|
7
|
+
mysql2
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activemodel (3.2.13)
|
13
|
+
activesupport (= 3.2.13)
|
14
|
+
builder (~> 3.0.0)
|
15
|
+
activerecord (3.2.13)
|
16
|
+
activemodel (= 3.2.13)
|
17
|
+
activesupport (= 3.2.13)
|
18
|
+
arel (~> 3.0.2)
|
19
|
+
tzinfo (~> 0.3.29)
|
20
|
+
activesupport (3.2.13)
|
21
|
+
i18n (= 0.6.1)
|
22
|
+
multi_json (~> 1.0)
|
23
|
+
arel (3.0.3)
|
24
|
+
aruba (0.5.4)
|
25
|
+
childprocess (>= 0.3.6)
|
26
|
+
cucumber (>= 1.1.1)
|
27
|
+
rspec-expectations (>= 2.7.0)
|
28
|
+
builder (3.0.4)
|
29
|
+
childprocess (0.3.9)
|
30
|
+
ffi (~> 1.0, >= 1.0.11)
|
31
|
+
cucumber (1.3.14)
|
32
|
+
builder (>= 2.1.2)
|
33
|
+
diff-lcs (>= 1.1.3)
|
34
|
+
gherkin (~> 2.12)
|
35
|
+
multi_json (>= 1.7.5, < 2.0)
|
36
|
+
multi_test (>= 0.1.1)
|
37
|
+
diff-lcs (1.2.5)
|
38
|
+
ffi (1.9.3)
|
39
|
+
gherkin (2.12.2)
|
40
|
+
multi_json (~> 1.3)
|
41
|
+
gli (2.9.0)
|
42
|
+
i18n (0.6.1)
|
43
|
+
json (1.8.1)
|
44
|
+
multi_json (1.9.2)
|
45
|
+
multi_test (0.1.1)
|
46
|
+
mysql2 (0.3.14)
|
47
|
+
rake (10.2.2)
|
48
|
+
rdoc (3.12.2)
|
49
|
+
json (~> 1.4)
|
50
|
+
rspec-expectations (2.14.4)
|
51
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
52
|
+
tzinfo (0.3.39)
|
53
|
+
|
54
|
+
PLATFORMS
|
55
|
+
ruby
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
aruba
|
59
|
+
rake
|
60
|
+
rdoc
|
61
|
+
side_do!
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
side_do -- a awesome tool to release game for sonkwo
|
2
|
+
=====================================================
|
3
|
+
## DESCRIPTION
|
4
|
+
**Side Do** is a simple command-line tool for making game seeds, uploading game seeds to remote servers and so on. It does so safely and quietly, it's perfect for use with cron as a cron work.
|
5
|
+
|
6
|
+
By default, `Side Do` check all games nees to be release and pack them all one by one. `Side Do` allow us specify the
|
7
|
+
game id to just do with the exact game by -g or --game_id, Before this you can use **side_do list** to list all the game and pick a game_id to do with.
|
8
|
+
|
9
|
+
`Side Do` is also easy to configure either by yml file or command, this will be explained later.
|
10
|
+
Finally, `Side Do` allow you to extend it with ruby.
|
11
|
+
|
12
|
+
## OPTIONS
|
13
|
+
* `-a`, `--all`:
|
14
|
+
do with all games. this can be omitted.
|
15
|
+
|
16
|
+
## EXAMPLES
|
17
|
+
When you created a pre_release job on sonkwo admin web page.
|
18
|
+
$ side_do pack
|
19
|
+
this will pack all games need to be released.
|
20
|
+
|
21
|
+
Perhaps you want some of them to be packed first, or you want do them both at same time, you can first pack the game by specify its id like this:
|
22
|
+
|
23
|
+
$ side_do list
|
24
|
+
# game_id game_name status
|
25
|
+
# 123 game_1 to_be_packed
|
26
|
+
# 321 game_2 to_be_packed
|
27
|
+
|
28
|
+
$ side_do pack 321
|
29
|
+
#open another dos
|
30
|
+
$ side_do pack 123
|
31
|
+
|
32
|
+
after packing games, you may want upload game seed to remote server.
|
33
|
+
|
34
|
+
$ side_do upload 321 -r beijing
|
35
|
+
|
36
|
+
this will upload the game to beijing remote server,if you omit the -r option, it will upload to all sonkwo download servers.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rubygems/package_task'
|
4
|
+
require 'rdoc/task'
|
5
|
+
require 'cucumber'
|
6
|
+
require 'cucumber/rake/task'
|
7
|
+
Rake::RDocTask.new do |rd|
|
8
|
+
rd.main = "README.rdoc"
|
9
|
+
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
10
|
+
rd.title = 'Side Do Manual'
|
11
|
+
end
|
12
|
+
|
13
|
+
spec = eval(File.read('side_do.gemspec'))
|
14
|
+
|
15
|
+
Gem::PackageTask.new(spec) do |pkg|
|
16
|
+
end
|
17
|
+
CUKE_RESULTS = 'results.html'
|
18
|
+
CLEAN << CUKE_RESULTS
|
19
|
+
desc 'Run features'
|
20
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
21
|
+
opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
|
22
|
+
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
|
23
|
+
t.cucumber_opts = opts
|
24
|
+
t.fork = false
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Run features tagged as work-in-progress (@wip)'
|
28
|
+
Cucumber::Rake::Task.new('features:wip') do |t|
|
29
|
+
tag_opts = ' --tags ~@pending'
|
30
|
+
tag_opts = ' --tags @wip'
|
31
|
+
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
|
32
|
+
t.fork = false
|
33
|
+
end
|
34
|
+
|
35
|
+
task :cucumber => :features
|
36
|
+
task 'cucumber:wip' => 'features:wip'
|
37
|
+
task :wip => 'features:wip'
|
38
|
+
require 'rake/testtask'
|
39
|
+
Rake::TestTask.new do |t|
|
40
|
+
t.libs << "test"
|
41
|
+
t.test_files = FileList['test/*_test.rb']
|
42
|
+
end
|
43
|
+
|
44
|
+
task :default => [:test,:features]
|
data/bin/game.rb
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'mysql2'
|
3
|
+
require 'open3'
|
4
|
+
yml_path = File.join(ENV['HOME'], '.side_do.rc.yaml')
|
5
|
+
raise "could not find your config file in #{yml_path}, please make it first" unless File.exist?(yml_path)
|
6
|
+
|
7
|
+
$config = YAML.load_file(yml_path)
|
8
|
+
ActiveRecord::Base.establish_connection(
|
9
|
+
adapter: $config[:adapter],
|
10
|
+
host: $config[:host],
|
11
|
+
database: $config[:database],
|
12
|
+
username: $config[:username],
|
13
|
+
password: $config[:password]
|
14
|
+
)
|
15
|
+
|
16
|
+
class Game < ActiveRecord::Base
|
17
|
+
has_many :game_files
|
18
|
+
end
|
19
|
+
|
20
|
+
class GameFile < ActiveRecord::Base
|
21
|
+
STATUS_NEW = 0
|
22
|
+
STATUS_TO_VERIFY = 1
|
23
|
+
STATUS_VALIDATED = 2
|
24
|
+
STATUS_REJECTED = 3
|
25
|
+
STATUS_CANCELED = 4
|
26
|
+
STATUS_ROLLBACKED = 5
|
27
|
+
|
28
|
+
# Associations
|
29
|
+
belongs_to :game
|
30
|
+
scope :status_new, -> {where(status: STATUS_NEW)}
|
31
|
+
scope :status_to_verify, -> {where(status: STATUS_TO_VERIFY)}
|
32
|
+
scope :status_validated, -> {where(status: STATUS_VALIDATED)}
|
33
|
+
|
34
|
+
def make_seed
|
35
|
+
raise 'this game have not been preleased' if self.status != STATUS_NEW
|
36
|
+
puts "-#{$config[:files_root_dir]}---- Start PreReleaseWorker"
|
37
|
+
err = nil
|
38
|
+
|
39
|
+
self.process_start_time = Time.now
|
40
|
+
|
41
|
+
# release tool参数:<game_id, game_name, game_dir, patch_ver, release_dir, parent_id, parent_name, work_dir>
|
42
|
+
game_id = self.game_id
|
43
|
+
game = self.game
|
44
|
+
game_name = game.dir_name
|
45
|
+
parent_cmd = nil
|
46
|
+
|
47
|
+
if game.parent_id && game.parent_id.to_i != 0
|
48
|
+
parent_game = Game.find(game.parent_id)
|
49
|
+
parent_cmd = "--parent_id=#{game.parent_id} --parent_name=\"#{parent_game.dir_name}\""
|
50
|
+
end
|
51
|
+
|
52
|
+
puts "Processing game #{game_id} - #{game.dir_name}..."
|
53
|
+
release_tool_path = File.expand_path File.dirname(__FILE__) + '/DownloadReleaseTool.exe'
|
54
|
+
cmd = "#{$config[:release_tool]} --game_id=#{game_id} --game_name=\"#{game_name}\" --game_dir=\"#{game_name}\" --patch_ver=#{self.patch_ver} --release_dir=\"#{self.file_dir}\" --work_dir=\"#{$config[:files_root_dir]}\" #{parent_cmd}"
|
55
|
+
puts cmd
|
56
|
+
output = ""
|
57
|
+
stdin, stdoe = Open3.popen2e("#{cmd}")
|
58
|
+
stdin.close
|
59
|
+
|
60
|
+
while !stdoe.closed?
|
61
|
+
line = stdoe.gets
|
62
|
+
break unless line
|
63
|
+
puts line
|
64
|
+
output += line
|
65
|
+
end
|
66
|
+
|
67
|
+
stdoe.close unless stdoe.closed?
|
68
|
+
|
69
|
+
msg = JSON.parse(output)
|
70
|
+
release_ret = msg["result"]
|
71
|
+
release_digest = msg["digest"]
|
72
|
+
err_ret = msg["err"]
|
73
|
+
|
74
|
+
if release_ret
|
75
|
+
puts "Game seed successfully made..."
|
76
|
+
puts "verifying the digest..."
|
77
|
+
seed_content_path = nil
|
78
|
+
if self.file_dir == "initial"
|
79
|
+
seed_content_path = $config[:file_meta_dir] + "/#{game.dir_name}.mf"
|
80
|
+
else
|
81
|
+
seed_content_path = $config[:file_meta_dir] + "/#{game.dir_name}_patch_#{self.patch_ver}.mf"
|
82
|
+
end
|
83
|
+
|
84
|
+
seed_content = nil
|
85
|
+
File.open(seed_content_path, "rb"){|s| seed_content = s.read}
|
86
|
+
|
87
|
+
file_size = msg["size"]
|
88
|
+
real_digest = Digest::SHA1.hexdigest(seed_content)
|
89
|
+
|
90
|
+
if release_digest == real_digest
|
91
|
+
ActiveRecord::Base.transaction do
|
92
|
+
self.seed_content = seed_content
|
93
|
+
self.seed_digest = real_digest
|
94
|
+
self.file_size = file_size
|
95
|
+
self.process_finish_time = Time.now
|
96
|
+
self.status = STATUS_TO_VERIFY
|
97
|
+
self.save!
|
98
|
+
end
|
99
|
+
puts "Success!"
|
100
|
+
else
|
101
|
+
err = "Failed, digest is not match."
|
102
|
+
raise err
|
103
|
+
end
|
104
|
+
else
|
105
|
+
err = err_ret || output
|
106
|
+
raise err
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
data/bin/side_do
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require_relative 'game'
|
3
|
+
require 'gli'
|
4
|
+
include GLI::App
|
5
|
+
program_desc 'Side Do is a awesom tool to handle with sonkwo jobs, as release, upload, encrypt, and other background jobs'
|
6
|
+
|
7
|
+
long_desc "make game seeds, by default, pack all game file on status status_new"
|
8
|
+
arg_name 'game_file_id'
|
9
|
+
command :pack do |c|
|
10
|
+
c.action do |global_options,options,args|
|
11
|
+
if args.empty?
|
12
|
+
game_files = GameFile.status_new
|
13
|
+
else
|
14
|
+
game_files = GameFile.where('id in (?)', args)
|
15
|
+
end
|
16
|
+
game_files.each{|g| g.make_seed}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
desc 'list game files'
|
21
|
+
command :list do |c|
|
22
|
+
c.desc 'specify the status of game_file to list'
|
23
|
+
c.arg_name 'status name'
|
24
|
+
c.default_value 'status_new'
|
25
|
+
c.flag [:s, :status]
|
26
|
+
c.desc 'specify how many items will show in the list'
|
27
|
+
c.arg_name 'number'
|
28
|
+
c.default_value 5
|
29
|
+
c.flag [:n, :number]
|
30
|
+
c.action do |global_options,options,args|
|
31
|
+
status = options[:s]
|
32
|
+
number = options[:n] || 5
|
33
|
+
if status
|
34
|
+
game_files = GameFile.send(status.to_sym).order('created_at DESC').limit(number)
|
35
|
+
else
|
36
|
+
game_files = GameFile.status_new.order('created_at DESC').limit(number)
|
37
|
+
end
|
38
|
+
|
39
|
+
game_files.each do |game_file|
|
40
|
+
p "#{game_file.id} #{game_file.game.alias_name} #{game_file.created_at}"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
desc 'Describe upload here'
|
46
|
+
arg_name 'Describe arguments to upload here'
|
47
|
+
command :upload do |c|
|
48
|
+
c.action do |global_options,options,args|
|
49
|
+
puts "upload command ran"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
pre do |global,command,options,args|
|
54
|
+
# Pre logic here
|
55
|
+
# Return true to proceed; false to abort and not call the
|
56
|
+
# chosen command
|
57
|
+
# Use skips_pre before a command to skip this block
|
58
|
+
# on that command only
|
59
|
+
true
|
60
|
+
end
|
61
|
+
|
62
|
+
post do |global,command,options,args|
|
63
|
+
# Post logic here
|
64
|
+
# Use skips_post before a command to skip this
|
65
|
+
# block on that command only
|
66
|
+
end
|
67
|
+
|
68
|
+
on_error do |exception|
|
69
|
+
# Error logic here
|
70
|
+
# return false to skip default error handling
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
exit run(ARGV)
|
data/bin/side_do.rc.yaml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
:adapter: mysql2
|
3
|
+
:host: 'your host'
|
4
|
+
:port: 3306
|
5
|
+
:database: example_database
|
6
|
+
:username: username
|
7
|
+
:password: password
|
8
|
+
:release_tool: "F:/Bin_ReleaseTool/DownloadReleaseTool.exe"
|
9
|
+
:files_root_dir: "C:/P2PDownload"
|
10
|
+
:file_meta_dir: "C:/P2PDownload/Meta"
|
11
|
+
g: nil
|
12
|
+
:g: nil
|
13
|
+
game_id: nil
|
14
|
+
:game_id: nil
|
15
|
+
a: false
|
16
|
+
:a: false
|
17
|
+
auto: false
|
18
|
+
:auto: false
|
19
|
+
help: false
|
20
|
+
:help: false
|
21
|
+
commands:
|
22
|
+
:_doc: {}
|
23
|
+
:pack: {}
|
24
|
+
:upload: {}
|
25
|
+
:list: {}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'aruba/cucumber'
|
2
|
+
|
3
|
+
ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
|
4
|
+
LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
|
5
|
+
|
6
|
+
Before do
|
7
|
+
# Using "announce" causes massive warnings on 1.9.2
|
8
|
+
@puts = true
|
9
|
+
@original_rubylib = ENV['RUBYLIB']
|
10
|
+
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
After do
|
14
|
+
ENV['RUBYLIB'] = @original_rubylib
|
15
|
+
end
|
data/lib/side_do.rb
ADDED
data/man/side_do.1
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "SIDE_DO" "1" "April 2014" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBside_do\fR \- a awesome tool to release game for sonkwo
|
8
|
+
.
|
9
|
+
.SH "DESCRIPTION"
|
10
|
+
\fBSide Do\fR is a simple command\-line tool for making game seeds, uploading game seeds to remote servers and so on\. It does so safely and quietly, it\'s perfect for use with cron as a cron work\.
|
11
|
+
.
|
12
|
+
.P
|
13
|
+
By default, \fBSide Do\fR check all games nees to be release and pack them all one by one\. \fBSide Do\fR allow us specify the game id to just do with the exact game by \-g or \-\-game_id, Before this you can use \fBside_do list\fR to list all the game and pick a game_id to do with\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
\fBSide Do\fR is also easy to configure either by yml file or command, this will be explained later\. Finally, \fBSide Do\fR allow you to extend it with ruby\.
|
17
|
+
.
|
18
|
+
.SH "OPTIONS"
|
19
|
+
.
|
20
|
+
.TP
|
21
|
+
\fB\-a\fR, \fB\-\-all\fR
|
22
|
+
do with all games\. this can be omitted\.
|
23
|
+
.
|
24
|
+
.SH "EXAMPLES"
|
25
|
+
When you created a pre_release job on sonkwo admin web page\. $ side_do pack this will pack all games need to be released\.
|
26
|
+
.
|
27
|
+
.P
|
28
|
+
Perhaps you want some of them to be packed first, or you want do them both at same time, you can first pack the game by specify its id like this:
|
29
|
+
.
|
30
|
+
.IP "" 4
|
31
|
+
.
|
32
|
+
.nf
|
33
|
+
|
34
|
+
$ side_do list
|
35
|
+
# game_id game_name status
|
36
|
+
# 123 game_1 to_be_packed
|
37
|
+
# 321 game_2 to_be_packed
|
38
|
+
|
39
|
+
$ side_do pack 321
|
40
|
+
#open another dos
|
41
|
+
$ side_do pack 123
|
42
|
+
.
|
43
|
+
.fi
|
44
|
+
.
|
45
|
+
.IP "" 0
|
46
|
+
.
|
47
|
+
.P
|
48
|
+
after packing games, you may want upload game seed to remote server\.
|
49
|
+
.
|
50
|
+
.IP "" 4
|
51
|
+
.
|
52
|
+
.nf
|
53
|
+
|
54
|
+
$ side_do upload 321 \-r beijing
|
55
|
+
|
56
|
+
this will upload the game to beijing remote server,if you omit the \-r option, it will upload to all sonkwo download servers\.
|
57
|
+
.
|
58
|
+
.fi
|
59
|
+
.
|
60
|
+
.IP "" 0
|
61
|
+
|
data/man/side_do.1.html
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
+
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
+
<title>side_do(1) - a awesome tool to release game for sonkwo</title>
|
7
|
+
<style type='text/css' media='all'>
|
8
|
+
/* style: man */
|
9
|
+
body#manpage {margin:0}
|
10
|
+
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
+
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
+
.mp h2 {margin:10px 0 0 0}
|
13
|
+
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
+
.mp h3 {margin:0 0 0 4ex}
|
15
|
+
.mp dt {margin:0;clear:left}
|
16
|
+
.mp dt.flush {float:left;width:8ex}
|
17
|
+
.mp dd {margin:0 0 0 9ex}
|
18
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
+
.mp pre {margin-bottom:20px}
|
20
|
+
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
+
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
+
.mp img {display:block;margin:auto}
|
23
|
+
.mp h1.man-title {display:none}
|
24
|
+
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
+
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
+
.mp h1 {font-size:20px;line-height:2}
|
27
|
+
.mp {text-align:justify;background:#fff}
|
28
|
+
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
+
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
+
.mp u {text-decoration:underline}
|
31
|
+
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
+
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
+
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
+
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
+
.mp pre {padding:0 4ex}
|
36
|
+
.mp pre code {font-weight:normal;color:#434241}
|
37
|
+
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
+
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
+
ol.man-decor {width:100%}
|
40
|
+
ol.man-decor li.tl {text-align:left}
|
41
|
+
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
+
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
+
</style>
|
44
|
+
</head>
|
45
|
+
<!--
|
46
|
+
The following styles are deprecated and will be removed at some point:
|
47
|
+
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
48
|
+
|
49
|
+
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
50
|
+
.man-navigation should be used instead.
|
51
|
+
-->
|
52
|
+
<body id='manpage'>
|
53
|
+
<div class='mp' id='man'>
|
54
|
+
|
55
|
+
<div class='man-navigation' style='display:none'>
|
56
|
+
<a href="#NAME">NAME</a>
|
57
|
+
<a href="#DESCRIPTION">DESCRIPTION</a>
|
58
|
+
<a href="#OPTIONS">OPTIONS</a>
|
59
|
+
<a href="#EXAMPLES">EXAMPLES</a>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<ol class='man-decor man-head man head'>
|
63
|
+
<li class='tl'>side_do(1)</li>
|
64
|
+
<li class='tc'></li>
|
65
|
+
<li class='tr'>side_do(1)</li>
|
66
|
+
</ol>
|
67
|
+
|
68
|
+
<h2 id="NAME">NAME</h2>
|
69
|
+
<p class="man-name">
|
70
|
+
<code>side_do</code> - <span class="man-whatis">a awesome tool to release game for sonkwo</span>
|
71
|
+
</p>
|
72
|
+
|
73
|
+
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
74
|
+
|
75
|
+
<p><strong>Side Do</strong> is a simple command-line tool for making game seeds, uploading game seeds to remote servers and so on. It does so safely and quietly, it's perfect for use with cron as a cron work.</p>
|
76
|
+
|
77
|
+
<p>By default, <code>Side Do</code> check all games nees to be release and pack them all one by one. <code>Side Do</code> allow us specify the
|
78
|
+
game id to just do with the exact game by -g or --game_id, Before this you can use <strong>side_do list</strong> to list all the game and pick a game_id to do with.</p>
|
79
|
+
|
80
|
+
<p><code>Side Do</code> is also easy to configure either by yml file or command, this will be explained later.
|
81
|
+
Finally, <code>Side Do</code> allow you to extend it with ruby.</p>
|
82
|
+
|
83
|
+
<h2 id="OPTIONS">OPTIONS</h2>
|
84
|
+
|
85
|
+
<dl>
|
86
|
+
<dt><code>-a</code>, <code>--all</code></dt><dd>do with all games. this can be omitted.</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
|
90
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
91
|
+
|
92
|
+
<p>When you created a pre_release job on sonkwo admin web page.
|
93
|
+
$ side_do pack
|
94
|
+
this will pack all games need to be released.</p>
|
95
|
+
|
96
|
+
<p>Perhaps you want some of them to be packed first, or you want do them both at same time, you can first pack the game by specify its id like this:</p>
|
97
|
+
|
98
|
+
<pre><code>$ side_do list
|
99
|
+
# game_id game_name status
|
100
|
+
# 123 game_1 to_be_packed
|
101
|
+
# 321 game_2 to_be_packed
|
102
|
+
|
103
|
+
$ side_do pack 321
|
104
|
+
#open another dos
|
105
|
+
$ side_do pack 123
|
106
|
+
</code></pre>
|
107
|
+
|
108
|
+
<p>after packing games, you may want upload game seed to remote server.</p>
|
109
|
+
|
110
|
+
<pre><code>$ side_do upload 321 -r beijing
|
111
|
+
|
112
|
+
this will upload the game to beijing remote server,if you omit the -r option, it will upload to all sonkwo download servers.
|
113
|
+
</code></pre>
|
114
|
+
|
115
|
+
|
116
|
+
<ol class='man-decor man-foot man foot'>
|
117
|
+
<li class='tl'></li>
|
118
|
+
<li class='tc'>April 2014</li>
|
119
|
+
<li class='tr'>side_do(1)</li>
|
120
|
+
</ol>
|
121
|
+
|
122
|
+
</div>
|
123
|
+
</body>
|
124
|
+
</html>
|
data/man/side_do.1.ronn
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
side_do -- a awesome tool to release game for sonkwo
|
2
|
+
=====================================================
|
3
|
+
## DESCRIPTION
|
4
|
+
**Side Do** is a simple command-line tool for making game seeds, uploading game seeds to remote servers and so on. It does so safely and quietly, it's perfect for use with cron as a cron work.
|
5
|
+
|
6
|
+
By default, `Side Do` check all games nees to be release and pack them all one by one. `Side Do` allow us specify the
|
7
|
+
game id to just do with the exact game by -g or --game_id, Before this you can use **side_do list** to list all the game and pick a game_id to do with.
|
8
|
+
|
9
|
+
`Side Do` is also easy to configure either by yml file or command, this will be explained later.
|
10
|
+
Finally, `Side Do` allow you to extend it with ruby.
|
11
|
+
|
12
|
+
## OPTIONS
|
13
|
+
* `-a`, `--all`:
|
14
|
+
do with all games. this can be omitted.
|
15
|
+
|
16
|
+
## EXAMPLES
|
17
|
+
When you created a pre_release job on sonkwo admin web page.
|
18
|
+
$ side_do pack
|
19
|
+
this will pack all games need to be released.
|
20
|
+
|
21
|
+
Perhaps you want some of them to be packed first, or you want do them both at same time, you can first pack the game by specify its id like this:
|
22
|
+
|
23
|
+
$ side_do list
|
24
|
+
# game_id game_name status
|
25
|
+
# 123 game_1 to_be_packed
|
26
|
+
# 321 game_2 to_be_packed
|
27
|
+
|
28
|
+
$ side_do pack 321
|
29
|
+
#open another dos
|
30
|
+
$ side_do pack 123
|
31
|
+
|
32
|
+
after packing games, you may want upload game seed to remote server.
|
33
|
+
|
34
|
+
$ side_do upload 321 -r beijing
|
35
|
+
|
36
|
+
this will upload the game to beijing remote server,if you omit the -r option, it will upload to all sonkwo download servers.
|
data/side_do.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Ensure we require the local version and not one we might have installed already
|
2
|
+
require File.join([File.dirname(__FILE__),'lib','side_do','version.rb'])
|
3
|
+
spec = Gem::Specification.new do |s|
|
4
|
+
s.name = 'side_do'
|
5
|
+
s.version = SideDo::VERSION
|
6
|
+
s.author = 'Wang Guangxing'
|
7
|
+
s.email = '734569969@qq.com'
|
8
|
+
s.homepage = 'https://github.com/veetase/side_do'
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.summary = "side_do is a simple command-line tool for making game seeds, uploading game seeds to remote servers and so on. It does so safely and quietly, it's perfect for use with cron as a cron work."
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
s.require_paths << 'lib'
|
13
|
+
s.has_rdoc = true
|
14
|
+
s.extra_rdoc_files = ['README.rdoc','side_do.rdoc']
|
15
|
+
s.rdoc_options << '--title' << 'side_do' << '--main' << 'README.rdoc' << '-ri'
|
16
|
+
s.bindir = 'bin'
|
17
|
+
s.executables << 'side_do'
|
18
|
+
s.add_development_dependency('rake')
|
19
|
+
s.add_development_dependency('rdoc')
|
20
|
+
s.add_development_dependency('aruba')
|
21
|
+
s.add_runtime_dependency('gli','2.9.0')
|
22
|
+
s.add_dependency('activerecord')
|
23
|
+
s.add_dependency('mysql2')
|
24
|
+
end
|
data/side_do.rdoc
ADDED
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: side_do
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wang Guangxing
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rdoc
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aruba
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: gli
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.9.0
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.9.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: mysql2
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description:
|
98
|
+
email: 734569969@qq.com
|
99
|
+
executables:
|
100
|
+
- side_do
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files:
|
103
|
+
- README.rdoc
|
104
|
+
- side_do.rdoc
|
105
|
+
files:
|
106
|
+
- .gitignore
|
107
|
+
- Gemfile
|
108
|
+
- Gemfile.lock
|
109
|
+
- README.md
|
110
|
+
- README.rdoc
|
111
|
+
- Rakefile
|
112
|
+
- bin/game.rb
|
113
|
+
- bin/side_do
|
114
|
+
- bin/side_do.rc.yaml
|
115
|
+
- features/side_do.feature
|
116
|
+
- features/step_definitions/side_do_steps.rb
|
117
|
+
- features/support/env.rb
|
118
|
+
- lib/side_do.rb
|
119
|
+
- lib/side_do/version.rb
|
120
|
+
- man/side_do.1
|
121
|
+
- man/side_do.1.html
|
122
|
+
- man/side_do.1.ronn
|
123
|
+
- side_do.gemspec
|
124
|
+
- side_do.rdoc
|
125
|
+
- test/default_test.rb
|
126
|
+
- test/test_helper.rb
|
127
|
+
homepage: https://github.com/veetase/side_do
|
128
|
+
licenses: []
|
129
|
+
metadata: {}
|
130
|
+
post_install_message:
|
131
|
+
rdoc_options:
|
132
|
+
- --title
|
133
|
+
- side_do
|
134
|
+
- --main
|
135
|
+
- README.rdoc
|
136
|
+
- -ri
|
137
|
+
require_paths:
|
138
|
+
- lib
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ! '>='
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
requirements: []
|
151
|
+
rubyforge_project:
|
152
|
+
rubygems_version: 2.2.2
|
153
|
+
signing_key:
|
154
|
+
specification_version: 4
|
155
|
+
summary: side_do is a simple command-line tool for making game seeds, uploading game
|
156
|
+
seeds to remote servers and so on. It does so safely and quietly, it's perfect
|
157
|
+
for use with cron as a cron work.
|
158
|
+
test_files: []
|