From b7b1b872fd0ffdc9c4d738c677cf2ade540850b4 Mon Sep 17 00:00:00 2001 From: noraj Date: Fri, 7 May 2021 17:49:08 +0200 Subject: [PATCH] documentation update --- docs/yard/PassStation.html | 4 +- docs/yard/PassStation/DB.html | 990 ++---------------- docs/yard/PassStation/Output.html | 4 +- docs/yard/PassStation/Output/Csv.html | 4 +- docs/yard/PassStation/Output/Json.html | 4 +- docs/yard/PassStation/Output/PrettyTable.html | 4 +- docs/yard/PassStation/Output/Table.html | 4 +- docs/yard/PassStation/Output/Yaml.html | 4 +- docs/yard/Version.html | 6 +- docs/yard/_index.html | 4 +- docs/yard/file.LICENSE.html | 4 +- docs/yard/file.README.html | 4 +- docs/yard/index.html | 4 +- docs/yard/method_list.html | 70 +- docs/yard/top-level-namespace.html | 4 +- 15 files changed, 122 insertions(+), 992 deletions(-) diff --git a/docs/yard/PassStation.html b/docs/yard/PassStation.html index 88833a5..dd37755 100644 --- a/docs/yard/PassStation.html +++ b/docs/yard/PassStation.html @@ -137,9 +137,9 @@

Constants included diff --git a/docs/yard/PassStation/DB.html b/docs/yard/PassStation/DB.html index c2a31e8..33c5365 100644 --- a/docs/yard/PassStation/DB.html +++ b/docs/yard/PassStation/DB.html @@ -387,150 +387,6 @@

+ +

Returns:

+ - - - - - - -

Options Hash (opts):

- - - -

Returns:

- - - - - - - -
-
-
-
-54
-55
-56
-57
-58
-59
-60
-61
-
-
# File 'lib/pass_station/search.rb', line 54
-
-def build_regexp(term, opts = {})
-  opts[:sensitive] ||= false
-  if opts[:sensitive]
-    Regexp.new(term, Regexp::EXTENDED)
-  else
-    Regexp.new(term, Regexp::EXTENDED | Regexp::IGNORECASE)
-  end
-end
-
- - -
-

- - #column_selector(col, rgxp) ⇒ Proc (protected) - - - - - -

-
- -

Choose in which column the search will be performed and build the condition to use

- - -
-
-
-

Parameters:

-
    - -
  • - - col - - - (Symbol) - - - - — -
    -

    the column to search in: :productvendor | :username | :password | :all (all columns)

    -
    - -
  • - -
  • - - rgxp - - - (Regexp) - - - - — -
    -

    the search regexp (generated by #build_regexp)

    -
    - -
  • - -
- -

Returns:

-
    - -
  • - - - (Proc) - - - - — -
    -

    the proc condition to use for searching

    -
    - -
  • - -
- -
- - - - -
-
-
-
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-
-
# File 'lib/pass_station/search.rb', line 27
-
-def column_selector(col, rgxp)
-  proc { |row|
-    if col == :all
-      row[:productvendor].match?(rgxp) || row[:username].match?(rgxp) ||
-        row[:password].match?(rgxp)
-    else
-      row[col].match?(rgxp)
-    end
-  }
-end
-
-
- -
-

- - #csv_configObject (protected) - - - - - -

-
- -

Register CSV converters for parsing

- - -
-
-
- - -
- - - - -
-
-
-
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-
-
# File 'lib/pass_station/parse.rb', line 11
-
-def csv_config
-  strip_converter = proc { |field| field.strip }
-  CSV::Converters[:strip] = strip_converter
-  # https://github.com/ruby/csv/issues/208
-  # @config[:strip] = true
-  # @config[:liberal_parsing] = true
-  @config[:headers] = true
-  @config[:converters] = :strip
-  @config[:header_converters] = :symbol
-  @config[:empty_value] = '<blank>'
-  @config[:nil_value] = '<blank>'
-end
-
-
- -
-

- - #data_nil?Boolean (protected) - - - - - -

-
- -

Raise an error is data attribute is nil

- - -
-
-
- -

Returns:

-
    - -
  • - - - (Boolean) - - - -
  • - -
- -
- - - - -
-
-
-
-64
-65
-66
-
-
# File 'lib/pass_station/search.rb', line 64
-
-def data_nil?
-  raise 'You must use the parse method to polutate the data attribute first' if @data.nil?
-end
-
-
- -
-

- - #database_exists?Boolean (protected) - - - - - -

-
- -

Check if the password database exists

- - -
-
-
- -

Returns:

-
    - -
  • - - - (Boolean) - - - - — -
    -

    true if the file exists

    -
    - -
  • - -
- -
- - - - -
-
-
-
-53
-54
-55
-56
-57
-58
-
-
# File 'lib/pass_station.rb', line 53
-
-def database_exists?
-  exists = File.file?(@database_path)
-  raise "Database does not exist: #{@database_path}" unless exists
-
-  exists
-end
-
-
- -
-

- - #highlight_found(term, text, sensitive) ⇒ Array<String> - - - - - -

-
- -

Highlight (colorize) a searched term in the input When used with the search command, it will ignore in which column the search was made, and will instead colorize in every columns.

- - -
-
-
-

Parameters:

-
    - -
  • - - term - - - (String) - - - - — -
    -

    the searched term

    -
    - -
  • - -
  • - - text - - - (String) - - - - — -
    -

    the output in which the colorization must be made

    -
    - -
  • - -
  • - - sensitive - - - (Boolean) - - - - — -
    -

    case sensitive or not

    -
    - -
  • - -
- -

Returns:

-
    - -
  • - - - (Array<String>) - - - - — -
    -

    colorized output

    -
    - -
  • - -
- -
- - - - -
-
-
-
-47
-48
-49
-50
-51
-52
-
-
# File 'lib/pass_station/output.rb', line 47
-
-def highlight_found(term, text, sensitive)
-  text.map do |x|
-    rgxp = build_regexp(term, sensitive: sensitive)
-    x.gsub(rgxp) { |s| Paint[s, :red] }
-  end
-end
-
-
- -
-

- - #normalize(formatter) ⇒ String (protected) - - - - - -

-
- -

Normalize string to be class name compatible Join splitted words and capitalize

- - -
-
-
-

Parameters:

-
    - -
  • - - formatter - - - (String) - - - - — -
    -

    formatter name

    -
    - -
  • - -
- -

Returns:

-
    - -
  • - - - (String) - - - - — -
    -

    normalized name (class compatible)

    -
    - -
  • - -
- -
- - - - -
-
-
-
-58
-59
-60
-
-
# File 'lib/pass_station/output.rb', line 58
-
-def normalize(formatter)
-  formatter.split('-').map(&:capitalize).join
-end
-
-
- -
-

- - #output(formatter, data) ⇒ Array<String> - - - - - -

-
- -

Output the data in the chosen format

- - -
-
-
-

Parameters:

-
    - -
  • - - formatter - - - (String) - - - - — -
    -

    Engine to use to format the data: table, 'pretty-table', JSON, CSV, YAML

    -
    - -
  • - -
  • - - data - - - (Array<CSV::Row>) - - - -
  • - -
- -

Returns:

-
    - -
  • - - - (Array<String>) - - - - — -
    -

    formatted output

    +

    formatted output

  • @@ -2565,7 +1813,7 @@

    # File 'lib/pass_station/output.rb', line 34
     
     def output_search(formatter)
    -  return '[-] No result' if @search_result.empty?
    +  return [] if @search_result.empty?
     
       output(formatter, @search_result)
     end
    @@ -2657,60 +1905,6 @@

    -

- -
-

- - #prepare_search(term, opts = {}) ⇒ Object (protected) - - - - - -

-
- -

Prepare search query Check if data available, prepare the regexp, and clean previous search results

- - -
-
-
- - -

See Also:

- - -
- - - - -
-
-
-
-42
-43
-44
-45
-46
-47
-
-
# File 'lib/pass_station/search.rb', line 42
-
-def prepare_search(term, opts = {})
-  data_nil?
-  r1 = build_regexp(term, opts)
-  @search_result = []
-  r1
-end
-
@@ -2790,7 +1984,7 @@

See Also:

@@ -2830,9 +2024,9 @@

diff --git a/docs/yard/PassStation/Output.html b/docs/yard/PassStation/Output.html index ad8171a..1c1205e 100644 --- a/docs/yard/PassStation/Output.html +++ b/docs/yard/PassStation/Output.html @@ -116,9 +116,9 @@

Overview

diff --git a/docs/yard/PassStation/Output/Csv.html b/docs/yard/PassStation/Output/Csv.html index 339e261..accf0f7 100644 --- a/docs/yard/PassStation/Output/Csv.html +++ b/docs/yard/PassStation/Output/Csv.html @@ -242,9 +242,9 @@

diff --git a/docs/yard/PassStation/Output/Json.html b/docs/yard/PassStation/Output/Json.html index 3d04f43..c783b76 100644 --- a/docs/yard/PassStation/Output/Json.html +++ b/docs/yard/PassStation/Output/Json.html @@ -242,9 +242,9 @@

diff --git a/docs/yard/PassStation/Output/PrettyTable.html b/docs/yard/PassStation/Output/PrettyTable.html index b753e82..1823731 100644 --- a/docs/yard/PassStation/Output/PrettyTable.html +++ b/docs/yard/PassStation/Output/PrettyTable.html @@ -739,9 +739,9 @@

diff --git a/docs/yard/PassStation/Output/Table.html b/docs/yard/PassStation/Output/Table.html index a976538..04f70b7 100644 --- a/docs/yard/PassStation/Output/Table.html +++ b/docs/yard/PassStation/Output/Table.html @@ -954,9 +954,9 @@

diff --git a/docs/yard/PassStation/Output/Yaml.html b/docs/yard/PassStation/Output/Yaml.html index b05a229..ca07262 100644 --- a/docs/yard/PassStation/Output/Yaml.html +++ b/docs/yard/PassStation/Output/Yaml.html @@ -242,9 +242,9 @@

diff --git a/docs/yard/Version.html b/docs/yard/Version.html index 2a7a801..f9e9ab1 100644 --- a/docs/yard/Version.html +++ b/docs/yard/Version.html @@ -100,7 +100,7 @@

VERSION =
-
'1.2.0'
+
'1.2.1'
@@ -116,9 +116,9 @@

diff --git a/docs/yard/_index.html b/docs/yard/_index.html index 023a83f..13147bb 100644 --- a/docs/yard/_index.html +++ b/docs/yard/_index.html @@ -213,9 +213,9 @@

Namespace Listing A-Z

diff --git a/docs/yard/file.LICENSE.html b/docs/yard/file.LICENSE.html index 06f0615..0025b20 100644 --- a/docs/yard/file.LICENSE.html +++ b/docs/yard/file.LICENSE.html @@ -70,9 +70,9 @@ diff --git a/docs/yard/file.README.html b/docs/yard/file.README.html index 5e83658..57c4b66 100644 --- a/docs/yard/file.README.html +++ b/docs/yard/file.README.html @@ -107,9 +107,9 @@

Author

diff --git a/docs/yard/index.html b/docs/yard/index.html index a72b255..f04f4b6 100644 --- a/docs/yard/index.html +++ b/docs/yard/index.html @@ -107,9 +107,9 @@

Author

diff --git a/docs/yard/method_list.html b/docs/yard/method_list.html index 08427e0..f9d487b 100644 --- a/docs/yard/method_list.html +++ b/docs/yard/method_list.html @@ -44,22 +44,6 @@

Method List