Skip to content

Commit

Permalink
doc: update and enhancement + prepare new version
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Feb 2, 2025
1 parent 69ee7d8 commit fa185f3
Show file tree
Hide file tree
Showing 22 changed files with 175 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT
PATH
remote: .
specs:
pass-station (1.4.0)
pass-station (2.0.0)
docopt (~> 0.6)
paint (~> 2.3)

Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Fanciness:
- Colored help message
- Add examples and project links to help message
- Documentation:
- Rework the publishing process
- Use syntax highlight for shell commands without output
- Chore:
- Add support for Ruby 3.2, 3.3, 3.4
- **Breaking change**: Drop support for Ruby 2.6, 2.7, 3.0
Expand Down
14 changes: 7 additions & 7 deletions docs/pages/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ See [Usage](pages/usage.md?id=cli).

### Serve locally

```plaintext
$ npm i docsify-cli -g
$ docsify serve docs
```bash
npm i docsify-cli -g
docsify serve docs
```

## Library doc
Expand All @@ -23,14 +23,14 @@ You can consult it online [here](https://noraj.github.io/pass-station/yard/).

For developers who only want to use the library.

```plaintext
$ bundle exec yard doc
```bash
bundle exec yard doc
```

### Building locally: for project developer

For developers who want to participate to development of the project.

```plaintext
$ bundle exec yard doc --yardopts .yardopts-dev
```bash
bundle exec yard doc --yardopts .yardopts-dev
```
42 changes: 17 additions & 25 deletions docs/pages/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

### Install from rubygems.org

```plaintext
$ gem install pass-station
```bash
gem install pass-station
```

