examples/dsl_editor.rb in vedeu-0.8.0 vs examples/dsl_editor.rb in vedeu-0.8.1
- old
+ new
@@ -1,18 +1,21 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
+
require 'bundler/setup'
require 'vedeu'
class EditorApp
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
Vedeu.configure do
debug!
- log '/tmp/editor.log'.freeze
- renderers Vedeu::Renderers::File.new(filename: '/tmp/editor.out'.freeze)
+ log '/tmp/editor.log'
+ renderers(Vedeu::Renderers::Terminal.new,
+ Vedeu::Renderers::File.new(filename: '/tmp/editor.out'))
fake!
end
Vedeu.interface :editor_view do
border do
@@ -47,31 +50,31 @@
Vedeu.keymap :editor_view do
key(:escape) { Vedeu.trigger(:_editor_execute_, :editor_view) }
key(:enter) { Vedeu.trigger(:_editor_insert_line_, :editor_view) }
key(:insert) do
Vedeu.log(type: :debug,
- message: "Commands: #{Vedeu.all_commands.inspect}".freeze)
+ message: "Commands: #{Vedeu.all_commands.inspect}")
Vedeu.log(type: :debug,
- message: "Keypresses: #{Vedeu.all_keypresses.inspect}".freeze)
+ message: "Keypresses: #{Vedeu.all_keypresses.inspect}")
end
end
- Vedeu.keymap '_global_'.freeze do
- key('q'.freeze) { Vedeu.exit }
+ Vedeu.keymap '_global_' do
+ key('q') { Vedeu.exit }
end
Vedeu.render do
view(:editor_view) do
end
end
Vedeu.render do
view(:help_view) do
lines do
- line 'Type into the editor dialog above,'.freeze
- line 'and press Escape. This will trigger the'.freeze
- line ':command event with the contents of '.freeze
- line 'the view.'.freeze
+ line 'Type into the editor dialog above,'
+ line 'and press Escape. This will trigger the'
+ line ':command event with the contents of '
+ line 'the view.'
# @todo Not implemented yet:
#
# text 'Type into the editor dialog above, and press Return. This will ' \
# 'trigger the :_command_ event with the contents of the view.',