text_editor 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.text_editor.rb +81 -2
- data/Gemfile.lock +1 -0
- data/README.org +103 -0
- data/bin/console +1 -1
- data/lib/core_ext/hash.rb +2 -0
- data/lib/core_ext/pathname.rb +2 -0
- data/lib/text_editor.rb +43 -13
- data/lib/text_editor/buffer.rb +3 -0
- data/lib/text_editor/clipboard.rb +1 -1
- data/lib/text_editor/clipboard/cygwin.rb +0 -4
- data/lib/text_editor/clipboard/linux.rb +0 -4
- data/lib/text_editor/clipboard/mac.rb +0 -4
- data/lib/text_editor/clipboard/unknown.rb +0 -4
- data/lib/text_editor/clipboard/windows.rb +0 -4
- data/lib/text_editor/command.rb +4 -4
- data/lib/text_editor/command/append_line_and_insert.rb +11 -0
- data/lib/text_editor/command/change_mode.rb +9 -0
- data/lib/text_editor/command/cursor_end_and_insert.rb +9 -0
- data/lib/text_editor/command/cursor_left.rb +1 -8
- data/lib/text_editor/command/cursor_left_with_wrap.rb +16 -0
- data/lib/text_editor/command/cursor_right.rb +2 -9
- data/lib/text_editor/command/cursor_right_and_insert.rb +9 -0
- data/lib/text_editor/command/cursor_right_with_wrap.rb +19 -0
- data/lib/text_editor/command/cursor_start_without_whitespace.rb +11 -0
- data/lib/text_editor/command/cursor_up.rb +1 -1
- data/lib/text_editor/command/forward_word.rb +16 -0
- data/lib/text_editor/command/insert_tab.rb +1 -1
- data/lib/text_editor/command/prepend_line_and_insert.rb +11 -0
- data/lib/text_editor/command/replace_line.rb +13 -0
- data/lib/text_editor/command/resolver.rb +3 -2
- data/lib/text_editor/component.rb +1 -1
- data/lib/text_editor/configuration.rb +11 -3
- data/lib/text_editor/configuration/bootstrap.rb +9 -3
- data/lib/text_editor/configuration/flavor.rb +20 -0
- data/lib/text_editor/configuration/log.rb +7 -0
- data/lib/text_editor/configuration/mode.rb +28 -0
- data/lib/text_editor/configuration/operating_system.rb +21 -0
- data/lib/text_editor/configuration/resolver.rb +1 -1
- data/lib/text_editor/configuration/tab.rb +11 -0
- data/lib/text_editor/cursor.rb +2 -0
- data/lib/text_editor/keyboard.rb +1 -1
- data/lib/text_editor/logger.rb +11 -0
- data/lib/text_editor/reactor.rb +5 -3
- data/lib/text_editor/terminal.rb +2 -19
- data/lib/text_editor/window.rb +34 -5
- data/spec/spec_helper.rb +3 -0
- data/spec/support/command_helper.rb +43 -0
- data/spec/text_editor/clipboard_spec.rb +0 -7
- data/spec/text_editor/command/append_line_and_insert_spec.rb +38 -0
- data/spec/text_editor/command/backspace_spec.rb +54 -0
- data/spec/text_editor/command/change_mode_spec.rb +17 -0
- data/spec/text_editor/command/cursor_down_spec.rb +57 -0
- data/spec/text_editor/command/cursor_end_and_insert_spec.rb +35 -0
- data/spec/text_editor/command/cursor_end_spec.rb +30 -0
- data/spec/text_editor/command/cursor_left_spec.rb +46 -0
- data/spec/text_editor/command/cursor_left_with_wrap_spec.rb +46 -0
- data/spec/text_editor/command/cursor_right_and_insert_spec.rb +58 -0
- data/spec/text_editor/command/cursor_right_spec.rb +53 -0
- data/spec/text_editor/command/cursor_right_with_wrap_spec.rb +54 -0
- data/spec/text_editor/command/cursor_start_spec.rb +33 -0
- data/spec/text_editor/command/cursor_start_without_whitespace_spec.rb +46 -0
- data/spec/text_editor/command/cursor_up_spec.rb +56 -0
- data/spec/text_editor/command/forward_word_spec.rb +8 -0
- data/spec/text_editor/command/insert_char_spec.rb +24 -0
- data/spec/text_editor/command/insert_line_spec.rb +26 -0
- data/spec/text_editor/command/insert_tab_spec.rb +27 -0
- data/spec/text_editor/command/prepend_line_and_insert_spec.rb +38 -0
- data/spec/text_editor/command/replace_line_spec.rb +34 -0
- data/spec/text_editor/command/resolver_spec.rb +2 -2
- data/spec/text_editor/command/write_file_spec.rb +25 -0
- data/spec/text_editor/command_spec.rb +8 -8
- data/spec/text_editor/component_spec.rb +7 -0
- data/spec/text_editor/configuration/log_spec.rb +26 -0
- data/spec/text_editor/{operating_system_spec.rb → configuration/operating_system_spec.rb} +1 -1
- data/spec/text_editor/configuration/tab_spec.rb +41 -0
- data/spec/text_editor/configuration_spec.rb +11 -4
- data/spec/text_editor/logger_spec.rb +17 -0
- data/text_editor.gemspec +2 -1
- metadata +84 -7
- data/lib/text_editor/mode.rb +0 -23
- data/lib/text_editor/mode/nano.rb +0 -30
- data/lib/text_editor/operating_system.rb +0 -19
@@ -1,19 +0,0 @@
|
|
1
|
-
class TextEditor
|
2
|
-
class OperatingSystem
|
3
|
-
attr_reader :version
|
4
|
-
|
5
|
-
def initialize(version)
|
6
|
-
@version = version
|
7
|
-
end
|
8
|
-
|
9
|
-
def type
|
10
|
-
case version
|
11
|
-
when /cygwin/ then :Cygwin
|
12
|
-
when /bsd|linux/ then :Linux
|
13
|
-
when /darwin|mac/ then :Mac
|
14
|
-
when /mingw|mswin/ then :Windows
|
15
|
-
else :Unknown
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|