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 +4 -4
- data/.travis.yml +2 -1
- data/lib/galerts/manager.rb +9 -17
- data/lib/galerts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 501529af213744731ac3bfe15467473ee6847b3c
|
4
|
+
data.tar.gz: 56f9bfb008163c9eeb39d528dab9172bbc1016c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2de26177646f7a9841490164b12bc910500a56626eae9f56d54fbc5e309336a620427fa9c89134fb979ad75d3430f4c39ec34216b68e4b7e04ece9f71be1d2ab
|
7
|
+
data.tar.gz: b300186ecebf7b12f97e02d986da8f4809363f078caeddb639d6f9587ec2f0fb30e145829feb29c86e37a9e5d0a7a91877881b71b2cb65e0f5eceeaad3ce09eb
|
data/.travis.yml
CHANGED
data/lib/galerts/manager.rb
CHANGED
@@ -21,29 +21,21 @@ module Galerts
|
|
21
21
|
|
22
22
|
def login
|
23
23
|
response = @agent.get(LOGIN_URL) # get login page
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
data/lib/galerts/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|