pad_sec 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c528f7c1eeec8b88033fdf571cd6c4f3218c84a3
4
- data.tar.gz: 4cfe641c1ea467b5d37aea0789b5784603e99baf
3
+ metadata.gz: 8dd736baa5051a20e5c9185a1a3e8639ac0667b3
4
+ data.tar.gz: ce915f22ce0e6f41728d9499389ac0ce7c034d83
5
5
  SHA512:
6
- metadata.gz: 84cab7a714450c4a06679a6d2dcfa30af37e223b3db13a826c089eb0a491f12523178a399beba4540dd2a41b0f2460aeba7e2bf1290b2007338ba813cf111a54
7
- data.tar.gz: f7c72ef63f85f2d688d017f2d0b2294b8d4df4aa92c5c4b81fa7ccfc66693b4ea09bf0422d0bc17582b6ae9f688afc64a0b7d7391bdefc517536cf66815c9bec
6
+ metadata.gz: 8e38097816efd3cb42f15d4affb92093edfcc6795c1aa777d19ca7b1248ede4b2fdd95cb19b8c9b18dbcef12c243806c1a72126905ae8388fb01e0efa715d74b
7
+ data.tar.gz: fefb51f0621729a33a52f40ed927f6fc8881d8b80bf79790153ca5ee1498741480e4a8bbf40937e1c405ecca02e33eebe1e53aa72c918b4f390589462c482907
@@ -46,6 +46,25 @@ module PadSec
46
46
  authenticate
47
47
  end
48
48
 
49
+
50
+ # Gets the current token.
51
+ #
52
+ # @return [String, Void] token or nil
53
+ def self.get_token
54
+ token = nil
55
+ config_file = PadSec::ConfigFile::path
56
+
57
+ if PadUtils.file_exist?(config_file)
58
+ config = PadUtils.json_file_to_hash(config_file)
59
+ if !config[:token].nil?
60
+ token = config[:token]
61
+ end
62
+ end
63
+
64
+ token
65
+
66
+ end
67
+
49
68
  private
50
69
 
51
70
 
@@ -110,7 +129,7 @@ module PadSec
110
129
  # Tries to authenticate with a username and password.
111
130
  #
112
131
  # @param username [String]
113
- # @param password [String]
132
+ # @param pwd [String]
114
133
  # @return [Boolean]
115
134
  # @example
116
135
  # PadSec.authenticate_with_username(username: "Bob", pwd: "1234") # => true
@@ -1,4 +1,4 @@
1
1
  module PadSec
2
2
  # Gem version
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pad_sec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Schuele