magister 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/magister.rb +9 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99a3a73489b232a4b4b7c4f5435a8ee388bbbd53064a06c37fd0f56ab308d254
|
4
|
+
data.tar.gz: 303623d5ce96029db9ad72fbb34e1c017234d1a52d183090777b6302b91b3874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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-
|
11
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|