magister 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/magister.rb +9 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d4013917db1501eda0924a787e95db303ea9d7a3db6a460e44195b3acab37d9
4
- data.tar.gz: 83bb2ccd6c25a015d7b658bbe3a39c3321d5d083f87a4ee82e8916bebffc6712
3
+ metadata.gz: 99a3a73489b232a4b4b7c4f5435a8ee388bbbd53064a06c37fd0f56ab308d254
4
+ data.tar.gz: 303623d5ce96029db9ad72fbb34e1c017234d1a52d183090777b6302b91b3874
5
5
  SHA512:
6
- metadata.gz: e140dfad3980e5940557361bc319aaedc2270dbfa336fdccb73a776d9e6ccb25d84ffe686e5b739aed86d7ecdd0189a4b42c5ba818c30e95478953d3ad0bf7c1
7
- data.tar.gz: 9b0f53e39c5baa249e70811390475583613b4727ab9f9cda45d7e5e501b834dc118d331377a605bd4a0ffde7739c83cf141a9381ae90d23bbbe76a5ea0413d90
6
+ metadata.gz: 2cbe93376dea465db45568e79da311ab2cdc021552cc2b6fd44310341c5abb12e382e0fac8672b52cfb7c1830467a6d5162fca15697b8eb58eaca88887144c1b
7
+ data.tar.gz: 914d34d81a63348fece269eab460e8db65e3f63100476900ceaf33830b78f5935082987322c7450328e0fa88aa4dc058627650f422cfbfe3d2ab6b7c27f78037
data/lib/magister.rb CHANGED
@@ -14,12 +14,6 @@ $authMode = "selenium"
14
14
  $magister_useCache = true
15
15
  $magister_cachingDirectory = ".cache/magister"
16
16
 
17
- prev = ""
18
- $magister_cachingDirectory.split("/").each do |directory|
19
- Dir.mkdir(prev + directory) unless File.exist?(prev + directory)
20
- prev += directory + "/"
21
- end
22
-
23
17
  # Cache type can eitehr be "compact" or "json"
24
18
  $magister_cacheType = "json"
25
19
  # Wether to encrypt the cache, this can secure the acount by not exposing the token or any sensetive data.
@@ -35,6 +29,14 @@ class Magister
35
29
  # @since 1.0.0
36
30
  def initialize
37
31
  @profile = nil
32
+
33
+ if $magister_useCache
34
+ prev = ""
35
+ $magister_cachingDirectory.split("/").each do |directory|
36
+ Dir.mkdir(prev + directory) unless File.exist?(prev + directory)
37
+ prev += directory + "/"
38
+ end
39
+ end
38
40
  end
39
41
 
40
42
  # Create a new profile and authenticate with a token
@@ -53,6 +55,7 @@ class Magister
53
55
  # @since 1.1.0
54
56
  def login(school, username, password)
55
57
  @profile = Authenticator.login(username, password, school)
58
+ @profile.verify
56
59
  end
57
60
 
58
61
  # Get the users profile
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magister
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riley0122
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-21 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json