arb-xmu-course 2.5.5 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8449dc7e0973933485064102644ea365626ce3b
4
- data.tar.gz: 2e84d30861491cce5f727a0ba1244bd5605a5d18
3
+ metadata.gz: c65fe569b430a9aacfe396ad8f2a2a795d7d048a
4
+ data.tar.gz: 71e303551dd4ecf712a3cdb1fab4cff9f7458e32
5
5
  SHA512:
6
- metadata.gz: 6d80799b51ae6d567851d277e5a963bf760a6c6c5adb6dd2bb65bb05cffe3dafa094179bb18cf8f3389c2237ebff83218779ab56c67da0d6f5f1647560773973
7
- data.tar.gz: 43d4be9ff5d45ab468bd86694b42398a9a8e0f58f7ab6bd28c1e04b3df74309a7fe0293eaea0d5f2c4b76ffa29c716c1817c5579a8960bce05b58e1f19c2fa44
6
+ metadata.gz: ef465fd71053009cb6281304ec5cb199c189d02964965c883bd46c2c7622351034e9f1cb92b63e7844d39ebb12ed85fd182937ee71eef86cebda6b23ed99b0ce
7
+ data.tar.gz: 59f04359f3a4eff3c8336d181cea48dbc416d407e49a4f7adccbf71330136e8f45e28dffadd80406b2f71c9cf43f92caf22f72e4aa99a410b14412247a9c12ff
data/bin/arb-xmu-course CHANGED
@@ -45,7 +45,7 @@ def select_course_common(client, url, xxlx)
45
45
  rescue Timeout::Error, HTTPClient::TimeoutError
46
46
  exit_with_error "服务器无响应,程序结束运行。"
47
47
  rescue Exception => e
48
- exit_with_error "因未知错误,程序结束运行。(#{e})"
48
+ exit_with_error "程序结束运行。(#{e})"
49
49
  end
50
50
 
51
51
  def set_up_account
@@ -124,7 +124,6 @@ end
124
124
 
125
125
  def create_attempt_thread(max_interval, client, course, xxlx, lcid, retry_count, &block)
126
126
  Thread.new do
127
- begin
128
127
  count=0
129
128
  loop do
130
129
  count+=1
@@ -138,17 +137,14 @@ def create_attempt_thread(max_interval, client, course, xxlx, lcid, retry_count,
138
137
  global_puts "《#{course.name}》(#{course.class_name}班)第#{count}次尝试选课失败,#{interval}秒后将重试。(#{filter_text(res['message'])})"
139
138
  end
140
139
  sleep interval
141
- rescue
142
- retry if retry_count!=0 and retry_count-=1 and global_puts('网络超时,重新连接中……')
140
+ rescue Exception=>e
141
+ retry if retry_count!=0 and retry_count-=1 and global_puts("网络超时,重新连接中……(#{e})")
143
142
  exit_with_error('超时次数耗尽,程序结束运行。') if retry_count==0
144
143
  end
145
144
  end
146
145
  opened_thread_count=block.binding.local_variable_get(:opened_thread_count)
147
146
  exit unless opened_thread_count > 0
148
147
  block.binding.local_variable_set :opened_thread_count, opened_thread_count-1
149
- rescue Exception=>e
150
- exit_with_error "因未知错误,程序结束运行。(#{e})"
151
- end
152
148
  end
153
149
  end
154
150
 
@@ -250,8 +246,6 @@ def global_gets(*args)
250
246
  tmp = $stdin.gets.chomp
251
247
  exit if quit_flags.include? tmp
252
248
  tmp
253
- rescue Interrupt
254
- exit_with_error "因手动退出,程序结束运行。"
255
249
  end
256
250
 
257
251
  def exit_with_error(*args)
@@ -1,7 +1,7 @@
1
1
  module Arb
2
2
  module Xmu
3
3
  module Course
4
- VERSION = '2.5.5'
4
+ VERSION = '2.6.0'
5
5
  end
6
6
  end
7
7
  end
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.5
4
+ version: 2.6.0
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-16 00:00:00.000000000 Z
11
+ date: 2016-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler