magister 1.2.0 → 1.2.1

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 +8 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d4013917db1501eda0924a787e95db303ea9d7a3db6a460e44195b3acab37d9
4
- data.tar.gz: 83bb2ccd6c25a015d7b658bbe3a39c3321d5d083f87a4ee82e8916bebffc6712
3
+ metadata.gz: bd94a0cc6b6ee2470916892afd0c9ffe626d2c7a31acd3fc2bd7e7e4485415bc
4
+ data.tar.gz: 21f397e67ca49836e84af7fd83a425223a30b385e41a116149c2a0b02074fce4
5
5
  SHA512:
6
- metadata.gz: e140dfad3980e5940557361bc319aaedc2270dbfa336fdccb73a776d9e6ccb25d84ffe686e5b739aed86d7ecdd0189a4b42c5ba818c30e95478953d3ad0bf7c1
7
- data.tar.gz: 9b0f53e39c5baa249e70811390475583613b4727ab9f9cda45d7e5e501b834dc118d331377a605bd4a0ffde7739c83cf141a9381ae90d23bbbe76a5ea0413d90
6
+ metadata.gz: 53033d79c500d959a80a63f83763091ff28900fdc52356f789022b69da6bce591e53961c7ab30254eff05df8906528daa2acf03ef3ee4336359b4176d29cc732
7
+ data.tar.gz: 6b5762af287bbaf677e06d50462d4284856de1817f0c9afa9f76d0b96f3cb03303eebc8926edffbc8eca28ac697a52220641eb2b545ed16ee7b43638e2ccec20
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
metadata CHANGED
@@ -1,7 +1,7 @@
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riley0122