gm-notepad 0.0.10 → 0.0.11
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 +4 -4
- data/README.md +8 -4
- data/Rakefile +1 -1
- data/exe/gm-notepad +18 -20
- data/gm-notepad.gemspec +3 -0
- data/lib/gm/notepad.rb +8 -6
- data/lib/gm/notepad/app.rb +45 -0
- data/lib/gm/notepad/buffer_wrapper.rb +47 -0
- data/lib/gm/notepad/config.rb +31 -0
- data/lib/gm/notepad/container.rb +50 -0
- data/lib/gm/notepad/exceptions.rb +1 -1
- data/lib/gm/notepad/input_handler_registry.rb +3 -3
- data/lib/gm/notepad/input_handlers/comment_handler.rb +6 -8
- data/lib/gm/notepad/input_handlers/default_handler.rb +12 -20
- data/lib/gm/notepad/input_handlers/help_handler.rb +4 -8
- data/lib/gm/notepad/input_handlers/query_table_handler.rb +16 -14
- data/lib/gm/notepad/input_handlers/query_table_names_handler.rb +12 -17
- data/lib/gm/notepad/input_handlers/write_line_handler.rb +4 -12
- data/lib/gm/notepad/input_handlers/write_to_table_handler.rb +9 -12
- data/lib/gm/notepad/input_processor.rb +10 -11
- data/lib/gm/notepad/line_evaluator.rb +16 -15
- data/lib/gm/notepad/line_renderer.rb +24 -62
- data/lib/gm/notepad/table.rb +17 -6
- data/lib/gm/notepad/table_column_set.rb +20 -7
- data/lib/gm/notepad/table_entry.rb +12 -4
- data/lib/gm/notepad/table_registry.rb +23 -16
- data/lib/gm/notepad/throughput_text.rb +80 -0
- data/lib/gm/notepad/version.rb +1 -1
- metadata +49 -5
- data/lib/gm/notepad/configuration.rb +0 -138
- data/lib/gm/notepad/defaults.rb +0 -6
- data/lib/gm/notepad/pad.rb +0 -36
data/lib/gm/notepad/defaults.rb
DELETED
data/lib/gm/notepad/pad.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'gm/notepad/configuration'
|
2
|
-
module Gm
|
3
|
-
module Notepad
|
4
|
-
# Responsible for recording entries and then dumping them accordingly.
|
5
|
-
class Pad
|
6
|
-
Notepad::Configuration.init!(target: self, from_config: [:table_registry, :renderer, :input_processor]) do
|
7
|
-
open!
|
8
|
-
end
|
9
|
-
|
10
|
-
def process(input:)
|
11
|
-
input_processor.process(input: input) do |*args|
|
12
|
-
renderer.call(*args)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def close!
|
17
|
-
renderer.close!
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def open!
|
23
|
-
renderer.call("Welcome to gm-notepad. type \"?\" for help.", to_interactive: true, to_output: false)
|
24
|
-
return unless config.report_config
|
25
|
-
lines = ["# Configuration Parameters:"]
|
26
|
-
config.each_pair do |key, value|
|
27
|
-
lines << "# config[#{key.inspect}] = #{value.inspect}"
|
28
|
-
end
|
29
|
-
# When running :list_tables by default I don't want to report
|
30
|
-
# that to the output buffer.
|
31
|
-
to_output = !config.list_tables
|
32
|
-
renderer.call(lines, to_interactive: true, to_output: to_output)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|