Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 2ba48f6

Browse files
committed
v1.1.0
- prepare v1.1.0 - update doc for CSV, YAML, JSOn output - add tests for CSV, YAML, JSOn output
1 parent 3240860 commit 2ba48f6

25 files changed

+1059
-119
lines changed

Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
pass-station (1.0.0)
4+
pass-station (1.1.0)
55
docopt (~> 0.6)
66
paint (~> 2.2)
77

docs/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## [Unreleased]
22

3+
## [1.1.0]
4+
5+
- **Feature**: add CSV, JSON, YAML formatting
6+
- Project quality: add unit tests & CI
7+
- Minor code and doc enhancements
8+
- Gemfile: fix version compatibility (was wrongly advertised as compatible with Ruby 2.4 and 2.5 but is only with Ruby 2.6+ due to some options of the CSV parser)
9+
310
## [1.0.0]
411

512
- First version

docs/pages/examples.md

+106
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,109 @@ Xerox WorkCentre 5020/DN (printer) 11111
9393
IBM 11111111 11111111
9494
...
9595
```
96+
97+
Search default credentials for Dell products outputting in YAML:
98+
99+
```plaintext
100+
$ pass-station search dell --output yaml
101+
---
102+
- :productvendor: Dell
103+
:username: admin
104+
:password: admin
105+
- :productvendor: Dell
106+
:username: Admin
107+
:password: "<blank>"
108+
- :productvendor: Dell
109+
:username: Administrator
110+
:password: storageserver
111+
- :productvendor: Dell
112+
:username: admin
113+
:password: password
114+
- :productvendor: Dell
115+
:username: "<blank>"
116+
:password: 1RRWTTOOI
117+
- :productvendor: Dell
118+
:username: "<blank>"
119+
:password: admin
120+
- :productvendor: Dell
121+
:username: "<blank>"
122+
:password: Dell
123+
- :productvendor: Dell
124+
:username: "<blank>"
125+
:password: Fireport
126+
- :productvendor: Dell
127+
:username: "<blank>"
128+
:password: nz0u4bbe
129+
- :productvendor: Dell
130+
:username: rapport
131+
:password: r@p8p0r+
132+
- :productvendor: Dell
133+
:username: root
134+
:password: calvin
135+
- :productvendor: Dell
136+
:username: root
137+
:password: wyse
138+
- :productvendor: Dell
139+
:username: VNC
140+
:password: winterm
141+
- :productvendor: DELL IDARC (web)
142+
:username: root
143+
:password: calvin
144+
- :productvendor: Dell iDRAC (web)
145+
:username: root
146+
:password: calvin
147+
```
148+
149+
Search default credentials for Draytek products outputting in JSON (with and without [jq][jq] formatting):
150+
151+
```plaintext
152+
$ pass-station search Draytek --output json
153+
[{"productvendor":"Draytek","username":"admin","password":"admin"},{"productvendor":"Draytek","username":"admin","password":"<blank>"},{"productvendor":"Draytek","username":"draytek","password":"1234"},{"productvendor":"Draytek","username":"Draytek","password":"1234"},{"productvendor":"Draytek Corp","username":"admin","password":"<blank>"}]
154+
155+
$ pass-station search Draytek --output json --no-color | jq
156+
[
157+
{
158+
"productvendor": "Draytek",
159+
"username": "admin",
160+
"password": "admin"
161+
},
162+
{
163+
"productvendor": "Draytek",
164+
"username": "admin",
165+
"password": "<blank>"
166+
},
167+
{
168+
"productvendor": "Draytek",
169+
"username": "draytek",
170+
"password": "1234"
171+
},
172+
{
173+
"productvendor": "Draytek",
174+
"username": "Draytek",
175+
"password": "1234"
176+
},
177+
{
178+
"productvendor": "Draytek Corp",
179+
"username": "admin",
180+
"password": "<blank>"
181+
}
182+
]
183+
```
184+
185+
[jq]:https://stedolan.github.io/jq/
186+
187+
Search default credentials for Edimax products outputting in CSV:
188+
189+
```plaintext
190+
$ pass-station search Edimax --output csv
191+
productvendor,username,password
192+
Edimax,admin,123
193+
Edimax,admin,1234
194+
Edimax,admin,<blank>
195+
Edimax,admin,epicrouter
196+
Edimax,admin,password
197+
Edimax,admin,su@psir
198+
Edimax,edimax,software01
199+
Edimax,guest,1234
200+
Edimax,guest,<blank>
201+
```

docs/yard/PassStation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h3 class="inherited">Constants included
137137
</div>
138138

139139
<div id="footer">
140-
Generated on Tue Mar 9 09:14:06 2021 by
140+
Generated on Mon Mar 15 11:11:44 2021 by
141141
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
142142
0.9.26 (ruby-2.7.2).
143143
</div>

docs/yard/PassStation/DB.html

+34-42
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collaps
141141
<li class="public ">
142142
<span class="summary_signature">
143143

144-
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> &#x21d2; CSV::Table </a>
144+
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> &#x21d2; Array&lt;CSV::Row&gt; </a>
145145

146146

147147

@@ -161,7 +161,7 @@ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collaps
161161

162162

163163
<span class="summary_desc"><div class='inline'>
164-
<p>Get the password database in <code>CSV::Table</code> format.</p>
164+
<p>Get the password database in <tt>Array&lt;CSV::Row&gt;</tt> format.</p>
165165
</div></span>
166166

167167
</li>
@@ -656,7 +656,7 @@ <h2>
656656
<li class="public ">
657657
<span class="summary_signature">
658658

659-
<a href="#parse-instance_method" title="#parse (instance method)">#<strong>parse</strong>(sort = :productvendor) &#x21d2; CSV::Table </a>
659+
<a href="#parse-instance_method" title="#parse (instance method)">#<strong>parse</strong>(sort = :productvendor) &#x21d2; Array&lt;CSV::Row&gt; </a>
660660

661661

662662

@@ -704,7 +704,7 @@ <h2>
704704
<li class="public ">
705705
<span class="summary_signature">
706706

707-
<a href="#search-instance_method" title="#search (instance method)">#<strong>search</strong>(term, col, opts = {}) &#x21d2; CSV::Table </a>
707+
<a href="#search-instance_method" title="#search (instance method)">#<strong>search</strong>(term, col, opts = {}) &#x21d2; Array&lt;CSV::Row&gt; </a>
708708

709709

710710

@@ -757,19 +757,19 @@ <h3 class="signature first" id="initialize-instance_method">
757757
<pre class="lines">
758758

759759

760+
30
761+
31
760762
32
761763
33
762764
34
763765
35
764766
36
765767
37
766768
38
767-
39
768-
40
769-
41</pre>
769+
39</pre>
770770
</td>
771771
<td>
772-
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 32</span>
772+
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 30</span>
773773

774774
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
775775
<span class='ivar'>@storage_location</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>data/</span><span class='tstring_end'>&#39;</span></span>
@@ -796,7 +796,7 @@ <h2>Instance Attribute Details</h2>
796796
<div class="method_details first">
797797
<h3 class="signature first" id="data-instance_method">
798798

799-
#<strong>data</strong> &#x21d2; <tt>CSV::Table</tt> <span class="extras">(readonly)</span>
799+
#<strong>data</strong> &#x21d2; <tt>Array&lt;CSV::Row&gt;</tt> <span class="extras">(readonly)</span>
800800

801801

802802

@@ -805,7 +805,7 @@ <h3 class="signature first" id="data-instance_method">
805805
</h3><div class="docstring">
806806
<div class="discussion">
807807

808-
<p>Get the password database in <code>CSV::Table</code> format</p>
808+
<p>Get the password database in <tt>Array&lt;CSV::Row&gt;</tt> format</p>
809809

810810

811811
</div>
@@ -818,7 +818,7 @@ <h3 class="signature first" id="data-instance_method">
818818
<li>
819819

820820

821-
<span class='type'>(<tt>CSV::Table</tt>)</span>
821+
<span class='type'>(<tt>Array&lt;CSV::Row&gt;</tt>)</span>
822822

823823

824824

@@ -837,12 +837,12 @@ <h3 class="signature first" id="data-instance_method">
837837
<pre class="lines">
838838

839839

840-
29
841-
30
842-
31</pre>
840+
27
841+
28
842+
29</pre>
843843
</td>
844844
<td>
845-
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 29</span>
845+
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 27</span>
846846

847847
<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
848848
<span class='ivar'>@data</span>
@@ -898,12 +898,12 @@ <h3 class="signature " id="database_name-instance_method">
898898
<pre class="lines">
899899

900900

901-
25
902-
26
903-
27</pre>
901+
23
902+
24
903+
25</pre>
904904
</td>
905905
<td>
906-
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 25</span>
906+
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 23</span>
907907

908908
<span class='kw'>def</span> <span class='id identifier rubyid_database_name'>database_name</span>
909909
<span class='ivar'>@database_name</span>
@@ -934,14 +934,6 @@ <h3 class="signature " id="storage_location-instance_method">
934934
</div>
935935
<div class="tags">
936936

937-
<div class="examples">
938-
<p class="tag_title">Examples:</p>
939-
940-
941-
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../PassStation.html" title="PassStation (module)">PassStation</a></span></span><span class='period'>.</span><span class='id identifier rubyid_storage_location'>storage_location</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/srv/downloads/</span><span class='tstring_end'>&#39;</span></span></code></pre>
942-
943-
</div>
944-
945937
<p class="tag_title">Returns:</p>
946938
<ul class="return">
947939

@@ -967,12 +959,12 @@ <h3 class="signature " id="storage_location-instance_method">
967959
<pre class="lines">
968960

969961

970-
20
971-
21
972-
22</pre>
962+
18
963+
19
964+
20</pre>
973965
</td>
974966
<td>
975-
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 20</span>
967+
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 18</span>
976968

977969
<span class='kw'>def</span> <span class='id identifier rubyid_storage_location'>storage_location</span>
978970
<span class='ivar'>@storage_location</span>
@@ -2022,15 +2014,15 @@ <h3 class="signature " id="database_exists?-instance_method">
20222014
<pre class="lines">
20232015

20242016

2017+
43
2018+
44
20252019
45
20262020
46
20272021
47
2028-
48
2029-
49
2030-
50</pre>
2022+
48</pre>
20312023
</td>
20322024
<td>
2033-
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 45</span>
2025+
<pre class="code"><span class="info file"># File 'lib/pass_station.rb', line 43</span>
20342026

20352027
<span class='kw'>def</span> <span class='id identifier rubyid_database_exists?'>database_exists?</span>
20362028
<span class='id identifier rubyid_exists'>exists</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_file?'>file?</span><span class='lparen'>(</span><span class='ivar'>@database_path</span><span class='rparen'>)</span>
@@ -2281,7 +2273,7 @@ <h3 class="signature " id="output-instance_method">
22812273
<span class='name'>data</span>
22822274

22832275

2284-
<span class='type'>(<tt>CSV::Table</tt>)</span>
2276+
<span class='type'>(<tt>Array&lt;CSV::Row&gt;</tt>)</span>
22852277

22862278

22872279

@@ -2498,7 +2490,7 @@ <h3 class="signature " id="output_search-instance_method">
24982490
<div class="method_details ">
24992491
<h3 class="signature " id="parse-instance_method">
25002492

2501-
#<strong>parse</strong>(sort = :productvendor) &#x21d2; <tt>CSV::Table</tt>
2493+
#<strong>parse</strong>(sort = :productvendor) &#x21d2; <tt>Array&lt;CSV::Row&gt;</tt>
25022494

25032495

25042496

@@ -2542,7 +2534,7 @@ <h3 class="signature " id="parse-instance_method">
25422534
<li>
25432535

25442536

2545-
<span class='type'>(<tt>CSV::Table</tt>)</span>
2537+
<span class='type'>(<tt>Array&lt;CSV::Row&gt;</tt>)</span>
25462538

25472539

25482540

@@ -2571,7 +2563,7 @@ <h3 class="signature " id="parse-instance_method">
25712563
<pre class="code"><span class="info file"># File 'lib/pass_station/parse.rb', line 28</span>
25722564

25732565
<span class='kw'>def</span> <span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_sort'>sort</span> <span class='op'>=</span> <span class='symbol'>:productvendor</span><span class='rparen'>)</span>
2574-
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='const'>CSV</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='ivar'>@database_path</span><span class='comma'>,</span> <span class='ivar'>@config</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span>
2566+
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='const'>CSV</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='lparen'>(</span><span class='ivar'>@database_path</span><span class='comma'>,</span> <span class='op'>**</span><span class='ivar'>@config</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span>
25752567
<span class='id identifier rubyid_s'>s</span><span class='lbracket'>[</span><span class='id identifier rubyid_sort'>sort</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
25762568
<span class='kw'>end</span>
25772569
<span class='kw'>end</span></pre>
@@ -2637,7 +2629,7 @@ <h3 class="signature " id="prepare_search-instance_method">
26372629
<div class="method_details ">
26382630
<h3 class="signature " id="search-instance_method">
26392631

2640-
#<strong>search</strong>(term, col, opts = {}) &#x21d2; <tt>CSV::Table</tt>
2632+
#<strong>search</strong>(term, col, opts = {}) &#x21d2; <tt>Array&lt;CSV::Row&gt;</tt>
26412633

26422634

26432635

@@ -2695,7 +2687,7 @@ <h3 class="signature " id="search-instance_method">
26952687
<li>
26962688

26972689

2698-
<span class='type'>(<tt>CSV::Table</tt>)</span>
2690+
<span class='type'>(<tt>Array&lt;CSV::Row&gt;</tt>)</span>
26992691

27002692

27012693

@@ -2751,7 +2743,7 @@ <h3 class="signature " id="search-instance_method">
27512743
</div>
27522744

27532745
<div id="footer">
2754-
Generated on Tue Mar 9 09:14:06 2021 by
2746+
Generated on Mon Mar 15 11:11:44 2021 by
27552747
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
27562748
0.9.26 (ruby-2.7.2).
27572749
</div>

docs/yard/PassStation/Output.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ <h2>Overview</h2><div class="docstring">
100100

101101

102102

103-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Output/PrettyTable.html" title="PassStation::Output::PrettyTable (class)">PrettyTable</a></span>, <span class='object_link'><a href="Output/Table.html" title="PassStation::Output::Table (class)">Table</a></span>
103+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Output/Csv.html" title="PassStation::Output::Csv (class)">Csv</a></span>, <span class='object_link'><a href="Output/Json.html" title="PassStation::Output::Json (class)">Json</a></span>, <span class='object_link'><a href="Output/PrettyTable.html" title="PassStation::Output::PrettyTable (class)">PrettyTable</a></span>, <span class='object_link'><a href="Output/Table.html" title="PassStation::Output::Table (class)">Table</a></span>, <span class='object_link'><a href="Output/Yaml.html" title="PassStation::Output::Yaml (class)">Yaml</a></span>
104104

105105

106106
</p>
@@ -116,7 +116,7 @@ <h2>Overview</h2><div class="docstring">
116116
</div>
117117

118118
<div id="footer">
119-
Generated on Tue Mar 9 09:14:06 2021 by
119+
Generated on Mon Mar 15 11:11:44 2021 by
120120
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121121
0.9.26 (ruby-2.7.2).
122122
</div>

0 commit comments

Comments
 (0)