takuhai_status 1.8.6 → 1.8.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96852a2f35362b1999ccb6b821c14cb1268f70f6174333d332aa9be4979dd7bc
4
- data.tar.gz: 889b569e96d28d7889ba9ab6105bbbcd85fded0dbe3e3023c65c358c7297b6c8
3
+ metadata.gz: d5905eec5ea6483df7e510af180443d1e7027a80e37f4c104127e2739a4b428f
4
+ data.tar.gz: 9083558ba2a088cc3b2b2ca1c3f250259acab4ba657a8193e2f081006fcedac6
5
5
  SHA512:
6
- metadata.gz: 57a7cfe630ec6c80a0ec29e1f66ab500b7ed7ae8597dfd557a4c1e63000f99d983efd99c91bbe5143a8d852e44863f2686a1936ca93929a12fe6f77334303a9d
7
- data.tar.gz: a38b0dcee60242b243dd954e560fc0d1d66a854e51ee98b4d0fd0d56e3782a9db14f6658f747eb1f6272f8f7b9a1fd3c1429e4bf74c29ce532797059ef232f4d
6
+ metadata.gz: 0c7678aea07f4086b27329bcf9471facac84c555d465454044ee3e1cee02a0985466fbbb4311568ceff9717c8c6d17c4f58eca08fedfa15da91f0aaba8d4958e
7
+ data.tar.gz: 9c7274a28d1444ba210d9cfe0b95f30c3f2a0f872d483e9c169b659154f653034d9927241822bf7720a0d79169b4e519ea3408ad28bf6af7ca9863ea21266d64
@@ -1,5 +1,6 @@
1
1
  require 'faraday'
2
2
  require 'faraday/cookie_jar'
3
+ require 'faraday_middleware'
3
4
  require 'nokogiri'
4
5
 
5
6
  module TakuhaiStatus
@@ -21,12 +22,14 @@ module TakuhaiStatus
21
22
  private
22
23
  def check
23
24
  @@conn = Faraday.new(url: 'https://track-a.tmg-group.jp'){|builder|
25
+ #@@conn = Faraday.new(url: 'https://track-a.tmg-tms.com'){|builder|
24
26
  builder.use :cookie_jar
27
+ builder.use FaradayMiddleware::FollowRedirects
25
28
  builder.request :url_encoded
26
29
  builder.adapter :net_http
27
30
  } unless @@conn
28
- @@conn.get('/cts/TmgCargoSearchAction.do')
29
- res = @@conn.post('/cts/TmgCargoSearchAction.do', {
31
+ top = @@conn.get('/cts/TmgCargoSearchAction.do')
32
+ res = @@conn.post(top.env.url, { # replace with redirected url
30
33
  'inputData[0].inq_no' => @key,
31
34
  'method_id' => 'POPUPSEA'
32
35
  })
@@ -1,3 +1,3 @@
1
1
  module TakuhaiStatus
2
- VERSION = "1.8.6"
2
+ VERSION = "1.8.7"
3
3
  end
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_runtime_dependency "faraday"
23
23
  spec.add_runtime_dependency "mechanize"
24
24
  spec.add_runtime_dependency "faraday-cookie_jar"
25
+ spec.add_runtime_dependency "faraday_middleware"
25
26
 
26
27
  spec.add_development_dependency "bundler"
27
28
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takuhai_status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 1.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - TADA Tadashi
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday_middleware
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement