amazon_auth 0.4.6 → 0.5.0

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: 8bd3624417b3a13baad3a2812cf7bdc6f874966e69290b3e5dce2bfb748b4a9a
4
- data.tar.gz: fff02f6937501b76a01d16a9de7b9ade90b02b2e4ac5de8448b58293a69b8579
3
+ metadata.gz: 7da5d38fe75349e2e609f1acdef47b251a0a3353ba9693ac7a3961848bdaa645
4
+ data.tar.gz: 28faf4af2fbd6084d62a9bfe9dd8c7b94b200d5cca9b7a8fb14d4d569975284e
5
5
  SHA512:
6
- metadata.gz: 3dfdb0bf93116a962ab13314f7342837bb920371d35f9e0cb1ab26754d9b65d23237b2de6263d6621b2eb1dc3631f6ebe262c457695192882edf41d304090060
7
- data.tar.gz: 3a72e83fc180ee2028b5b4b0382f0b290d631a233eb9aae4a71827c9eae7d90f91701b672c16a98066dcf7567c70aa27539faf6ec2c3e7c6ef2249af7549667b
6
+ metadata.gz: 9cee30a8fb0c0955acc36341d980ca9d5545e162199164f2e9f46140e415fcd3e36f92c5910b32c2ec2d1ef64a9e2d20d85b0d63032d28b2a484cb93c7a3fd2d
7
+ data.tar.gz: 8b3655e0a60e5c36686714ba8e98aa1eb5939a1a6358de45b2237a26be58628855c79e4c2802061ca54c4b3b0fa77fa648ecda7d08c27153cea81f8eb6e4c523
@@ -29,7 +29,7 @@ module AmazonAuth
29
29
  session.visit url
30
30
  debug "Visiting #{url}"
31
31
  restore_cookies if keep_cookie?
32
- if (link = links_for('a').find{|l| l =~ %r{\A/gp/navigation/redirector.html} })
32
+ if (link = find_sign_in_link)
33
33
  debug "link: [#{link}]"
34
34
  session.visit(link)
35
35
  end
@@ -105,6 +105,14 @@ module AmazonAuth
105
105
  session.has_selector?('#auth-captcha-image-container')
106
106
  end
107
107
 
108
+ def find_sign_in_link
109
+ link = links_for('a').find{|l| l =~ %r{\A/gp/navigation/redirector.html} }
110
+ return link if link
111
+ m = session.html.match(%r{'(/gp/navigation/redirector.html[^']+)'})
112
+ return m[1] if m
113
+ nil
114
+ end
115
+
108
116
  private
109
117
 
110
118
  def login
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.4.6"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuho Yamaguchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-27 00:00:00.000000000 Z
11
+ date: 2020-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara