amazon_auth 0.1.3 → 0.1.4

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: c76ce0ce2b597d51bfeb14b3418ec5cd15841a3b
4
- data.tar.gz: 47bb457cff9d84cd0d53f737f93ab70761293b8a
3
+ metadata.gz: 435ea0526c11b6d7fe4cbba0d6ebe7e552a998f3
4
+ data.tar.gz: 2365efdd3b8eb344ba290261b7b4fd12acbd97eb
5
5
  SHA512:
6
- metadata.gz: 6655aa1704f5762ade472ee7db50539f1f111222f1a90196c82536bf7dea7d501f64191e292680de1ce9b7165ae97aa115159fca4c2361e0c3f9324ed6c1e892
7
- data.tar.gz: 0c20edebafc3574836c8821da69bb46fb088088a6d89fc74e7efea186aa6977f8b833f914fade1708cbada683a3a2972e0a1abb147392269e1c91911c6a6c85c
6
+ metadata.gz: 5c0dd506e3afcecc1788fd3fb1920cec2df9204709961ddfb96399f03ac1732ec940d97d1fd78bde7d7e357117eebbd6a6ba2a94a15fdc00b58fdd61e29fa2a5
7
+ data.tar.gz: b3983393dd83beca479aa6313ab7623d45e2a0f9b0e634c0089a533713ad0a14ee5f04059dc28cec5c1518b165b179c79a3f843a0a54567906d0f573d859a00e
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.2.4
5
- - 2.2.6
6
- - 2.3.3
7
- before_install: gem install bundler -v 1.12.5
4
+ - 2.2.7
5
+ - 2.3.4
6
+ - 2.4.1
7
+ before_install: gem install bundler -v 1.14.6
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # AmazonAuth
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/amazon_auth.svg)](https://badge.fury.io/rb/amazon_auth)
3
4
  [![Build Status](https://travis-ci.org/kyamaguchi/amazon_auth.svg?branch=master)](https://travis-ci.org/kyamaguchi/amazon_auth)
4
5
 
5
6
  Sign In Amazon using Capybara and Selenium
@@ -31,9 +32,11 @@ Don't forget to disable automatic updates of Firefox.
31
32
 
32
33
  You may also need geckodriver.
33
34
  This may need to be older depending on the version of selenium-webdriver.
34
- e.g. geckodriver v0.14.0 works with selenium-webdriver 3.2
35
+
35
36
  [Download geckodriver](https://github.com/mozilla/geckodriver/releases)
36
37
 
38
+ If the browser doesn't work, try selenium-webdriver version '~> 2.0' or different version of geckodriver/Firefox.
39
+
37
40
  ## Usage
38
41
 
39
42
  ### Set Amazon credentials on your local machine
@@ -65,12 +68,29 @@ client.session.all('a').find{|e| e['href'] =~ %r{/gp/digital/fiona/manage/} }.cl
65
68
  client.driver.quit
66
69
  ```
67
70
 
68
- ### Use amamzon site in different domain
71
+ ### Use amazon site in different domain
69
72
 
70
73
  Set `AMAZON_DOMAIN` in _.env_.
71
74
 
72
75
  e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site
73
76
 
77
+ ### Use Chrome (chromedriver)
78
+
79
+ You can use Chrome instead of Firefox
80
+
81
+ Before running, you need to download chromedriver.
82
+ Please download latest chromedriver_xxx.zip from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH.
83
+
84
+ ```
85
+ mv ~/Downloads/chromedriver /usr/local/bin/
86
+ ```
87
+
88
+ In console,
89
+
90
+ ```
91
+ client = AmazonAuth::Client.new(driver: :chrome)
92
+ ```
93
+
74
94
  ## Development
75
95
 
76
96
  Some features come from https://github.com/kyamaguchi/kindle
data/amazon_auth.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_runtime_dependency 'capybara'
23
- spec.add_runtime_dependency 'selenium-webdriver', '~> 3.2.0'
23
+ spec.add_runtime_dependency 'selenium-webdriver'
24
24
  spec.add_runtime_dependency 'highline'
25
25
  spec.add_runtime_dependency 'dotenv'
26
26
  spec.add_runtime_dependency 'activesupport'
data/lib/amazon_auth.rb CHANGED
@@ -9,6 +9,7 @@ rescue LoadError
9
9
  end
10
10
  require_relative "amazon_auth/version"
11
11
  require_relative "amazon_auth/amazon_info"
12
+ require_relative "amazon_auth/capybara"
12
13
  require_relative "amazon_auth/converter"
13
14
  require_relative "amazon_auth/client"
14
15
 
@@ -0,0 +1,3 @@
1
+ Capybara.register_driver :chrome do |app|
2
+ Capybara::Selenium::Driver.new(app, browser: :chrome)
3
+ end
@@ -18,6 +18,7 @@ module AmazonAuth
18
18
  raise('AMAZON_PASSWORD_CODE is required.')
19
19
  end
20
20
  end
21
+ @driver = options.fetch(:driver, :selenium)
21
22
  end
22
23
 
23
24
  def sign_in
@@ -63,7 +64,7 @@ module AmazonAuth
63
64
  end
64
65
 
65
66
  def session
66
- @session ||= Capybara::Session.new(:selenium)
67
+ @session ||= Capybara::Session.new(@driver)
67
68
  end
68
69
 
69
70
  def driver
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.1.3
4
+ version: 0.1.4
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-03-25 00:00:00.000000000 Z
11
+ date: 2017-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.0
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.2.0
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: highline
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -157,6 +157,7 @@ files:
157
157
  - exe/amazon_auth
158
158
  - lib/amazon_auth.rb
159
159
  - lib/amazon_auth/amazon_info.rb
160
+ - lib/amazon_auth/capybara.rb
160
161
  - lib/amazon_auth/client.rb
161
162
  - lib/amazon_auth/converter.rb
162
163
  - lib/amazon_auth/version.rb
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
181
  version: '0'
181
182
  requirements: []
182
183
  rubyforge_project:
183
- rubygems_version: 2.6.8
184
+ rubygems_version: 2.6.11
184
185
  signing_key:
185
186
  specification_version: 4
186
187
  summary: Login amazon.