arb-xmu-course 2.5.4 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/arb-xmu-course +6 -4
- data/lib/arb/xmu/course/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8449dc7e0973933485064102644ea365626ce3b
|
4
|
+
data.tar.gz: 2e84d30861491cce5f727a0ba1244bd5605a5d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d80799b51ae6d567851d277e5a963bf760a6c6c5adb6dd2bb65bb05cffe3dafa094179bb18cf8f3389c2237ebff83218779ab56c67da0d6f5f1647560773973
|
7
|
+
data.tar.gz: 43d4be9ff5d45ab468bd86694b42398a9a8e0f58f7ab6bd28c1e04b3df74309a7fe0293eaea0d5f2c4b76ffa29c716c1817c5579a8960bce05b58e1f19c2fa44
|
data/bin/arb-xmu-course
CHANGED
@@ -44,6 +44,8 @@ def select_course_common(client, url, xxlx)
|
|
44
44
|
end
|
45
45
|
rescue Timeout::Error, HTTPClient::TimeoutError
|
46
46
|
exit_with_error "服务器无响应,程序结束运行。"
|
47
|
+
rescue Exception => e
|
48
|
+
exit_with_error "因未知错误,程序结束运行。(#{e})"
|
47
49
|
end
|
48
50
|
|
49
51
|
def set_up_account
|
@@ -136,7 +138,7 @@ def create_attempt_thread(max_interval, client, course, xxlx, lcid, retry_count,
|
|
136
138
|
global_puts "《#{course.name}》(#{course.class_name}班)第#{count}次尝试选课失败,#{interval}秒后将重试。(#{filter_text(res['message'])})"
|
137
139
|
end
|
138
140
|
sleep interval
|
139
|
-
rescue
|
141
|
+
rescue
|
140
142
|
retry if retry_count!=0 and retry_count-=1 and global_puts('网络超时,重新连接中……')
|
141
143
|
exit_with_error('超时次数耗尽,程序结束运行。') if retry_count==0
|
142
144
|
end
|
@@ -144,9 +146,8 @@ def create_attempt_thread(max_interval, client, course, xxlx, lcid, retry_count,
|
|
144
146
|
opened_thread_count=block.binding.local_variable_get(:opened_thread_count)
|
145
147
|
exit unless opened_thread_count > 0
|
146
148
|
block.binding.local_variable_set :opened_thread_count, opened_thread_count-1
|
147
|
-
rescue Interrupt
|
148
149
|
rescue Exception=>e
|
149
|
-
exit_with_error(
|
150
|
+
exit_with_error "因未知错误,程序结束运行。(#{e})"
|
150
151
|
end
|
151
152
|
end
|
152
153
|
end
|
@@ -249,13 +250,14 @@ def global_gets(*args)
|
|
249
250
|
tmp = $stdin.gets.chomp
|
250
251
|
exit if quit_flags.include? tmp
|
251
252
|
tmp
|
253
|
+
rescue Interrupt
|
254
|
+
exit_with_error "因手动退出,程序结束运行。"
|
252
255
|
end
|
253
256
|
|
254
257
|
def exit_with_error(*args)
|
255
258
|
global_puts(*args) and exit
|
256
259
|
end
|
257
260
|
|
258
|
-
|
259
261
|
TOKEN_FILE_NAME = 'encrypted_token'
|
260
262
|
TOKEN_SEPARATOR = ':'
|
261
263
|
CLIENT = HTTPClient.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arb-xmu-course
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arybin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|