Gem: [pass-station](https://rubygems.org/gems/pass-station)
Expand All @@ -14,41 +14,33 @@ Gem: [pass-station](https://rubygems.org/gems/pass-station)

From the repository:

```plaintext
# pacman -S pass-station
```bash
pacman -S pass-station
```

PKGBUILD: [pass-station](https://github.com/BlackArch/blackarch/blob/master/packages/pass-station/PKGBUILD)

### Install from Pentoo

From the repository:

```plaintext
# emerge TODO/pass-station
```

## Development

It's better to use [rbenv](https://github.com/rbenv/rbenv) or [asdf](https://github.com/asdf-vm/asdf) to have latests version of ruby and to avoid trashing your system ruby.

### Install from rubygems.org

```plaintext
$ gem install --development pass-station
```bash
gem install --development pass-station
```

### Build from git

Just replace `x.x.x` with the gem version you see after `gem build`.

```plaintext
$ git clone https://github.com/noraj/pass-station.git pass-station
$ cd pass-station
$ gem install bundler
$ bundler install
$ gem build pass-station.gemspec
$ gem install pass-station-x.x.x.gem
```bash
git clone https://github.com/noraj/pass-station.git pass-station
cd pass-station
gem install bundler
bundler install
gem build pass-station.gemspec
gem install pass-station-x.x.x.gem
```

Note: if an automatic install is needed you can get the version with `$ gem build pass-station.gemspec | grep Version | cut -d' ' -f4`.
Expand All @@ -57,13 +49,13 @@ Note: if an automatic install is needed you can get the version with `$ gem buil

From local file:

```plaintext
$ irb -Ilib -rpass_station
```bash
irb -Ilib -rpass_station
```

Same for the CLI tool:

```plaintext
$ ruby -Ilib -rpass_station bin/pass-station
```bash
ruby -Ilib -rpass_station bin/pass-station
```

50 changes: 30 additions & 20 deletions docs/pages/publishing.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
# Publishing

## On Rubygems.org
Change version in `lib/pass_station/version.rb`.

```plaintext
$ git tag -a vx.x.x
$ git push --follow-tags
$ gem push pass-station-x.x.x.gem
Be sure all tests pass!

```bash
bundle exec rake test
```

See https://guides.rubygems.org/publishing/.
Ensure there is no linting offence.

```bash
bundle exec rubocop
```

On new release don't forget to rebuild the library documentation:
Check if new upstream data is available.

```plaintext
$ bundle exec yard doc
```bash
pass-station update --check
```

And to be sure all tests pass!
If so, update data:

```plaintext
$ rake
```bash
pass-station update --force data/
```

## On BlackArch
And reflect the integrity hash in `PassStation::DB::UPSTREAM_DATABASE` in `lib/pass_station/source.rb`.

BA process
```bash
sha256sum data/*.csv
```

On new release don't forget to rebuild the library documentation:
Don't forget to rebuild the library documentation to reflect, new code, new version, etc.:

```plaintext
$ bundle exec yard doc
```bash
bundle exec yard doc
```

And to be sure all tests pass!
```bash
git tag -a vx.x.x
git push --follow-tags

```plaintext
$ rake
bundle exec rake build
gem push pkg/pass-station-x.x.x.gem
```

See https://guides.rubygems.org/publishing/.
4 changes: 2 additions & 2 deletions docs/pages/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Quick install

```plaintext
$ gem install pass-station
```bash
gem install pass-station
```

See [Installation](/pages/install)
Expand Down
6 changes: 3 additions & 3 deletions docs/yard/PassStation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>
Module: PassStation

&mdash; Documentation by YARD 0.9.28
&mdash; Documentation by YARD 0.9.36

</title>

Expand Down Expand Up @@ -136,9 +136,9 @@ <h3 class="inherited">Constants included
</div>

<div id="footer">
Generated on Sat Sep 10 16:13:06 2022 by
Generated on Sun Feb 2 14:23:26 2025 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-3.1.0).
0.9.36 (ruby-3.4.1).
</div>

</div>
Expand Down
36 changes: 18 additions & 18 deletions docs/yard/PassStation/DB.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>
Class: PassStation::DB

&mdash; Documentation by YARD 0.9.28
&mdash; Documentation by YARD 0.9.36

</title>

Expand Down Expand Up @@ -130,7 +130,7 @@ <h2>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>DEFAULT_CREDENTIALS_CHEAT_SHEET:</span> <span class='lbrace'>{</span>
<span class='label'>URL:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://raw.githubusercontent.com/ihebski/DefaultCreds-cheat-sheet/main/DefaultCreds-Cheat-Sheet.csv</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>HASH:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>f03f3ed77a8a932b1b2891fbec705d42b1eec4911fb76ccf36cde9e79a385556</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>HASH:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>6494a05090e14c438c9fa110f1566b3b7b9e2518bd0b8c42255f0dd3f7dff77b</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>FILENAME:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>DefaultCreds-Cheat-Sheet.csv</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>COLUMNS:</span> <span class='lbrace'>{</span>
<span class='label'>productvendor:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Product/Vendor</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
Expand All @@ -140,7 +140,7 @@ <h2>
<span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>MANY_PASSWORDS:</span> <span class='lbrace'>{</span>
<span class='label'>URL:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>https://raw.githubusercontent.com/many-passwords/many-passwords/main/passwords.csv</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>HASH:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>293ce4411446c702aeda977b9a446ff42d045d980be0b5287a848b5bd7d39402</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>HASH:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>5eb85093f03dcc6a377fe7263e0629574088892dc283d5f53f93d1db80c7287a</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>FILENAME:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>many-passwords.csv</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
<span class='label'>COLUMNS:</span> <span class='lbrace'>{</span>
<span class='label'>vendor:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Vendor</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
Expand Down Expand Up @@ -747,7 +747,7 @@ <h3 class="signature " id="database_name-instance_method">


&mdash;
<div class='inline'><p>password database filename. Default to
<div class='inline'><p>password database filename. Default to<br />
<code>DefaultCreds-Cheat-Sheet.csv</code>.</p>
</div>

Expand Down Expand Up @@ -899,7 +899,7 @@ <h3 class="signature first" id="check_for_update-class_method">

<span class='kw'>def</span> <span class='id identifier rubyid_check_for_update'>check_for_update</span>
<span class='id identifier rubyid_ret_vals'>ret_vals</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='const'><span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span></span><span class='lbracket'>[</span><span class='symbol'>:MAPPING</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid__k'>_k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
<span class='const'><span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span></span><span class='lbracket'>[</span><span class='symbol'>:MAPPING</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_each_value'>each_value</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span>
<span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='id identifier rubyid_download_file'>download_file</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:URL</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='const'>Dir</span><span class='period'>.</span><span class='id identifier rubyid_mktmpdir'>mktmpdir</span><span class='rparen'>)</span>
<span class='comment'># Same hash = no update
</span> <span class='id identifier rubyid_ret_vals'>ret_vals</span> <span class='op'>&lt;&lt;</span> <span class='op'>!</span><span class='id identifier rubyid_check_hash'>check_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:HASH</span><span class='rbracket'>]</span><span class='rparen'>)</span>
Expand Down Expand Up @@ -974,7 +974,7 @@ <h3 class="signature " id="check_hash-class_method">


&mdash;
<div class='inline'><p>if the hash of the file matched the one provided (<code>true</code>)
<div class='inline'><p>if the hash of the file matched the one provided (<code>true</code>)<br />
or not (<code>false</code>).</p>
</div>

Expand Down Expand Up @@ -1058,7 +1058,7 @@ <h3 class="signature " id="download_file-class_method">


&mdash;
<div class='inline'><p>the destination path (may
<div class='inline'><p>the destination path (may<br />
overwrite existing file).</p>
</div>

Expand Down Expand Up @@ -1100,7 +1100,7 @@ <h3 class="signature " id="download_file-class_method">

</span>

&mdash; <div class='inline'><p>the SHA256 hash to check, if the file
&mdash; <div class='inline'><p>the SHA256 hash to check, if the file<br />
already exist and the hash matches then the download will be skipped.</p>
</div>

Expand Down Expand Up @@ -1206,7 +1206,7 @@ <h3 class="signature " id="download_upstream-class_method">


&mdash;
<div class='inline'><p>the destination path (may
<div class='inline'><p>the destination path (may<br />
overwrite existing file).</p>
</div>

Expand Down Expand Up @@ -1246,7 +1246,7 @@ <h3 class="signature " id="download_upstream-class_method">

</span>

&mdash; <div class='inline'><p>the SHA256 hash to check, if the file
&mdash; <div class='inline'><p>the SHA256 hash to check, if the file<br />
already exist and the hash matches then the download will be skipped.</p>
</div>

Expand Down Expand Up @@ -1426,7 +1426,7 @@ <h3 class="signature " id="write_file-class_method">


&mdash;
<div class='inline'><p>the file path where the fiel will be
<div class='inline'><p>the file path where the fiel will be<br />
written to disk</p>
</div>

Expand Down Expand Up @@ -1507,8 +1507,8 @@ <h3 class="signature first" id="highlight_found-instance_method">

</h3><div class="docstring">
<div class="discussion">
<p>Highlight (colorize) a searched term in the input
When used with the search command, it will ignore in which column the
<p>Highlight (colorize) a searched term in the input<br />
When used with the search command, it will ignore in which column the<br />
search was made, and will instead colorize in every columns.</p>


Expand Down Expand Up @@ -1907,7 +1907,7 @@ <h3 class="signature " id="parse-instance_method">


&mdash;
<div class='inline'><p>table of <code>CSV::Row</code>, each row contains multiple
<div class='inline'><p>table of <code>CSV::Row</code>, each row contains multiple<br />
attributes (columns depends on the database source, see <span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span>)</p>
</div>

Expand Down Expand Up @@ -1987,7 +1987,7 @@ <h3 class="signature " id="search-instance_method">


&mdash;
<div class='inline'><p>the column to search in: column name (columns depends on the database source, see
<div class='inline'><p>the column to search in: column name (columns depends on the database source, see<br />
<span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span>) or :all (all columns)</p>
</div>

Expand All @@ -2006,7 +2006,7 @@ <h3 class="signature " id="search-instance_method">


&mdash;
<div class='inline'><p>table of <code>CSV::Row</code>, each row contains multiple
<div class='inline'><p>table of <code>CSV::Row</code>, each row contains multiple<br />
attributes (columns depends on the database source, see <span class='object_link'><a href="#UPSTREAM_DATABASE-constant" title="PassStation::DB::UPSTREAM_DATABASE (constant)">UPSTREAM_DATABASE</a></span>)</p>
</div>

Expand Down Expand Up @@ -2059,9 +2059,9 @@ <h3 class="signature " id="search-instance_method">
</div>

<div id="footer">
Generated on Sat Sep 10 16:13:06 2022 by
Generated on Sun Feb 2 14:23:27 2025 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-3.1.0).
0.9.36 (ruby-3.4.1).
</div>

</div>
Expand Down
Loading

0 comments on commit fa185f3

Please sign in to comment.