lib/constants.rb in markdown_exec-2.4.0 vs lib/constants.rb in markdown_exec-2.5.0
- old
+ new
@@ -1,10 +1,8 @@
-#!/usr/bin/env ruby
# frozen_string_literal: true
# encoding=utf-8
-
require_relative 'block_types'
class AppInterrupt < StandardError; end
class BlockMissing < StandardError; end
@@ -19,10 +17,21 @@
ArgIsPosition = :position
CallProcess = :proc_name
ConvertValue = :convert
end
+BLOCK_TYPE_COLOR_OPTIONS = {
+ BlockType::EDIT => :menu_edit_color,
+ BlockType::HISTORY => :menu_history_color,
+ BlockType::LINK => :menu_link_color,
+ BlockType::LOAD => :menu_load_color,
+ BlockType::OPTS => :menu_opts_color,
+ BlockType::SAVE => :menu_save_color,
+ BlockType::SHELL => :menu_bash_color,
+ BlockType::VARS => :menu_vars_color
+}.freeze
+
class ExecutionStreams
STD_ERR = :stderr
STD_IN = :stdin
STD_OUT = :stdout
end
@@ -71,23 +80,18 @@
SHELL = :shell
VIEW = :view
end
# a struct to hold the data for a single line
-NestedLine = Struct.new(:text, :depth) do
+NestedLine = Struct.new(:text, :depth, :indention) do
def to_s
- text
+ indention + text
end
end
# selected block and subsequent menu state
#
SelectedBlockMenuState = Struct.new(:block, :source, :state)
-SHELL_COLOR_OPTIONS = {
- BlockType::BASH => :menu_bash_color,
- BlockType::LINK => :menu_link_color,
- BlockType::OPTS => :menu_opts_color,
- BlockType::VARS => :menu_vars_color
-}.freeze
-
-### Struct.new(:state, :block)
+class TtyMenu
+ DISABLE = ''
+end