amazon_auth 0.2.1 → 0.3.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
  SHA1:
3
- metadata.gz: 3ca9c9fc3e71a8956687c5a35fa3641e3cd8a400
4
- data.tar.gz: b675685190fe70eba55e31f324cb1ec9a2a57272
3
+ metadata.gz: 04a18c43fe199086bfa94cb3c6eeb96d6c418f16
4
+ data.tar.gz: d6a43c21ebfb9e81cc18c917ec3351958af4a04a
5
5
  SHA512:
6
- metadata.gz: 50b6d4cb570cd913512648a7093cd1828e00f55c6ed2d122e553718f31b529dc81350fb4683ac57006ae479138ffe597ba078464d7c8291f99e7ec7244feaaf8
7
- data.tar.gz: ba7482249e22c31f8b1fddfd32fa18ce16bce868509d44a0f2fa75ff637b8e56b0dbca21b343b0a86dd15369c2e3e5f997b42bc16dfd416f9148d59f7259470b
6
+ metadata.gz: ce2c1e9a62fce22901ac94c3e48bdcf740cf261df96ba10456ead755152fca65037f3a91b9acb4f7d98513438d1e250fd2ce047bb78cc96dd719c71cf09ff523
7
+ data.tar.gz: 742268eb916028b5927723ecd0ec4911a9feab20aadcaa1fec52960f6657da974600ad3badf960866e03c1f7bd16b29d9eeb3905ab4fed5e6f89ffa4b4b44f2c
data/README.md CHANGED
@@ -26,19 +26,15 @@ Or install it yourself as:
26
26
 
27
27
  ## Requirements
28
28
 
29
- This gem may not work with newer versions of Firefox.
29
+ - chromedriver
30
30
 
31
- Firefox (<= 47.0.2)
32
-
33
- [Download Firefox](https://ftp.mozilla.org/pub/firefox/releases/)
34
- Don't forget to disable automatic updates of Firefox.
35
-
36
- You may also need geckodriver.
37
- This may need to be older depending on the version of selenium-webdriver.
38
-
39
- [Download geckodriver](https://github.com/mozilla/geckodriver/releases)
31
+ Before running, you need to **download chromedriver**.
32
+ And you may need to **update chromedriver regularly**.
33
+ Please download latest chromedriver_xxx.zip from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
40
34
 
41
- If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
35
+ ```
36
+ mv ~/Downloads/chromedriver /usr/local/bin/
37
+ ```
42
38
 
43
39
  ## Usage
44
40
 
@@ -77,21 +73,27 @@ Set `AMAZON_DOMAIN` in _.env_.
77
73
 
78
74
  e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site
79
75
 
80
- ### Use Chrome (chromedriver)
76
+ ### Use Firefox
81
77
 
82
- You can use Chrome instead of Firefox
78
+ This gem may not work with newer versions of Firefox.
79
+ Check README of [capybara](https://github.com/teamcapybara/capybara).
83
80
 
84
- Before running, you need to download chromedriver.
85
- Please download latest chromedriver_xxx.zip from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
81
+ Firefox (<= 47.0.2) may work better.
86
82
 
87
- ```
88
- mv ~/Downloads/chromedriver /usr/local/bin/
89
- ```
83
+ [Download Firefox](https://ftp.mozilla.org/pub/firefox/releases/)
84
+ Don't forget to disable automatic updates of Firefox.
85
+
86
+ You may also need geckodriver.
87
+ This may need to be older depending on the version of selenium-webdriver.
88
+
89
+ [Download geckodriver](https://github.com/mozilla/geckodriver/releases)
90
+
91
+ If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
90
92
 
91
93
  In console,
92
94
 
93
95
  ```
94
- client = AmazonAuth::Client.new(driver: :chrome)
96
+ client = AmazonAuth::Client.new(driver: :firefox)
95
97
  ```
96
98
 
97
99
  ## Development
@@ -1,3 +1,9 @@
1
+ Capybara.register_driver :selenium do |app|
2
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
3
+ end
1
4
  Capybara.register_driver :chrome do |app|
2
5
  Capybara::Selenium::Driver.new(app, browser: :chrome)
3
6
  end
7
+ Capybara.register_driver :firefox do |app|
8
+ Capybara::Selenium::Driver.new(app, browser: :firefox)
9
+ end
@@ -21,6 +21,8 @@ module AmazonAuth
21
21
  end
22
22
  end
23
23
  @driver = options.fetch(:driver, :selenium)
24
+
25
+ Capybara.app_host = @initial_url
24
26
  rescue => e
25
27
  puts "Please setup credentials of amazon_auth gem with folloing its instruction."
26
28
  raise e
@@ -51,6 +53,7 @@ module AmazonAuth
51
53
  session.fill_in 'ap_password', with: @password
52
54
  if image_recognition_displayed?
53
55
  input = ask "Got the prompt. Read characters from the image: "
56
+ return true if input.blank? || !session.first('#auth-captcha-guess') # Skip when form is submitted manually
54
57
  session.fill_in 'auth-captcha-guess', with: input
55
58
  end
56
59
  sleep 1
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.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.2.1
4
+ version: 0.3.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: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.6.11
185
+ rubygems_version: 2.6.8
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Login amazon.