galerts 1.1.2 → 1.1.3

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: 355730f42900239687a1188fe889602a055101a7
4
- data.tar.gz: 67ad82cff8bcaa3cdaa72e86db6dea5a76bd7a97
3
+ metadata.gz: 501529af213744731ac3bfe15467473ee6847b3c
4
+ data.tar.gz: 56f9bfb008163c9eeb39d528dab9172bbc1016c2
5
5
  SHA512:
6
- metadata.gz: 022389c313e0dd0c868629ba0047e0c40430e917e96f47a6d439cf6f3b9eeb77dc20b9c530e86ebb29564e3fef658c85cf34ea4d8f1ab2a32e7609791cccd02f
7
- data.tar.gz: 0a6c3441fb314e92a80af3c6ed1ab6e13b1c21385bbce529dc8b2151590c44281197e2c71b070a76610d31635941ab66c7a1a6bfe68e2841a0679b6589918b22
6
+ metadata.gz: 2de26177646f7a9841490164b12bc910500a56626eae9f56d54fbc5e309336a620427fa9c89134fb979ad75d3430f4c39ec34216b68e4b7e04ece9f71be1d2ab
7
+ data.tar.gz: b300186ecebf7b12f97e02d986da8f4809363f078caeddb639d6f9587ec2f0fb30e145829feb29c86e37a9e5d0a7a91877881b71b2cb65e0f5eceeaad3ce09eb
@@ -22,4 +22,5 @@ matrix:
22
22
  branches:
23
23
  only: master
24
24
 
25
-
25
+ before_install:
26
+ - gem update bundler
@@ -21,29 +21,21 @@ module Galerts
21
21
 
22
22
  def login
23
23
  response = @agent.get(LOGIN_URL) # get login page
24
- login_form = Nokogiri::HTML(response.body, nil, 'utf-8').css('form#gaia_loginform input') # get login form
25
- params = get_login_form_params(login_form) # fetch form parameters and edit
26
- response = @agent.post(LOGIN_URL, params) # do login
24
+
25
+ email_form = response.forms.first
26
+ email_form["Email"] = @email
27
+ email_response = email_form.submit
28
+
29
+ password_form = email_response.forms.first
30
+ password_form["Passwd"] = @password
31
+ response = password_form.submit
32
+
27
33
  error = response.parser.css('span[id^=errormsg]')
28
34
  unless error.empty?
29
35
  raise error.text.delete("\n").strip
30
36
  end
31
37
  end
32
38
 
33
- def get_login_form_params(login_form)
34
- params = {
35
- 'Email' => @email,
36
- 'Passwd' => @password
37
- }
38
-
39
- login_form.each do |input|
40
- unless ['Email', 'Passwd', nil].include? input['name']
41
- params[input['name']] = input['value']
42
- end
43
- end
44
- params
45
- end
46
-
47
39
  def alerts_page
48
40
  Nokogiri::HTML(@agent.get(ALERTS_URL).body, nil, 'utf-8')
49
41
  end
@@ -1,3 +1,3 @@
1
1
  module Galerts
2
- VERSION = '1.1.2'.freeze unless defined?(::Galerts::VERSION)
2
+ VERSION = '1.1.3'.freeze unless defined?(::Galerts::VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: galerts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emre Can Yılmaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize