portal_scraper 1.1.0 → 1.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
  SHA256:
3
- metadata.gz: c17340a2ba668c837521fc740a1b2f6f845e79f689121e351c0a46d3929de5ab
4
- data.tar.gz: a9e36eea49ee51e7d0128f9cc706839983ef9dcafd8e584823527725c660e1ab
3
+ metadata.gz: ccad098b23566f5d701390d2b26ca64f1aaa1683d5f23c11d41621e280b49d13
4
+ data.tar.gz: e6a8f24944f3360d741a22a7b2d4698a20a3c6412795a8349037759c803f6bd2
5
5
  SHA512:
6
- metadata.gz: b188d4e98c4e8cf0cedc6e474cdaae9cb7de80f40e96776f94fbb2aff476bd2bb0a4b44aae497b29481104e80d139137adf76e19133a45c1c76a370c39075970
7
- data.tar.gz: b711ef1ff9de12d9c51460e7df2e8b71717bf11154bc31d84fb960a17f587606b1ffde83080caa94cd172eac3065a9acde01f5e0c951877c5aa477b85b29f0c6
6
+ metadata.gz: 38ca0e84ec2ea07966ee28565a55f1973fd4140433a0da55968f4647970b8861d216acd00d088f46f0d649b38fa9f18751eb1d5a7f44e0ce94b3c914cdc1c8e2
7
+ data.tar.gz: 750a7dbe9f3384786fbd1a46a8f38c30a0182f3ec27726b32e4efd9dccdbc14e708b21a9f6a9bac0432a7723237c6a2d632962a9024d919945a30d9c674e23ef
@@ -3,18 +3,18 @@ require 'mechanize'
3
3
  module PortalScraper
4
4
  module Accounts
5
5
  class Client
6
- attr_accessor :_app_id, :_secret
6
+ attr_accessor :app_id, :secret
7
7
 
8
8
  def initialize(app_id = nil, secret = nil)
9
- _app_id = app_id || config.app_id
10
- _secret = secret || config.secret
9
+ @app_id = app_id || config.app_id
10
+ @secret = secret || config.secret
11
11
  raise BadRootUrl unless config.root_url =~ URI::regexp
12
12
  end
13
13
 
14
14
  def try_form_fields(form, fields, value)
15
15
  fields.each do |field|
16
- if form.respond_to?("#{field}=")
17
- form.send("#{}=", value)
16
+ if form.has_field?(field)
17
+ form[field] = value
18
18
  break
19
19
  end
20
20
  end
@@ -24,8 +24,8 @@ module PortalScraper
24
24
  raise BadLoginUrl if config.login_url.nil?
25
25
  app.get(url_for(config.login_url)) do |login_page|
26
26
  form = login_page.form_with(name: /login/i) || login_page.forms[0]
27
- try_form_fields(form, %i(username login), _app_id)
28
- try_form_fields(form, %i(password secret), _secret)
27
+ try_form_fields(form, %w(username login), app_id)
28
+ try_form_fields(form, %w(password secret), secret)
29
29
  form.submit
30
30
  end
31
31
  app.get(url_for(config.token_url)) unless config.token_url.nil?
@@ -2,7 +2,7 @@ module PortalScraper
2
2
  class Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  def self.to_s
8
8
  [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portal_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armand Mégrot