fe_sipgate 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d985d9d21510d8bcf1d89e2849533f192ad28e502acda76a0937c1744eb16db7
4
- data.tar.gz: d8ca16120f726e01c91ce4dc799b8c888bafee87311026ffb8302634421f3873
3
+ metadata.gz: ec9a8dca161ce2ffa52800dbed2fedb6dc69a61b69c6a3cc1bed273170a11554
4
+ data.tar.gz: 06c169a1063dd0ecda6f437eefd4efbba5c3def8c58707572574334b82a15512
5
5
  SHA512:
6
- metadata.gz: e4ce89a725e707aae089cc38b234ee578315da39ce0006dfa61db2cf52f2c0b874252bb7f23130b2f4b466ad14215e4715b56c388f5c94c3899bb03e1c79e79f
7
- data.tar.gz: a548dfabb6ad988ee04579d7049a81c6a6fa22a3b2d273312e793d19bcd219c59109c2c3f0b8a3e68b0a7192817b8755a0706cadd1447d4002ef54ae55ba297a
6
+ metadata.gz: f14756a800e45b667591bfbef9968b68baac3d3ed450cfbfc8aa5803367bd682411c51e711b5e685d1a0c3678b47fa9e024e2be69f6403393d297946b84dc7ed
7
+ data.tar.gz: 62b2dc6890113002f87f8385c21b00a08e391c031a50270d30be30b733db4c5e5a1e543feb2e43b078c7cfe41cdfa2c93e5695f89f067010a541717959bf808c
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/fe_sipgate.rb CHANGED
@@ -5,23 +5,38 @@
5
5
  require 'ferrumwizard'
6
6
 
7
7
 
8
+ class FeSipgateErr < Exception
9
+ end
10
+
8
11
  class FeSipgate
9
12
 
10
13
  def initialize(debug: false, headless: true, cookies: nil)
11
14
 
12
15
  @fw = FerrumWizard.new('https://login.sipgate.com/', headless: headless,
13
16
  cookies: cookies, debug: debug)
17
+ @fw.scan_page if cookies
18
+
14
19
  end
15
20
 
16
- def login(usernamex=nil, passwordx=nil, username: usernamx, password: passwordx)
21
+ def login(usernamex=nil, passwordx=nil, username: usernamex, password: passwordx)
17
22
  @fw.login(username, password)
18
23
  end
19
24
 
25
+ def save_cookies(file)
26
+ @fw.save_cookies file
27
+ end
28
+
20
29
  def balance()
21
- @fw.account.balance
30
+
31
+ raise FeSipgateErr, 'not logged in?' unless @fw.browser.title == 'sipgate | App'
32
+
33
+ r = @fw.links.keys.find {|x| x =~ /Balance:/}
34
+ balance = r[/(?<=Balance: ).*/]
35
+
22
36
  end
23
37
 
24
38
  def quit()
25
39
  @fw.quit
26
40
  end
41
+
27
42
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fe_sipgate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  9RjWGoTvIC/ayz8HpeM1FEJFf6hLgakUv24Ur88IBEqecLuuJ0QtxrIPApNa4iLB
36
36
  CgUNFIdBvVxtKE1et6Odk430
37
37
  -----END CERTIFICATE-----
38
- date: 2022-03-30 00:00:00.000000000 Z
38
+ date: 2022-08-04 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ferrumwizard
@@ -43,20 +43,20 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.2'
46
+ version: '0.3'
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.2.1
49
+ version: 0.3.4
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '0.2'
56
+ version: '0.3'
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 0.2.1
59
+ version: 0.3.4
60
60
  description:
61
61
  email: digital.robertson@gmail.com
62
62
  executables: []
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.2.22
86
+ rubygems_version: 3.3.7
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Uses Ferrum to login to Sipgate with your credentials to query the account
metadata.gz.sig CHANGED
Binary file