rfetion 0.4.5 → 0.4.6

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.5
1
+ 0.4.6
@@ -9,7 +9,6 @@ class Fetion
9
9
  FETION_LOGIN_URL = 'https://uid.fetion.com.cn/ssiportal/SSIAppSignIn.aspx'
10
10
  FETION_CONFIG_URL = 'http://nav.fetion.com.cn/nav/getsystemconfig.aspx'
11
11
  FETION_SIPP = 'SIPP'
12
- GUID = ::Guid.new.to_s
13
12
  @nonce = nil
14
13
 
15
14
  def initialize
@@ -20,6 +19,7 @@ class Fetion
20
19
  @logger = Logger.new(STDOUT)
21
20
  @logger.level = Logger::INFO
22
21
  @cat = true
22
+ @guid = ::Guid.new.to_s
23
23
  end
24
24
 
25
25
  def logger_level=(level)
@@ -127,7 +127,7 @@ class Fetion
127
127
  http = Net::HTTP.new(uri.host, uri.port)
128
128
  http.use_ssl = true
129
129
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
130
- headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{GUID}", 'User-Agent' => 'IIC2.0/PC 3.2.0540'}
130
+ headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{@guid}", 'User-Agent' => 'IIC2.0/PC 3.2.0540'}
131
131
  response = http.request_get(uri.request_uri, headers)
132
132
 
133
133
  raise FetionException.new('Fetion Error: Login failed.') unless response.is_a? Net::HTTPSuccess
@@ -348,7 +348,7 @@ class Fetion
348
348
  @logger.debug "body: #{body}"
349
349
  uri = URI.parse(url)
350
350
  http = Net::HTTP.new(uri.host, uri.port)
351
- headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{GUID}", 'User-Agent' => 'IIC2.0/PC 3.2.0540', 'Cookie' => "ssic=#{@ssic}"}
351
+ headers = {'Content-Type' => 'application/oct-stream', 'Pragma' => "xz4BBcV#{@guid}", 'User-Agent' => 'IIC2.0/PC 3.2.0540', 'Cookie' => "ssic=#{@ssic}"}
352
352
  response = http.request_post(uri.request_uri, body, headers)
353
353
 
354
354
  @logger.debug "response: #{response.inspect}"
@@ -376,7 +376,7 @@ class Fetion
376
376
  end
377
377
 
378
378
  def calc_cnonce
379
- Digest::MD5.hexdigest(GUID).upcase
379
+ Digest::MD5.hexdigest(@guid).upcase
380
380
  end
381
381
 
382
382
  def hash_password
data/rfetion.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rfetion}
8
- s.version = "0.4.5"
8
+ s.version = "0.4.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfetion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang