pass-station 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12c331db3e7fcee2924f24bb97d63319642414e8bd7b0c04005b48e8dc4f111c
4
- data.tar.gz: b8b8f2a92526afc046b5ae6a011aa3967475d8d6a57cbdceee6670a9bf0c585f
3
+ metadata.gz: de78073153cfa19fcf83469e7071697028d293cda138bdbe8750f83accd1ab47
4
+ data.tar.gz: 1a9f43bae03edfe30496fd7a212ff3b40795d6abf3921b8eccd09b1d08c29056
5
5
  SHA512:
6
- metadata.gz: e20f71eee6eccc0eab06c0485eba0d358ed1053926333aab03e1e240f35775c2e5cdef2b69b3335353be101a983f142d5964d5564fae0627ada21ed6d4a29ab7
7
- data.tar.gz: 670188256f1790be404edad7b3214d53ef26afb0920d710e9cfd1f3afdb8f6810603853b3f314a1566a258dc485587d3f3b2fbb599d661a236bb426096b60280
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 = @storage_location + @database_name
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Version
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
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.1.0
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-15 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt