gm-notepad 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +56 -23
- data/exe/gm-notepad +1 -1
- data/lib/gm/notepad/input_handlers/help_handler.rb +8 -3
- data/lib/gm/notepad/line_renderer.rb +1 -1
- data/lib/gm/notepad/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23c9253d91c1ef03c4db29751924f0fbb45e13497aaa9f4625a629a8b5d66ca0
|
4
|
+
data.tar.gz: 7f9d487042f838d415012a43e5cbb840c820bf256fd322cba313f8610fee3d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 013b9c64ade3b19008f1bfda2686df131db92051e0c376de64f9c441ad09368d3b64712a87ab2c82dea69f5e3fd66d0710ef5b59c4190a435c2df2f89f1ce73e
|
7
|
+
data.tar.gz: e9ae058f45ba1979e75fef183ba0c62c8f184ec6638d76a7d2ae4c28bbae1f286de5c8730118bbc4169dd708f793b386acdc98929790aba8f45c5ae86a1111ad
|
data/README.md
CHANGED
@@ -64,11 +64,15 @@ Options:
|
|
64
64
|
-p, --path=PATH Path(s) for {table_name}.<config.table_extension> files (Default: ["."])
|
65
65
|
-f, --filesystem_directory=DIR Path to dump tables (Default: ".")
|
66
66
|
-x, --table_extension=EXT Extension to use for selecting tables (Default: ".txt")
|
67
|
+
--time_to_live=TTL Per line of input, how many times to allow text expansion (Default: 20)
|
68
|
+
-d, --delimiter=DELIM Default column delimiter for tables (Default: "|")
|
69
|
+
|
70
|
+
Output options:
|
67
71
|
-t, --timestamp Append a timestamp to the note (Default: false)
|
68
72
|
|
69
73
|
Color options:
|
70
74
|
-i, --skip-interactive-color Disable color rendering for interactive buffer (Default: false)
|
71
|
-
-o, --with-output-color Enable color rendering for output buffer (Default:
|
75
|
+
-o, --with-output-color Enable color rendering for output buffer (Default: true)
|
72
76
|
|
73
77
|
-h, --help You're looking at it!
|
74
78
|
```
|
@@ -81,15 +85,20 @@ Which writes the following to the `interactive` buffer (eg. `$stderr`)::
|
|
81
85
|
|
82
86
|
```console
|
83
87
|
# Configuration Parameters:
|
84
|
-
# config[:
|
88
|
+
# config[:column_delimiter] = "|"
|
85
89
|
# config[:filesystem_directory] = "."
|
90
|
+
# config[:include_original_command_as_comment] = true
|
91
|
+
# config[:index_entry_prefix] = "index"
|
86
92
|
# config[:interactive_buffer] = #<IO:<STDERR>>
|
87
|
-
# config[:interactive_color] =
|
88
|
-
# config[:output_color] = false
|
93
|
+
# config[:interactive_color] = :faint
|
89
94
|
# config[:list_tables] = false
|
90
95
|
# config[:output_buffer] = #<IO:<STDOUT>>
|
96
|
+
# config[:output_color] = false
|
91
97
|
# config[:paths] = ["."]
|
98
|
+
# config[:report_config] = true
|
99
|
+
# config[:skip_readlines] = false
|
92
100
|
# config[:table_extension] = ".txt"
|
101
|
+
# config[:time_to_live] = 20
|
93
102
|
# config[:with_timestamp] = false
|
94
103
|
```
|
95
104
|
|
@@ -116,10 +125,10 @@ Below are the table names when you run the `gm-notepad -l` against the
|
|
116
125
|
repository (note when you run this command you'll get a preamble of the config):
|
117
126
|
|
118
127
|
```console
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
128
|
+
character
|
129
|
+
first-name
|
130
|
+
last-name
|
131
|
+
name
|
123
132
|
```
|
124
133
|
|
125
134
|
Now let's load `gm-notepad` for interaction. In the terminal, type:
|
@@ -131,16 +140,20 @@ You now have an interactive shell for `gm-notepad`. Type `?` and hit
|
|
131
140
|
`gm-notepad` will write the following to `interactive` buffer (eg. `$stderr`):
|
132
141
|
|
133
142
|
```console
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
143
|
+
Prefixes:
|
144
|
+
? - Help (this command)
|
145
|
+
+ - Query table names and contents
|
146
|
+
<table_name: - Write the results to the given table
|
147
|
+
` - Shell out command and write to interactive buffer
|
148
|
+
`> - Shell out command and write to interactive AND output buffer
|
149
|
+
Tokens:
|
150
|
+
! - Skip expansion
|
151
|
+
/search/ - Grep for the given 'search' within the prefix
|
152
|
+
[index] - Target a specific 'index'
|
153
|
+
[][column] - Pick a random index
|
154
|
+
{table_name} - expand_line the given 'table_name'
|
155
|
+
{table_name[d6]} - roll a d6 and lookup that row on the given 'table_name'
|
156
|
+
{table_name[d6][name]} - pick a random row (between 1 and 6) and select the 'name' column from the given table_name
|
144
157
|
```
|
145
158
|
|
146
159
|
Now, let's take look at a table. Again in an active `gm-notepad` session type
|
@@ -149,11 +162,11 @@ the following: `+first-name`
|
|
149
162
|
`gm-notepad` will write the following to `interactive` buffer (eg. `$stderr`):
|
150
163
|
|
151
164
|
```console
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
165
|
+
[1] Frodo
|
166
|
+
[2] Merry
|
167
|
+
[3] Pippin
|
168
|
+
[4] Sam
|
169
|
+
[5-6] {first-name}Wise
|
157
170
|
```
|
158
171
|
|
159
172
|
These are the five table entries in the `first-name` table.
|
@@ -199,6 +212,26 @@ columns. _I am still working on retrieving by column names as well as rendering
|
|
199
212
|
=> [jehat] Jehat 19 14D6
|
200
213
|
```
|
201
214
|
|
215
|
+
You can write a new table, without exiting `gm-notepad`, by doing the following:
|
216
|
+
|
217
|
+
```console
|
218
|
+
<junk:1|2\n3|4
|
219
|
+
```
|
220
|
+
|
221
|
+
This will write to the `junk.txt` file the following:
|
222
|
+
|
223
|
+
```console
|
224
|
+
1|2
|
225
|
+
3|4
|
226
|
+
```
|
227
|
+
|
228
|
+
You can then immediately access the `junk` table, by typing the following: `+junk`
|
229
|
+
|
230
|
+
```console
|
231
|
+
[1] 2
|
232
|
+
[3] 4
|
233
|
+
```
|
234
|
+
|
202
235
|
## Testing Locally
|
203
236
|
|
204
237
|
* Clone the repository
|
data/exe/gm-notepad
CHANGED
@@ -39,7 +39,7 @@ OptionParser.new do |options|
|
|
39
39
|
config[:table_extension] = table_extension
|
40
40
|
end
|
41
41
|
|
42
|
-
options.on("-
|
42
|
+
options.on("-tTTL", "--time_to_live=TTL", Integer, "Per line of input, how many times to allow text expansion (Default: #{defaults.time_to_live.inspect})") do |time_to_live|
|
43
43
|
config[:time_to_live] = time_to_live
|
44
44
|
end
|
45
45
|
|
@@ -13,15 +13,20 @@ module Gm
|
|
13
13
|
def after_initialize!
|
14
14
|
[
|
15
15
|
"Prefixes:",
|
16
|
-
"\t?
|
17
|
-
"\t+
|
16
|
+
"\t? - Help (this command)",
|
17
|
+
"\t+ - Query table names and contents",
|
18
18
|
"\t<table_name: - Write the results to the given table",
|
19
|
+
"\t` - Shell out command and write to interactive buffer",
|
20
|
+
"\t`> - Shell out command and write to interactive AND output buffer",
|
19
21
|
"",
|
20
22
|
"Tokens:",
|
21
23
|
"\t! - Skip expansion",
|
22
24
|
"\t/search/ - Grep for the given 'search' within the prefix",
|
23
25
|
"\t[index] - Target a specific 'index'",
|
24
|
-
"\t
|
26
|
+
"\t[][column] - Pick a random index",
|
27
|
+
"\t{table_name} - expand_line the given 'table_name'",
|
28
|
+
"\t{table_name[d6]} - roll a d6 and lookup that row on the given 'table_name'",
|
29
|
+
"\t{table_name[d6][name]} - pick a random row (between 1 and 6) and select the 'name' column from the given table_name"
|
25
30
|
].each do |text|
|
26
31
|
input.for_rendering(text: text, to_interactive: true, to_output: false, expand_line: false)
|
27
32
|
end
|
data/lib/gm/notepad/version.rb
CHANGED