amazon_auth 0.6.0 → 0.7.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: a45eff39c70d3750f6bb7edd67f68ae06f9e8b8290601aa4fe30f4ac89f3ec9c
4
- data.tar.gz: d22f3c9195a3120b5f900824357093003b3c2760c8d3ff9d1a17d323ce5cc8ed
3
+ metadata.gz: 2616112a7c77ce7a370145836360fc55df643716450e6222d95affa6c1b942ec
4
+ data.tar.gz: e96f0dad4d371aeaf0c6bd7dc325cd252fea806e992c322aceef88e01e5c7cc4
5
5
  SHA512:
6
- metadata.gz: 4fc2ef8f1b551796f6b3efb359987db8a48d05ce51d75d055275c639dd950e51d8f99a90fe5afc4b646940b9bb142b49adc984ee2a922d1b0d2c7cbbc988e022
7
- data.tar.gz: 2571de906fdc1470088cb9e71db7d6ac87748e649f6be73beceede17447865e5f597ad9f1cf44edd5748db747e7b15bf45daaf9eb5887d9306472766bdb25b89
6
+ metadata.gz: a18f9d6ce597e2c12a96bdf6748bc8eda365533f8d5daebd968282a58dfb330cf12adfc7c057b529b1b5e20a05a9c61e9a41ba5cf8c0922b27db921f656f0f4a
7
+ data.tar.gz: 99b3832589d28b9e4eebf5bf4fc3fe590ecc5b57ec6031a5b5e4854d472add8d700b1abf118d10d9dfb441454d1ce2152c6d95220726b474e446f200b7d8b1db
@@ -0,0 +1,21 @@
1
+ version: 2.1
2
+
3
+ jobs:
4
+ test:
5
+ parameters:
6
+ ruby-version:
7
+ type: string
8
+ docker:
9
+ - image: cimg/ruby:<< parameters.ruby-version >>-browsers
10
+ steps:
11
+ - checkout
12
+ - run: bundle install
13
+ - run: bundle exec rspec
14
+
15
+ workflows:
16
+ all-tests:
17
+ jobs:
18
+ - test:
19
+ matrix:
20
+ parameters:
21
+ ruby-version: ["2.7.5", "3.0.3"]
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # AmazonAuth
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/amazon_auth.svg)](https://badge.fury.io/rb/amazon_auth)
4
- [![Build Status](https://travis-ci.org/kyamaguchi/amazon_auth.svg?branch=master)](https://travis-ci.org/kyamaguchi/amazon_auth)
4
+ [![CircleCI](https://circleci.com/gh/kyamaguchi/amazon_auth.svg?style=svg)](https://circleci.com/gh/kyamaguchi/amazon_auth)
5
5
 
6
6
  Sign In Amazon using Capybara and Selenium
7
7
 
@@ -31,7 +31,7 @@ Or install it yourself as:
31
31
 
32
32
  Before running, you need to **download chromedriver**.
33
33
  And you may need to **update chromedriver regularly**.
34
- Please download latest chromedriver_xxx.zip from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
34
+ Please download latest chromedriver_xxx.zip from https://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
35
35
 
36
36
  ```
37
37
  mv ~/Downloads/chromedriver /usr/local/bin/
@@ -120,31 +120,12 @@ client = AmazonAuth::Client.new(debug: true)
120
120
 
121
121
  ### Use Firefox
122
122
 
123
- This gem may not work with newer versions of Firefox.
124
- Check README of [capybara](https://github.com/teamcapybara/capybara).
125
-
126
- Firefox (<= 47.0.2) may work better.
127
-
128
- [Download Firefox](https://ftp.mozilla.org/pub/firefox/releases/)
129
- Don't forget to disable automatic updates of Firefox.
130
-
131
- You may also need geckodriver.
132
- This may need to be older depending on the version of selenium-webdriver.
133
-
134
- [Download geckodriver](https://github.com/mozilla/geckodriver/releases)
135
-
136
- If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
137
-
138
123
  In console,
139
124
 
140
125
  ```
141
126
  client = AmazonAuth::Client.new(driver: :firefox)
142
127
  ```
143
128
 
144
- ## TODO
145
-
146
- - [Idea] Hook `submit_signin_form` after every `visit` and `click` action
147
-
148
129
  ## Development
149
130
 
150
131
  Use _.env.development_ instead of _.env_ in development.
@@ -29,7 +29,9 @@ module AmazonAuth
29
29
  session.visit url
30
30
  debug "Visiting #{url}"
31
31
  restore_cookies if keep_cookie?
32
- if (link = find_sign_in_link)
32
+ if session.current_url.include?('/ap/signin')
33
+ debug "current_url: [#{session.current_url}]"
34
+ elsif (link = find_sign_in_link)
33
35
  debug "link: [#{link}]"
34
36
  session.visit(link)
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuho Yamaguchi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-13 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -158,9 +158,9 @@ executables:
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
+ - ".circleci/config.yml"
161
162
  - ".gitignore"
162
163
  - ".rspec"
163
- - ".travis.yml"
164
164
  - Gemfile
165
165
  - LICENSE.txt
166
166
  - README.md
@@ -181,7 +181,7 @@ homepage: https://github.com/kyamaguchi/amazon_auth
181
181
  licenses:
182
182
  - MIT
183
183
  metadata: {}
184
- post_install_message:
184
+ post_install_message:
185
185
  rdoc_options: []
186
186
  require_paths:
187
187
  - lib
@@ -196,8 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.0.3
200
- signing_key:
199
+ rubygems_version: 3.1.6
200
+ signing_key:
201
201
  specification_version: 4
202
202
  summary: Login amazon.
203
203
  test_files: []
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.8
5
- - 2.6.6
6
- - 2.7.1
7
- before_install: gem install bundler