viewworkbook 0.1.3 → 0.3

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: ca3d55e875c623f0c5f68504fa4b9c30cb599623277cd42717babd7067234554
4
- data.tar.gz: 8199d7826f4c8edd0af5367bdabb88e41b86b998e3faa2fd828f13aa21042238
3
+ metadata.gz: a4943afe2b6aa8ae15fbe68bd2fa19a7414db859dbaf929bba1a1edcbea1ebf6
4
+ data.tar.gz: ce9062cfe21a227155394e571061a346ca789c9412dd4da9e6e20d78a0aac150
5
5
  SHA512:
6
- metadata.gz: 219f9555351a4e53c995f14a591241ffbaf57b23e4acaddf91e1141228662cfa9f42779c4ac175870364942d14f008ef2fbba3029f2e47b417f4573f6243cdbf
7
- data.tar.gz: 955a93762333d83165c41c6dec9826e209c65ef1e6ef62955bfafc74b02cc10b323e02b4422b2cf4b921864fd155dd1289796d6bf02d26bec68921d9e3433987
6
+ metadata.gz: 7a09911027db613cbf2b9e2a5d411164a9e45a2197d4420558e3ff646f41f14c78f07b054d1789efebb3ea3fc51c1930857c584bf8ab4bf6de23605d4c713335
7
+ data.tar.gz: 1ca1daf23662c17da9824a8751a5b47e7687f51bbdcc2d2df7ff3a3beb33a4a4d602b372117e34379e590f1ff8c727ae6086d88bb26672e0c2770249e41c9979
data/README.md ADDED
@@ -0,0 +1,126 @@
1
+ Viewworkbook
2
+ ========================
3
+ view spreadsheet files in a terminal window
4
+ --------------------------
5
+
6
+ SYNOPSIS
7
+ ========================
8
+ viewworkbook \<spreadsheet\>
9
+
10
+ DESCRIPTION
11
+ ========================
12
+ Viewworkbook lets you read spreadsheet-files in text-mode, in a terminal
13
+ window. It reproduces the tables which are contained in a spreadsheet file and
14
+ lets you navigate through the sheets. The visible part of a sheet is limited
15
+ laterally and horizontally by the terminal-size but can be scrolled. You can
16
+ adapt the width of table-columns, to render the table more readable and
17
+ finally, if you wish, save tables to a text-file. To the author of the
18
+ program, the utility serves to take a quick glance at spreadsheets that are
19
+ received via email, in the Mutt mail-client, which is itself a terminal
20
+ application.
21
+
22
+ The supported spreadsheet formats are those which are handled by the Ruby-gem
23
+ "**roo**" (February 2017):
24
+
25
+ - Microsoft™'s **xls** and **xlsx**,
26
+
27
+ - the OpenDocument spreadsheet **ods**
28
+
29
+ - and the SoftMaker™ spreadsheet formats **pmd** and **pmdx**.
30
+
31
+ Options
32
+ ========================
33
+ Other than the path to the spreadsheet file, viewworkbook does currently not
34
+ interpret any command line arguments.
35
+
36
+ Menu commands
37
+ ========================
38
+ A list of commands and their associated hotkeys (in parenthesis) is shown
39
+ below the current table:
40
+
41
+ | | | | | | | | | |
42
+ |--|--------|--------|--------|--------|--------|--------|--------|------|
43
+ |11| 12.2 | July | 34000 | 5% | prior | 1957 | true | |
44
+ |12| 2.33 | July | 1234 | 12.2% | prior | 1966 | true | |
45
+ |13| 50.0 | August | 334566 | 12% | in | 1966 | false | |
46
+ | | A| B| C| D| E| F| G| |
47
+
48
+
49
+ **value (v) * save to file (f) * sheet (s) * column (c) * up(i) * down(k) * left(j) * right(l) * quit (q) ***
50
+
51
+ When you enter one of the hotkeys, a command can be executed directly (like "q"
52
+ to terminate the program), a sub-menu may be shown (like with "c" which shall
53
+ give you control on column properties) or you are confronted with an input
54
+ invitation (like with "v", where you have to enter a cell-reference). Read on
55
+ for an explanation of each menu command.
56
+
57
+ * **value (v)**
58
+ display the value from a cell. This is useful, when columns are not wide
59
+ nough to show complete values. After entering "**v**", you are
60
+ immediately invited to enter a cell reference. Cells are referenced in
61
+ the format "Column:Row", e.g. D:12 for the cell in column "D" and row
62
+ "12".
63
+
64
+ * **save to file (f)**
65
+ Save the current or all tables to a text file. The command does initially
66
+ show two alternative sub-commands:
67
+
68
+ * **Current sheet (c) * all sheets (a)**
69
+ Independently of your choice, in the next step you will have to enter the
70
+ path to the output file. You will be warned, if the file already exists
71
+ and may choose to either overwrite the existing file or name a different
72
+ one.
73
+
74
+ * **sheet (s)**
75
+ Navigate to a different sheet in the current workbook. You may choose
76
+ between a sheet-number and the name of a sheet. If you want to indicate
77
+ the next sheet **by name**, the list of all available names is first
78
+ shown. You just type right away the one that you want.
79
+
80
+ * **column (c)**
81
+ Alter the properties of the table-columns. At the time of this writing
82
+ (February 2017) the only property that can be changed, is the width of all
83
+ columns. When you enter "**c**" the subcommand column width (w) is shown.
84
+ After entering "**w**" you can enter the desired width in characters.
85
+
86
+ * **Arrows(i, j, k, l)**
87
+ Navigate in a sheet that is too big to be displayed entirely at once.
88
+ These hotkeys correspond to the default navigation keys in the vi editor.
89
+
90
+ * **quit (q)**
91
+ Enter "**q**" to quit the program at any moment except when an input
92
+ invitation is shown.
93
+
94
+ Hidden (menu-)commands
95
+ ------------------------
96
+ There is currently only one such command available:
97
+ The **Escape-key** will interrupt an unfinished action and refresh the display.
98
+
99
+ Other Information
100
+ ==================
101
+
102
+ Development and source code
103
+ ---------------------------
104
+ Viewworkbook has been written in Ruby. As Ruby is an interpreted programming
105
+ language, the executable file and all those that it may refer to at one
106
+ point in time, are themselves the source-files of the current
107
+ program-version. You can open them in any text-editor to scrutinize the
108
+ source-code. If you have received the program as a Ruby-gem, you can also
109
+ decompress a copy of the gem-file with **tar -x**, then **tar -xzf**.
110
+
111
+ Bugs
112
+ ----
113
+ Negative values are not always displayed, when very long (like 15 ciphers).
114
+ Enlarging the column-width further does not have an effect.
115
+
116
+ License
117
+ -------
118
+ Viewworkbook is distributed under the conditions of the WTFPL-2 or later
119
+ version; see https://wtfpl2.com for details.
120
+
121
+ Author
122
+ ------
123
+ Viewworkbook has been developed by Michael Uplawski
124
+ <michael.uplawski@uplawski.eu>
125
+
126
+ *Ω*
data/bin/viewworkbook CHANGED
@@ -2,26 +2,28 @@
2
2
  #encoding: UTF-8
