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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 183a799326643a98e2ee4936d5788549453746e1f74fcd5439b85ffbcfbb24f8
4
- data.tar.gz: 1e55a32eaab16d88b6ae07ecfa155b01fb2c261943d80cf95175200b3c239553
3
+ metadata.gz: 23c9253d91c1ef03c4db29751924f0fbb45e13497aaa9f4625a629a8b5d66ca0
4
+ data.tar.gz: 7f9d487042f838d415012a43e5cbb840c820bf256fd322cba313f8610fee3d5c
5
5
  SHA512:
6
- metadata.gz: 0ca9a59b30268a02d7e94718276f597f6c120f4f5cfa120e0f6159a2ee340eb7e69491326d1f04c148994b040f704b876acfd53f02d463b66ff407e0990b34de
7
- data.tar.gz: 6207a2cd3628d05ebf53e97e232c25c3ee1cb5bfd36a909ed6177ff4c79089957ab32c3829badbb11863a5a72bc814de0ddf93c562d335e104775a4ce2de95d0
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: false)
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[:report_config] = true
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] = true
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
- => character
120
- => first-name
121
- => last-name
122
- => name
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
- => Prefixes:
135
- => ? - Help (this command)
136
- => + - Query table names and contents
137
- => <table_name: - Write the results to the given table
138
- =>
139
- => Tokens:
140
- => ! - Skip expansion
141
- => /search/ - Grep for the given 'search' within the prefix
142
- => [index] - Target a specific 'index'
143
- => {table_name} - expand_line the given 'table_name'
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
- => [1] Frodo
153
- => [2] Merry
154
- => [3] Pippin
155
- => [4] Sam
156
- => [5-6] {first-name}Wise
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("-lTTL", "--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|
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? - Help (this command)",
17
- "\t+ - Query table names and contents",
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{table_name} - expand_line the given 'table_name'"
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
@@ -52,7 +52,7 @@ module Gm
52
52
 
53
53
  def render_interactive(lines)
54
54
  each_expanded_line(lines: lines) do |line|
55
- interactive_buffer.puts("=>\t#{line}")
55
+ interactive_buffer.puts(line)
56
56
  end
57
57
  end
58
58
 
@@ -1,5 +1,5 @@
1
1
  module Gm
2
2
  module Notepad
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gm-notepad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen