Module: RubyJard

Defined in:
lib/ruby_jard.rb,
lib/ruby_jard/row.rb,
lib/ruby_jard/keys.rb,
lib/ruby_jard/span.rb,
lib/ruby_jard/frame.rb,
lib/ruby_jard/pager.rb,
lib/ruby_jard/column.rb,
lib/ruby_jard/config.rb,
lib/ruby_jard/layout.rb,
lib/ruby_jard/screen.rb,
lib/ruby_jard/console.rb,
lib/ruby_jard/layouts.rb,
lib/ruby_jard/screens.rb,
lib/ruby_jard/session.rb,
lib/ruby_jard/version.rb,
lib/ruby_jard/box_drawer.rb,
lib/ruby_jard/reflection.rb,
lib/ruby_jard/repl_proxy.rb,
lib/ruby_jard/key_binding.rb,
lib/ruby_jard/path_filter.rb,
lib/ruby_jard/thread_info.rb,
lib/ruby_jard/color_scheme.rb,
lib/ruby_jard/control_flow.rb,
lib/ruby_jard/key_bindings.rb,
lib/ruby_jard/row_renderer.rb,
lib/ruby_jard/color_schemes.rb,
lib/ruby_jard/layout_picker.rb,
lib/ruby_jard/screen_drawer.rb,
lib/ruby_jard/repl_processor.rb,
lib/ruby_jard/screen_manager.rb,
lib/ruby_jard/path_classifier.rb,
lib/ruby_jard/screen_adjuster.rb,
lib/ruby_jard/screen_renderer.rb,
lib/ruby_jard/layout_calculator.rb,
lib/ruby_jard/commands/up_command.rb,
lib/ruby_jard/layouts/tiny_layout.rb,
lib/ruby_jard/layouts/wide_layout.rb,
lib/ruby_jard/screens/menu_screen.rb,
lib/ruby_jard/commands/down_command.rb,
lib/ruby_jard/commands/exit_command.rb,
lib/ruby_jard/commands/jard_command.rb,
lib/ruby_jard/commands/list_command.rb,
lib/ruby_jard/commands/next_command.rb,
lib/ruby_jard/commands/step_command.rb,
lib/ruby_jard/screens/source_screen.rb,
lib/ruby_jard/commands/color_helpers.rb,
lib/ruby_jard/commands/frame_command.rb,
lib/ruby_jard/screens/threads_screen.rb,
lib/ruby_jard/decorators/loc_decorator.rb,
lib/ruby_jard/screens/backtrace_screen.rb,
lib/ruby_jard/screens/variables_screen.rb,
lib/ruby_jard/commands/continue_command.rb,
lib/ruby_jard/commands/step_out_command.rb,
lib/ruby_jard/decorators/hash_decorator.rb,
lib/ruby_jard/decorators/path_decorator.rb,
lib/ruby_jard/templates/layout_template.rb,
lib/ruby_jard/templates/screen_template.rb,
lib/ruby_jard/commands/jard/hide_command.rb,
lib/ruby_jard/commands/jard/show_command.rb,
lib/ruby_jard/decorators/array_decorator.rb,
lib/ruby_jard/decorators/color_decorator.rb,
lib/ruby_jard/decorators/rails_decorator.rb,
lib/ruby_jard/commands/validation_helpers.rb,
lib/ruby_jard/decorators/object_decorator.rb,
lib/ruby_jard/decorators/source_decorator.rb,
lib/ruby_jard/decorators/string_decorator.rb,
lib/ruby_jard/decorators/struct_decorator.rb,
lib/ruby_jard/commands/jard/filter_command.rb,
lib/ruby_jard/commands/jard/output_command.rb,
lib/ruby_jard/color_schemes/256_color_scheme.rb,
lib/ruby_jard/layouts/narrow_vertical_layout.rb,
lib/ruby_jard/decorators/attributes_decorator.rb,
lib/ruby_jard/decorators/inspection_decorator.rb,
lib/ruby_jard/layouts/narrow_horizontal_layout.rb,
lib/ruby_jard/color_schemes/gruvbox_color_scheme.rb,
lib/ruby_jard/commands/jard/color_scheme_command.rb,
lib/ruby_jard/color_schemes/256_light_color_scheme.rb,
lib/ruby_jard/color_schemes/deep_space_color_scheme.rb,
lib/ruby_jard/color_schemes/one_half_dark_color_scheme.rb,
lib/ruby_jard/color_schemes/one_half_light_color_scheme.rb

Overview

rubocop:disable Metrics/MethodLength

Defined Under Namespace

Modules: Commands, Decorators, Templates Classes: BoxDrawer, ColorScheme, ColorSchemes, Column, Config, Console, ControlFlow, Error, Frame, KeyBinding, KeyBindings, Keys, Layout, LayoutCalculator, LayoutPicker, Layouts, Pager, PathClassifier, PathFilter, Reflection, ReplProcessor, ReplProxy, Row, RowRenderer, Screen, ScreenAdjuster, ScreenDrawer, ScreenManager, ScreenRenderer, Screens, Session, Span, ThreadInfo

Constant Summary collapse

VERSION =
'0.3.1'

Class Method Summary collapse

Class Method Details

.all_filesObject



101
102
103
104
105
106
# File 'lib/ruby_jard.rb', line 101

def self.all_files
  Dir.glob(File.join(File.expand_path(__dir__, './lib'), '**', '*.rb')) +
    Dir.glob(File.join(File.expand_path(__dir__, './lib'), '*.rb')) +
    Dir.glob(File.join(File.expand_path(__dir__, './bin'), '**', '*.rb')) +
    Dir.glob(File.join(File.expand_path(__dir__, './bin'), '*.rb'))
end

.benchmark(name) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/ruby_jard.rb', line 49

def self.benchmark(name)
  @benchmark_depth ||= 0
  @benchmark_depth += 1
  return_value = nil
  time = Benchmark.realtime { return_value = yield }
  debug("#{' ' * @benchmark_depth}Benchmark `#{name}`: #{time}")
  @benchmark_depth -= 1
  return_value
end

.clear_debugObject



83
84
85
# File 'lib/ruby_jard.rb', line 83

def self.clear_debug
  @debug_info = []
end

.configObject



97
98
99
# File 'lib/ruby_jard.rb', line 97

def self.config
  @config ||= RubyJard::Config.smart_load
end

.debug(*info) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/ruby_jard.rb', line 59

def self.debug(*info)
  @debug_info ||= []
  @debug_info += info
  File.open('./jard_debugs.txt', 'a') do |f|
    info.each do |line|
      f.puts line
    end
  end
end

.debug_infoObject



79
80
81
# File 'lib/ruby_jard.rb', line 79

def self.debug_info
  @debug_info ||= []
end

.error(exception) ⇒ Object



69
70
71
72
73
74
75
76
77
# File 'lib/ruby_jard.rb', line 69

def self.error(exception)
  File.open('./jard_errors.txt', 'a') do |f|
    f.puts '--- Error ---'
    f.puts exception.message
    f.puts exception.backtrace
  end
rescue StandardError
  # Ignore
end

.global_key_bindingsObject



87
88
89
90
91
92
93
94
95
# File 'lib/ruby_jard.rb', line 87

def self.global_key_bindings
  return @global_key_bindings if defined?(@global_key_bindings)

  @global_key_bindings = RubyJard::KeyBindings.new
  RubyJard::Keys::DEFAULT_KEY_BINDINGS.each do |sequence, action|
    @global_key_bindings.push(sequence, action)
  end
  @global_key_bindings
end