3
3
  =begin
4
4
  /***************************************************************************
5
- * ©2011-2013, Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * ©2016-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
6
6
  * *
7
7
  * This program is free software; you can redistribute it and/or modify *
8
- * it under the terms of the GNU General Public License as published by *
9
- * the Free Software Foundation; either version 3 of the License, or *
10
- * (at your option) any later version. *
8
+ * it under the terms of the WTFPL 2.0 or later, see *
9
+ * http://www.wtfpl.net/about/ *
11
10
  * *
12
11
  * This program is distributed in the hope that it will be useful, *
13
12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
- * GNU General Public License for more details. *
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
16
14
  * *
17
- * You should have received a copy of the GNU General Public License *
18
- * along with this program; if not, write to the *
19
- * Free Software Foundation, Inc., *
20
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
15
  ***************************************************************************/
22
16
  =end
23
17
 
24
18
  require_relative "../lib/viewworkbook.rb"
19
+ require_relative "../lib/basic_logging.rb"
20
+
21
+ BasicLogging::set_target STDOUT
22
+ BasicLogging::set_level BasicLogging::INFO
23
+
24
+ # comment in for verbose output
25
+ # BasicLogging::set_target "/tmp/viewworkbook.log"
26
+ # BasicLogging::set_level BasicLogging::DEBUG
25
27
 
26
28
  if(ARGV.compact.empty?)
27
29
  puts purple("\n\tYou must name a valid spreadsheet file! Aborting\n")