bank_api 0.1.0 → 0.1.1

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: b6f2aa174d501060b2a458a4275f4189a2f6fe55
4
- data.tar.gz: bcaf182763556fc6b996c4ebf8406365c425d2f8
3
+ metadata.gz: dd52c9bfa1a9cfe98159937215d5bec287aa929b
4
+ data.tar.gz: 0adfdbbcf9ce11c66c8dc9b4ae2cdd9bcbc86b5b
5
5
  SHA512:
6
- metadata.gz: e89a962dc628fbfd6e4f65cafe43dff5f62fdce890b2da14ccefe45e91040164b590ffb39fe02563d256ce59168f12471a9c12ca6bc87dff3e1b7a6244ccd3f0
7
- data.tar.gz: 5a923b6a828655f1edaea35ceae699d249806eea2cf3547267e839345e870065b7a6449cc19482e2b8f9a24bd209d9cacf5e5ba0ab751547dced7400d1708759
6
+ metadata.gz: 5c031b6e21a68fb257147e8a0612c1862c920cffe7a9b3649f7564f960e613814cccb771bfbbc936f416d9850ad3af001dd87f2a01a8f22a2da406e550a71ee9
7
+ data.tar.gz: dbc68f72da36199e600ef32ad96978395f91b642121a9ef1789c03b203fb363b021dd6ed7417533a935103922b503da94bde1bdc14aedd9a33621ed7f5537110
data/README.md CHANGED
@@ -45,6 +45,12 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
45
45
 
46
46
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
47
47
 
48
+ ## Heroku
49
+
50
+ 1. Add https://github.com/heroku/heroku-buildpack-chromedriver.git buildpack.
51
+ 2. Add https://github.com/kevinsawicki/heroku-buildpack-xvfb-google-chrome.git buildpack.
52
+ 3. Set `'GOOGLE_CHROME_SHIM'` env var with value `"/app/.apt/usr/bin/google-chrome-stable"`
53
+
48
54
  ## Contributing
49
55
 
50
56
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bank_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -1,4 +1,5 @@
1
1
  require 'pincers'
2
+ require 'selenium-webdriver'
2
3
 
3
4
  require 'bank_api/exceptions'
4
5
  require 'bank_api/sign_deposits'
@@ -34,7 +35,27 @@ module BankApi::Clients
34
35
  end
35
36
 
36
37
  def browser
37
- @browser ||= Pincers.for_webdriver :chrome
38
+ @browser ||= Pincers.for_webdriver(driver)
39
+ end
40
+
41
+ def driver(width = 1024, heigth = 768)
42
+ chrome_path = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
43
+ return :chrome unless chrome_path
44
+
45
+ chrome_opts = {
46
+ "chromeOptions" => {
47
+ "binary" => chrome_path
48
+ }
49
+ }
50
+
51
+ opts = {
52
+ desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(chrome_opts),
53
+ args: ['--no-sandbox', '--browsertime.xvfb']
54
+ }
55
+
56
+ d = Selenium::WebDriver.for(:chrome, opts)
57
+ d.manage.window.size = Selenium::WebDriver::Dimension.new(width, heigth)
58
+ d
38
59
  end
39
60
 
40
61
  def parse_entries(entries)
@@ -1,3 +1,3 @@
1
1
  module BankApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - oaestay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pincers