side_do 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/Gemfile.lock +1 -1
- data/README.md +22 -10
- data/bin/game.rb +44 -0
- data/lib/side_do/version.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MmYyYjA2YTVmZjRmNWVhNTczZjllMTU5MzZjOWNhODc0MzA2Y2E2OQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 885bad7e7da27bd458e7583684609c622466563b
|
4
|
+
data.tar.gz: adc789025d80cecbc5b232bef38a52b30e655892
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YTRlNTljNTU2Njg1ZjI0ZjhkYzUwNjZlZTBhMTdkMzhiMWQxYzg5ZmRiMDI4
|
11
|
-
ODZjOWNiOWU4ZTA4YzYxYjFiMzg3YjgzYTFiN2EyYzk0YmYzMDc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OGQxYjMwYmEzNjMzY2RmMWI2MmQ2NTE2ZDZkNWJiZGNkNzQ0MTdkNTFjM2Jh
|
14
|
-
ZGMzMTNhYzM5NWM2NDE2M2YwNTE5MzFjZDA3NTRjM2IxZDUzZjIwNmQyMDAz
|
15
|
-
NzFiOWQ4YjIwMDU5MmIyYWQwNDcyZTkwMjIwM2VmYTU1NmQ1YmU=
|
6
|
+
metadata.gz: 505ac4c5c018dc93e5d12e20f40cedabca08f54cb7b344b99fd1d8fe1251b4004a6e21959f3c92957dfef7baa7d37ec5ccbcf13089432dd1749ef5923635822e
|
7
|
+
data.tar.gz: ef3288d5f12052b419ba18e453d16cd59e83fbc21925a34589fd2c676849436b41fc08bd66f55b9a0e3f7c51e16d472cf7689ff6c435b3fb398d237edde0cdeb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,19 +3,27 @@ side_do -- a awesome tool to release game for sonkwo
|
|
3
3
|
## DESCRIPTION
|
4
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
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.
|
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 game id to just do with the exact game, Before this you can use **side_do list** to list all the game and pick a game_id to do with.
|
8
7
|
|
9
8
|
`Side Do` is also easy to configure either by yml file or command, this will be explained later.
|
10
9
|
Finally, `Side Do` allow you to extend it with ruby.
|
11
10
|
|
12
|
-
## OPTIONS
|
13
|
-
* `-a`, `--all`:
|
14
|
-
do with all games. this can be omitted.
|
15
11
|
|
16
|
-
##
|
12
|
+
## Getting Started
|
13
|
+
|
14
|
+
|
15
|
+
----------
|
16
|
+
Install,
|
17
|
+
|
18
|
+
gem install side_do
|
19
|
+
|
17
20
|
When you created a pre_release job on sonkwo admin web page.
|
18
|
-
|
21
|
+
|
22
|
+
$ side_do pack
|
23
|
+
# processing game 321...
|
24
|
+
# successed
|
25
|
+
# processing 123...
|
26
|
+
# successed.
|
19
27
|
this will pack all games need to be released.
|
20
28
|
|
21
29
|
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:
|
@@ -26,11 +34,15 @@ Perhaps you want some of them to be packed first, or you want do them both at sa
|
|
26
34
|
# 321 game_2 to_be_packed
|
27
35
|
|
28
36
|
$ side_do pack 321
|
29
|
-
#
|
30
|
-
|
37
|
+
# processing game 321...
|
38
|
+
# successed
|
39
|
+
|
40
|
+
$ side_do pack 123
|
41
|
+
# processing game 123
|
42
|
+
#successed
|
31
43
|
|
32
44
|
after packing games, you may want upload game seed to remote server.
|
33
45
|
|
34
46
|
$ side_do upload 321 -r beijing
|
35
47
|
|
36
|
-
this will upload the game to beijing remote server,if you omit the -r option, it will upload to all sonkwo download servers.
|
48
|
+
this will upload the game to beijing remote server,if you omit the -r option, it will upload to all sonkwo download servers.
|
data/bin/game.rb
CHANGED
@@ -17,6 +17,50 @@ class Game < ActiveRecord::Base
|
|
17
17
|
has_many :game_files
|
18
18
|
end
|
19
19
|
|
20
|
+
class Games::Base < Game
|
21
|
+
# Defalut values
|
22
|
+
default_value_for :install_type, 'green'
|
23
|
+
|
24
|
+
# Callbacks
|
25
|
+
before_save :update_bundle_price
|
26
|
+
|
27
|
+
def type_name
|
28
|
+
"普通游戏"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
class Games::DLC < Game
|
33
|
+
# Callbacks
|
34
|
+
before_save :update_bundle_price
|
35
|
+
|
36
|
+
def type_name
|
37
|
+
"DLC"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Games::LanguagePack < Game
|
42
|
+
def type_name
|
43
|
+
"语言包"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
class Games::Bundle < Game
|
48
|
+
|
49
|
+
# Associations
|
50
|
+
# There is a bug of rails3 for [:inverse_of]: forbid add callbacks. It would be removed in rails4
|
51
|
+
has_many :bundle_games, :inverse_of => :bundle, :before_add => :forbid_callback, :before_remove => :forbid_callback
|
52
|
+
has_many :games, :through => :bundle_games
|
53
|
+
|
54
|
+
# Methods
|
55
|
+
def total_discount
|
56
|
+
self.bundle_games.inject(BigDecimal.new(0)) { |result, bg| result + bg.discount }
|
57
|
+
end
|
58
|
+
|
59
|
+
def type_name
|
60
|
+
"游戏包"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
20
64
|
class GameFile < ActiveRecord::Base
|
21
65
|
STATUS_NEW = 0
|
22
66
|
STATUS_TO_VERIFY = 1
|
data/lib/side_do/version.rb
CHANGED
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: side_do
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wang Guangxing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: aruba
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -70,28 +70,28 @@ dependencies:
|
|
70
70
|
name: activerecord
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: mysql2
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description:
|
@@ -103,7 +103,7 @@ extra_rdoc_files:
|
|
103
103
|
- README.rdoc
|
104
104
|
- side_do.rdoc
|
105
105
|
files:
|
106
|
-
- .gitignore
|
106
|
+
- ".gitignore"
|
107
107
|
- Gemfile
|
108
108
|
- Gemfile.lock
|
109
109
|
- README.md
|
@@ -129,27 +129,27 @@ licenses: []
|
|
129
129
|
metadata: {}
|
130
130
|
post_install_message:
|
131
131
|
rdoc_options:
|
132
|
-
- --title
|
132
|
+
- "--title"
|
133
133
|
- side_do
|
134
|
-
- --main
|
134
|
+
- "--main"
|
135
135
|
- README.rdoc
|
136
|
-
- -ri
|
136
|
+
- "-ri"
|
137
137
|
require_paths:
|
138
138
|
- lib
|
139
139
|
- lib
|
140
140
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- -
|
142
|
+
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
requirements:
|
147
|
-
- -
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.4.5
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: side_do is a simple command-line tool for making game seeds, uploading game
|