pass-station 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pass_station.rb +12 -2
- data/lib/pass_station/version.rb +1 -1
- 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: de78073153cfa19fcf83469e7071697028d293cda138bdbe8750f83accd1ab47
|
4
|
+
data.tar.gz: 1a9f43bae03edfe30496fd7a212ff3b40795d6abf3921b8eccd09b1d08c29056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf4565ed065a7276f56d17fb35fac8db4f16564a69e787b634a040f5eebbe5b04af65fc512ab243f274dbc38bf3ad05137c6b1d4c981fbace0c7cc2dc182397
|
7
|
+
data.tar.gz: 287f4d46535d6d912595152ecfcba98e384f1a22310e372ce3b70ec09354c1ce43749049629658adefe6ac5a0945ab0a48982eb0a0ae21c9d7fcdf925d1f1448
|
data/lib/pass_station.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Ruby internal
|
4
|
+
require 'pathname'
|
3
5
|
# Project internal
|
4
6
|
require 'pass_station/source'
|
5
7
|
require 'pass_station/parse'
|
@@ -30,7 +32,7 @@ module PassStation
|
|
30
32
|
def initialize
|
31
33
|
@storage_location = 'data/'
|
32
34
|
@database_name = 'DefaultCreds-Cheat-Sheet.csv'
|
33
|
-
@database_path =
|
35
|
+
@database_path = absolute_db_path
|
34
36
|
database_exists?
|
35
37
|
@config = {}
|
36
38
|
csv_config
|
@@ -38,6 +40,14 @@ module PassStation
|
|
38
40
|
@search_result = []
|
39
41
|
end
|
40
42
|
|
43
|
+
# Find the absolute path of the DB from its relative location
|
44
|
+
# @return [String] absolute filename of the DB
|
45
|
+
def absolute_db_path
|
46
|
+
pn = Pathname.new(__FILE__)
|
47
|
+
install_dir = pn.dirname.parent.to_s + Pathname::SEPARATOR_LIST
|
48
|
+
install_dir + @storage_location + @database_name
|
49
|
+
end
|
50
|
+
|
41
51
|
# Check if the password database exists
|
42
52
|
# @return [Boolean] +true+ if the file exists
|
43
53
|
def database_exists?
|
@@ -47,6 +57,6 @@ module PassStation
|
|
47
57
|
exists
|
48
58
|
end
|
49
59
|
|
50
|
-
protected :database_exists
|
60
|
+
protected :database_exists?, :absolute_db_path
|
51
61
|
end
|
52
62
|
end
|
data/lib/pass_station/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pass-station
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre ZANNI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docopt
|