Module: Rumacs
- Defined in:
- lib/rumacs.rb,
lib/rumacs/files.rb,
lib/rumacs/screen.rb,
lib/rumacs/screen/curses.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
'0.0.1'- KNOWN_BACKENDS =
[nil, :curses]
Class Method Summary collapse
Class Method Details
.backend(new_backend) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rumacs.rb', line 15 def self.backend(new_backend) if KNOWN_BACKENDS.include?(new_backend) $backend = new_backend load "rumacs/screen/#{$backend}.rb" else raise Exception "unknown backend #{new_backend}, known backends are #{KNOWN_BACKENDS}" end end |
.init ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rumacs.rb', line 24 def self.init() backend(:curses) $screen = Rumacs::Screen.new $filemgr = Rumacs::Files.new $screen.init_screen do $filemgr.load_text("Welcome to Rumacs \#{VERSION}!\n========================\n\nC-l :: backend.redraw\n\nC-p, up :: point_move -1 0\nC-n, down :: point_move 1 0\nC-b, left :: point_move 0 -1\nC-f, right :: point_move 0 1\n\nC-a, home :: point_set nil 0\nC-e, end:: point_set nil 0\n\nC-x [...] :: compound_command_x\nC-x C-c :: kill_rumacs\n\nC-c [...] :: compound_command_c\n\n[[other functionality to be implemented]]\n" ) $screen.key_loop end end |
.version ⇒ Object
8 9 10 |
# File 'lib/rumacs.rb', line 8 def self.version return VERSION end |