ruby_jard 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. data/.github/workflows/ruby.yml +85 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +70 -1
  7. data/CHANGELOG.md +31 -0
  8. data/Gemfile +6 -3
  9. data/README.md +122 -8
  10. data/bin/console +1 -2
  11. data/docs/color_schemes/256-light.png +0 -0
  12. data/docs/color_schemes/gruvbox.png +0 -0
  13. data/docs/color_schemes/one-half-dark.png +0 -0
  14. data/docs/color_schemes/one-half-light.png +0 -0
  15. data/lib/ruby_jard.rb +5 -5
  16. data/lib/ruby_jard/box_drawer.rb +4 -1
  17. data/lib/ruby_jard/color_schemes.rb +31 -15
  18. data/lib/ruby_jard/color_schemes/256_color_scheme.rb +37 -37
  19. data/lib/ruby_jard/color_schemes/256_light_color_scheme.rb +62 -0
  20. data/lib/ruby_jard/color_schemes/deep_space_color_scheme.rb +36 -36
  21. data/lib/ruby_jard/color_schemes/gruvbox_color_scheme.rb +62 -0
  22. data/lib/ruby_jard/color_schemes/one_half_dark_color_scheme.rb +61 -0
  23. data/lib/ruby_jard/color_schemes/one_half_light_color_scheme.rb +62 -0
  24. data/lib/ruby_jard/column.rb +3 -1
  25. data/lib/ruby_jard/commands/continue_command.rb +2 -3
  26. data/lib/ruby_jard/commands/down_command.rb +9 -5
  27. data/lib/ruby_jard/commands/exit_command.rb +27 -0
  28. data/lib/ruby_jard/commands/frame_command.rb +11 -10
  29. data/lib/ruby_jard/commands/jard/color_scheme_command.rb +52 -0
  30. data/lib/ruby_jard/commands/jard/hide_command.rb +40 -0
  31. data/lib/ruby_jard/commands/jard/output_command.rb +28 -0
  32. data/lib/ruby_jard/commands/jard/show_command.rb +41 -0
  33. data/lib/ruby_jard/commands/jard_command.rb +50 -0
  34. data/lib/ruby_jard/commands/list_command.rb +5 -4
  35. data/lib/ruby_jard/commands/next_command.rb +10 -5
  36. data/lib/ruby_jard/commands/step_command.rb +10 -5
  37. data/lib/ruby_jard/commands/step_out_command.rb +10 -5
  38. data/lib/ruby_jard/commands/up_command.rb +10 -5
  39. data/lib/ruby_jard/commands/validation_helpers.rb +50 -0
  40. data/lib/ruby_jard/config.rb +7 -3
  41. data/lib/ruby_jard/console.rb +10 -22
  42. data/lib/ruby_jard/control_flow.rb +3 -3
  43. data/lib/ruby_jard/decorators/color_decorator.rb +11 -5
  44. data/lib/ruby_jard/decorators/loc_decorator.rb +1 -1
  45. data/lib/ruby_jard/decorators/path_decorator.rb +20 -7
  46. data/lib/ruby_jard/decorators/source_decorator.rb +2 -0
  47. data/lib/ruby_jard/frame.rb +55 -0
  48. data/lib/ruby_jard/keys.rb +0 -3
  49. data/lib/ruby_jard/layout.rb +9 -2
  50. data/lib/ruby_jard/layout_calculator.rb +29 -12
  51. data/lib/ruby_jard/layout_picker.rb +34 -0
  52. data/lib/ruby_jard/layouts.rb +52 -0
  53. data/lib/ruby_jard/layouts/narrow_horizontal_layout.rb +28 -0
  54. data/lib/ruby_jard/layouts/narrow_vertical_layout.rb +32 -0
  55. data/lib/ruby_jard/layouts/tiny_layout.rb +25 -0
  56. data/lib/ruby_jard/layouts/wide_layout.rb +13 -15
  57. data/lib/ruby_jard/pager.rb +96 -0
  58. data/lib/ruby_jard/repl_processor.rb +61 -31
  59. data/lib/ruby_jard/repl_proxy.rb +193 -89
  60. data/lib/ruby_jard/row.rb +16 -1
  61. data/lib/ruby_jard/row_renderer.rb +51 -42
  62. data/lib/ruby_jard/screen.rb +2 -12
  63. data/lib/ruby_jard/screen_adjuster.rb +104 -0
  64. data/lib/ruby_jard/screen_drawer.rb +3 -0
  65. data/lib/ruby_jard/screen_manager.rb +32 -54
  66. data/lib/ruby_jard/screen_renderer.rb +30 -16
  67. data/lib/ruby_jard/screens.rb +31 -12
  68. data/lib/ruby_jard/screens/backtrace_screen.rb +23 -26
  69. data/lib/ruby_jard/screens/menu_screen.rb +53 -22
  70. data/lib/ruby_jard/screens/source_screen.rb +65 -37
  71. data/lib/ruby_jard/screens/threads_screen.rb +14 -14
  72. data/lib/ruby_jard/screens/variables_screen.rb +59 -34
  73. data/lib/ruby_jard/session.rb +19 -10
  74. data/lib/ruby_jard/span.rb +3 -0
  75. data/lib/ruby_jard/templates/layout_template.rb +1 -1
  76. data/lib/ruby_jard/templates/screen_template.rb +3 -4
  77. data/lib/ruby_jard/version.rb +1 -1
  78. data/ruby_jard.gemspec +1 -1
  79. metadata +38 -9
  80. data/lib/ruby_jard/commands/color_scheme_command.rb +0 -42
  81. data/lib/ruby_jard/layouts/narrow_layout.rb +0 -41
  82. data/lib/ruby_jard/screens/empty_screen.rb +0 -13
@@ -11,5 +11,4 @@ require 'ruby_jard'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'pry'
15
- Pry.start(__FILE__)
14
+ IRB.start(__FILE__)
@@ -15,6 +15,7 @@ require 'ruby_jard/repl_proxy'
15
15
  require 'ruby_jard/repl_processor'
16
16
  require 'ruby_jard/screen_manager'
17
17
 
18
+ require 'ruby_jard/frame'
18
19
  require 'ruby_jard/session'
19
20
  require 'ruby_jard/version'
20
21
 
@@ -42,11 +43,6 @@ require 'ruby_jard/version'
42
43
  module RubyJard
43
44
  class Error < StandardError; end
44
45
 
45
- DEFAULT_LAYOUT_TEMPLATES = [
46
- RubyJard::Layouts::WideLayout,
47
- RubyJard::Layouts::NarrowLayout
48
- ].freeze
49
-
50
46
  def self.current_session
51
47
  @current_session ||= RubyJard::Session.new
52
48
  end
@@ -100,4 +96,8 @@ module Kernel
100
96
  def jard
101
97
  RubyJard.current_session.attach
102
98
  end
99
+
100
+ if RubyJard.config.alias_to_debugger
101
+ alias_method :debugger, :jard
102
+ end
103
103
  end
@@ -113,6 +113,9 @@ module RubyJard
113
113
  total_length = 0
114
114
  title_parts = Array(screen.title)
115
115
  title_parts.each_with_index do |title_part, index|
116
+ break if total_length >= screen.layout.box_width
117
+
118
+ title_part = title_part[0..screen.layout.box_width - total_length - 2 - 1 - 2]
116
119
  if index == 0
117
120
  @output.print @color_decorator.decorate(:title, " #{title_part} ")
118
121
  else
@@ -123,7 +126,7 @@ module RubyJard
123
126
  title_background = screen.layout.box_width - total_length - 2
124
127
  @output.print @color_decorator.decorate(
125
128
  :title_background,
126
- ' ' * (title_background < 0 ? 0 : title_background)
129
+ HORIZONTAL_LINE * (title_background < 0 ? 0 : title_background)
127
130
  )
128
131
  end
129
132
  end
@@ -1,30 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ruby_jard/color_scheme'
4
+
3
5
  module RubyJard
4
6
  ##
5
7
  # Color scheme registry.
6
- module ColorSchemes
8
+ class ColorSchemes
7
9
  class << self
8
- def color_scheme_registry
9
- @color_scheme_registry ||= {}
10
+ extend Forwardable
11
+ def_delegators :instance, :add_color_scheme, :[], :get, :names
12
+
13
+ def instance
14
+ @instance ||= new
10
15
  end
16
+ end
11
17
 
12
- def add_color_scheme(name, color_scheme_class)
13
- unless color_scheme_class < RubyJard::ColorScheme
14
- raise RubyJard::Error, "#{color_scheme_class} must implement, and inherit from #{RubyJard::ColorScheme}"
15
- end
18
+ def initialize
19
+ @color_scheme_registry = {}
20
+ end
16
21
 
17
- color_scheme_registry[name] = color_scheme_class
22
+ def add_color_scheme(name, color_scheme_class)
23
+ unless color_scheme_class < RubyJard::ColorScheme
24
+ raise RubyJard::Error, "#{color_scheme_class} must implement, and inherit from #{RubyJard::ColorScheme}"
18
25
  end
19
26
 
20
- def [](name)
21
- color_scheme_registry[name.to_s.strip]
22
- end
23
- alias get []
27
+ @color_scheme_registry[name] = color_scheme_class
28
+ end
24
29
 
25
- def names
26
- color_scheme_registry.keys.sort.dup
27
- end
30
+ def [](name)
31
+ @color_scheme_registry[name.to_s.strip]
32
+ end
33
+ alias_method :get, :[]
34
+
35
+ def names
36
+ @color_scheme_registry.keys.sort.dup
28
37
  end
29
38
  end
30
39
  end
40
+
41
+ require 'ruby_jard/color_schemes/deep_space_color_scheme'
42
+ require 'ruby_jard/color_schemes/256_color_scheme'
43
+ require 'ruby_jard/color_schemes/256_light_color_scheme'
44
+ require 'ruby_jard/color_schemes/gruvbox_color_scheme'
45
+ require 'ruby_jard/color_schemes/one_half_dark_color_scheme'
46
+ require 'ruby_jard/color_schemes/one_half_light_color_scheme'
@@ -1,19 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyJard
4
- module ColorSchemes
4
+ class ColorSchemes
5
5
  class X256ColorScheme < ColorScheme
6
6
  # Basic 256 colors that nearly all terminal supports. Just for backward-compatibility
7
7
  # https://en.wikipedia.org/wiki/ANSI_escape_code
8
8
  GRAY1 = '234'
9
- GRAY2 = '238'
10
- GRAY3 = '241'
9
+ GRAY2 = '237'
10
+ GRAY3 = '239'
11
11
  GRAY4 = '245'
12
12
  GRAY5 = '249'
13
13
  WHITE = '15'
14
14
  RED = '167'
15
15
  GREEN = '40'
16
- DARK_GREEN = '34'
17
16
  YELLOW = '184'
18
17
  BLUE = '75'
19
18
  PURPLE = '177'
@@ -23,39 +22,40 @@ module RubyJard
23
22
 
24
23
  BACKGROUND = nil
25
24
  STYLES = {
26
- background: [WHITE, BACKGROUND],
27
- border: [GRAY2, BACKGROUND],
28
- title: [GRAY1, BLUE],
29
- title_highlighted: [GRAY1, ORANGE],
30
- title_secondary: [WHITE, GRAY3],
31
- title_background: [WHITE, GRAY2],
32
- control_buttons: [GRAY4, BACKGROUND],
33
- thread_id: [BLUE, BACKGROUND],
34
- thread_name: [WHITE, BACKGROUND],
35
- thread_status_run: [GREEN, BACKGROUND],
36
- thread_status_sleep: [GRAY4, BACKGROUND],
37
- thread_status_other: [GRAY4, BACKGROUND],
38
- thread_location: [GRAY5, BACKGROUND],
39
- frame_id: [GRAY4, BACKGROUND],
40
- frame_id_highlighted: [GREEN, BACKGROUND],
41
- frame_location: [GRAY5, BACKGROUND],
42
- variable_mark: [GRAY4, BACKGROUND],
43
- variable_mark_inline: [GREEN, BACKGROUND],
44
- variable_size: [GRAY5, BACKGROUND],
45
- variable_inspection: [GRAY4, BACKGROUND],
46
- variable_assignment: [WHITE, BACKGROUND],
47
- source_line_mark: [GREEN, BACKGROUND],
48
- source_lineno: [GRAY4, BACKGROUND],
49
- keyword: [BLUE, BACKGROUND],
50
- method: [YELLOW, BACKGROUND],
51
- comment: [GRAY4, BACKGROUND],
52
- literal: [RED, BACKGROUND],
53
- string: [DARK_GREEN, BACKGROUND],
54
- local_variable: [PURPLE, BACKGROUND],
55
- instance_variable: [PURPLE, BACKGROUND],
56
- constant: [BLUE, BACKGROUND],
57
- normal_token: [GRAY5, BACKGROUND],
58
- object: [CYAN, BACKGROUND]
25
+ background: [WHITE, BACKGROUND],
26
+ border: [GRAY2, BACKGROUND],
27
+ title: [GRAY1, BLUE],
28
+ title_highlighted: [GRAY1, ORANGE],
29
+ title_secondary: [WHITE, GRAY3],
30
+ title_background: [GRAY2, GRAY2],
31
+ menu_mode: [ORANGE, BACKGROUND],
32
+ menu_tips: [GRAY4, BACKGROUND],
33
+ thread_id: [BLUE, BACKGROUND],
34
+ thread_name: [WHITE, BACKGROUND],
35
+ thread_status_run: [GREEN, BACKGROUND],
36
+ thread_status_sleep: [GRAY4, BACKGROUND],
37
+ thread_status_other: [GRAY4, BACKGROUND],
38
+ thread_location: [GRAY5, BACKGROUND],
39
+ frame_id: [GRAY4, BACKGROUND],
40
+ frame_id_highlighted: [GREEN, BACKGROUND],
41
+ frame_location: [GRAY5, BACKGROUND],
42
+ variable_mark: [GRAY4, BACKGROUND],
43
+ variable_mark_inline: [GREEN, BACKGROUND],
44
+ variable_size: [GRAY5, BACKGROUND],
45
+ variable_inspection: [GRAY4, BACKGROUND],
46
+ variable_assignment: [WHITE, BACKGROUND],
47
+ source_line_mark: [GREEN, BACKGROUND],
48
+ source_lineno: [GRAY4, BACKGROUND],
49
+ keyword: [BLUE, BACKGROUND],
50
+ method: [YELLOW, BACKGROUND],
51
+ comment: [GRAY4, BACKGROUND],
52
+ literal: [RED, BACKGROUND],
53
+ string: [GREEN, BACKGROUND],
54
+ local_variable: [PURPLE, BACKGROUND],
55
+ instance_variable: [PURPLE, BACKGROUND],
56
+ constant: [BLUE, BACKGROUND],
57
+ normal_token: [GRAY5, BACKGROUND],
58
+ object: [CYAN, BACKGROUND]
59
59
  }.freeze
60
60
  end
61
61
  end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyJard
4
+ class ColorSchemes
5
+ class X256LightColorScheme < ColorScheme
6
+ # Shameless copy from https://github.com/sonph/onehalf/blob/master/vim/colors/onehalflight.vim
7
+ GRAY1 = '237'
8
+ GRAY2 = '252'
9
+ GRAY3 = '247'
10
+ GRAY4 = '247'
11
+ GRAY5 = '237'
12
+
13
+ WHITE = '231'
14
+ RED = '167'
15
+ GREEN = '71'
16
+ YELLOW = '136'
17
+ BLUE = '31'
18
+ PURPLE = '127'
19
+ CYAN = '31'
20
+
21
+ BACKGROUND = WHITE
22
+ STYLES = {
23
+ background: [GRAY5, BACKGROUND],
24
+ border: [GRAY3, BACKGROUND],
25
+ title: [WHITE, GREEN],
26
+ title_highlighted: [WHITE, YELLOW],
27
+ title_secondary: [GRAY5, GRAY2],
28
+ title_background: [GRAY3, BACKGROUND],
29
+ menu_mode: [YELLOW, BACKGROUND],
30
+ menu_tips: [GRAY4, BACKGROUND],
31
+ thread_id: [GREEN, BACKGROUND],
32
+ thread_name: [GRAY5, BACKGROUND],
33
+ thread_status_run: [GREEN, BACKGROUND],
34
+ thread_status_sleep: [GRAY4, BACKGROUND],
35
+ thread_status_other: [GRAY4, BACKGROUND],
36
+ thread_location: [GRAY5, BACKGROUND],
37
+ frame_id: [GRAY4, BACKGROUND],
38
+ frame_id_highlighted: [YELLOW, BACKGROUND],
39
+ frame_location: [GRAY5, BACKGROUND],
40
+ variable_mark: [GRAY4, BACKGROUND],
41
+ variable_mark_inline: [YELLOW, BACKGROUND],
42
+ variable_size: [GRAY5, BACKGROUND],
43
+ variable_inspection: [GRAY5, BACKGROUND],
44
+ variable_assignment: [GRAY5, BACKGROUND],
45
+ source_line_mark: [YELLOW, BACKGROUND],
46
+ source_lineno: [GRAY4, BACKGROUND],
47
+ keyword: [PURPLE, BACKGROUND],
48
+ method: [BLUE, BACKGROUND],
49
+ comment: [GRAY4, BACKGROUND],
50
+ literal: [YELLOW, BACKGROUND],
51
+ string: [GREEN, BACKGROUND],
52
+ local_variable: [RED, BACKGROUND],
53
+ instance_variable: [RED, BACKGROUND],
54
+ constant: [YELLOW, BACKGROUND],
55
+ normal_token: [GRAY5, BACKGROUND],
56
+ object: [YELLOW, BACKGROUND]
57
+ }.freeze
58
+ end
59
+ end
60
+ end
61
+
62
+ RubyJard::ColorSchemes.add_color_scheme('256-light', RubyJard::ColorSchemes::X256LightColorScheme)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyJard
4
- module ColorSchemes
4
+ class ColorSchemes
5
5
  class DeepSpaceColorScheme < ColorScheme
6
6
  # Shameless copy from https://github.com/tyrannicaltoucan/vim-deep-space/blob/master/colors/deep-space.vim
7
7
  GRAY1 = '#1b202a'
@@ -11,8 +11,7 @@ module RubyJard
11
11
  GRAY5 = '#9aa7bd'
12
12
  WHITE = '#fff'
13
13
  RED = '#b15e7c'
14
- GREEN = '#96f08d'
15
- DARK_GREEN = '#709d6c'
14
+ GREEN = '#80b57b'
16
15
  YELLOW = '#e8cb6b'
17
16
  BLUE = '#78b5ff'
18
17
  PURPLE = '#b08aed'
@@ -22,39 +21,40 @@ module RubyJard
22
21
 
23
22
  BACKGROUND = GRAY1
24
23
  STYLES = {
25
- background: [WHITE, BACKGROUND],
26
- border: [GRAY3, BACKGROUND],
27
- title: [GRAY2, BLUE],
28
- title_highlighted: [GRAY2, ORANGE],
29
- title_secondary: [WHITE, GRAY3],
30
- title_background: [WHITE, GRAY2],
31
- control_buttons: [GRAY4, BACKGROUND],
32
- thread_id: [BLUE, BACKGROUND],
33
- thread_name: [WHITE, BACKGROUND],
34
- thread_status_run: [GREEN, BACKGROUND],
35
- thread_status_sleep: [GRAY4, BACKGROUND],
36
- thread_status_other: [GRAY4, BACKGROUND],
37
- thread_location: [GRAY5, BACKGROUND],
38
- frame_id: [GRAY4, BACKGROUND],
39
- frame_id_highlighted: [GREEN, BACKGROUND],
40
- frame_location: [GRAY5, BACKGROUND],
41
- variable_mark: [GRAY4, BACKGROUND],
42
- variable_mark_inline: [GREEN, BACKGROUND],
43
- variable_size: [GRAY5, BACKGROUND],
44
- variable_inspection: [GRAY4, BACKGROUND],
45
- variable_assignment: [WHITE, BACKGROUND],
46
- source_line_mark: [GREEN, BACKGROUND],
47
- source_lineno: [GRAY4, BACKGROUND],
48
- keyword: [BLUE, BACKGROUND],
49
- method: [YELLOW, BACKGROUND],
50
- comment: [GRAY4, BACKGROUND],
51
- literal: [RED, BACKGROUND],
52
- string: [DARK_GREEN, BACKGROUND],
53
- local_variable: [PURPLE, BACKGROUND],
54
- instance_variable: [PURPLE, BACKGROUND],
55
- constant: [BLUE, BACKGROUND],
56
- normal_token: [GRAY5, BACKGROUND],
57
- object: [CYAN, BACKGROUND]
24
+ background: [WHITE, BACKGROUND],
25
+ border: [GRAY3, BACKGROUND],
26
+ title: [GRAY2, BLUE],
27
+ title_highlighted: [GRAY2, ORANGE],
28
+ title_secondary: [WHITE, GRAY3],
29
+ title_background: [GRAY2, GRAY2],
30
+ menu_mode: [ORANGE, BACKGROUND],
31
+ menu_tips: [GRAY4, BACKGROUND],
32
+ thread_id: [BLUE, BACKGROUND],
33
+ thread_name: [WHITE, BACKGROUND],
34
+ thread_status_run: [GREEN, BACKGROUND],
35
+ thread_status_sleep: [GRAY4, BACKGROUND],
36
+ thread_status_other: [GRAY4, BACKGROUND],
37
+ thread_location: [GRAY5, BACKGROUND],
38
+ frame_id: [GRAY4, BACKGROUND],
39
+ frame_id_highlighted: [GREEN, BACKGROUND],
40
+ frame_location: [GRAY5, BACKGROUND],
41
+ variable_mark: [GRAY4, BACKGROUND],
42
+ variable_mark_inline: [GREEN, BACKGROUND],
43
+ variable_size: [GRAY5, BACKGROUND],
44
+ variable_inspection: [GRAY4, BACKGROUND],
45
+ variable_assignment: [WHITE, BACKGROUND],
46
+ source_line_mark: [GREEN, BACKGROUND],
47
+ source_lineno: [GRAY4, BACKGROUND],
48
+ keyword: [BLUE, BACKGROUND],
49
+ method: [YELLOW, BACKGROUND],
50
+ comment: [GRAY4, BACKGROUND],
51
+ literal: [RED, BACKGROUND],
52
+ string: [GREEN, BACKGROUND],
53
+ local_variable: [PURPLE, BACKGROUND],
54
+ instance_variable: [PURPLE, BACKGROUND],
55
+ constant: [BLUE, BACKGROUND],
56
+ normal_token: [GRAY5, BACKGROUND],
57
+ object: [CYAN, BACKGROUND]
58
58
  }.freeze
59
59
  end
60
60
  end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyJard
4
+ class ColorSchemes
5
+ class GruvboxColorScheme < ColorScheme
6
+ # Shameless copy from https://github.com/morhetz/gruvbox
7
+ GRAY1 = '#282828'
8
+ GRAY2 = '#3c3836'
9
+ GRAY3 = '#504945'
10
+ GRAY4 = '#d5c4a1'
11
+ GRAY5 = '#ebdbb2'
12
+ WHITE = '#f9f5d7'
13
+ RED = '#fb4934'
14
+ GREEN = '#b8bb26'
15
+ YELLOW = '#fabd2f'
16
+ BLUE = '#83a598'
17
+ PURPLE = '#d3869b'
18
+ CYAN = '#8ec07c'
19
+ ORANGE = '#fe8019'
20
+
21
+ BACKGROUND = GRAY1
22
+ STYLES = {
23
+ background: [WHITE, BACKGROUND],
24
+ border: [GRAY3, BACKGROUND],
25
+ title: [GRAY2, BLUE],
26
+ title_highlighted: [GRAY2, ORANGE],
27
+ title_secondary: [WHITE, GRAY3],
28
+ title_background: [GRAY2, GRAY2],
29
+ menu_mode: [ORANGE, BACKGROUND],
30
+ menu_tips: [GRAY4, BACKGROUND],
31
+ thread_id: [BLUE, BACKGROUND],
32
+ thread_name: [WHITE, BACKGROUND],
33
+ thread_status_run: [GREEN, BACKGROUND],
34
+ thread_status_sleep: [GRAY4, BACKGROUND],
35
+ thread_status_other: [GRAY4, BACKGROUND],
36
+ thread_location: [GRAY5, BACKGROUND],
37
+ frame_id: [GRAY4, BACKGROUND],
38
+ frame_id_highlighted: [GREEN, BACKGROUND],
39
+ frame_location: [GRAY5, BACKGROUND],
40
+ variable_mark: [GRAY4, BACKGROUND],
41
+ variable_mark_inline: [GREEN, BACKGROUND],
42
+ variable_size: [GRAY5, BACKGROUND],
43
+ variable_inspection: [GRAY4, BACKGROUND],
44
+ variable_assignment: [WHITE, BACKGROUND],
45
+ source_line_mark: [GREEN, BACKGROUND],
46
+ source_lineno: [GRAY4, BACKGROUND],
47
+ keyword: [BLUE, BACKGROUND],
48
+ method: [YELLOW, BACKGROUND],
49
+ comment: [GRAY4, BACKGROUND],
50
+ literal: [RED, BACKGROUND],
51
+ string: [GREEN, BACKGROUND],
52
+ local_variable: [PURPLE, BACKGROUND],
53
+ instance_variable: [PURPLE, BACKGROUND],
54
+ constant: [BLUE, BACKGROUND],
55
+ normal_token: [GRAY5, BACKGROUND],
56
+ object: [CYAN, BACKGROUND]
57
+ }.freeze
58
+ end
59
+ end
60
+ end
61
+
62
+ RubyJard::ColorSchemes.add_color_scheme('gruvbox', RubyJard::ColorSchemes::GruvboxColorScheme)
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyJard
4
+ class ColorSchemes
5
+ class OneHalfDarkColorScheme < ColorScheme
6
+ # Shameless copy from https://github.com/sonph/onehalf/blob/master/vim/colors/onehalfdark.vim
7
+ GRAY1 = '#282c34'
8
+ GRAY2 = '#313640'
9
+ GRAY3 = '#5c6370'
10
+ GRAY4 = '#dcdfe4'
11
+ GRAY5 = '#dcdfe4'
12
+ WHITE = '#dcdfe4'
13
+ RED = '#e06c75'
14
+ GREEN = '#98c379'
15
+ YELLOW = '#e5c07b'
16
+ BLUE = '#61afef'
17
+ PURPLE = '#c678dd'
18
+ CYAN = '#56b6c2'
19
+
20
+ BACKGROUND = GRAY1
21
+ STYLES = {
22
+ background: [WHITE, BACKGROUND],
23
+ border: [GRAY3, BACKGROUND],
24
+ title: [GRAY2, GREEN],
25
+ title_highlighted: [GRAY2, YELLOW],
26
+ title_secondary: [WHITE, GRAY3],
27
+ title_background: [GRAY2, GRAY2],
28
+ menu_mode: [YELLOW, BACKGROUND],
29
+ menu_tips: [GRAY4, BACKGROUND],
30
+ thread_id: [GREEN, BACKGROUND],
31
+ thread_name: [WHITE, BACKGROUND],
32
+ thread_status_run: [GREEN, BACKGROUND],
33
+ thread_status_sleep: [GRAY4, BACKGROUND],
34
+ thread_status_other: [GRAY4, BACKGROUND],
35
+ thread_location: [GRAY5, BACKGROUND],
36
+ frame_id: [GRAY4, BACKGROUND],
37
+ frame_id_highlighted: [YELLOW, BACKGROUND],
38
+ frame_location: [GRAY5, BACKGROUND],
39
+ variable_mark: [GRAY4, BACKGROUND],
40
+ variable_mark_inline: [YELLOW, BACKGROUND],
41
+ variable_size: [GRAY5, BACKGROUND],
42
+ variable_inspection: [GRAY4, BACKGROUND],
43
+ variable_assignment: [WHITE, BACKGROUND],
44
+ source_line_mark: [YELLOW, BACKGROUND],
45
+ source_lineno: [GRAY4, BACKGROUND],
46
+ keyword: [PURPLE, BACKGROUND],
47
+ method: [BLUE, BACKGROUND],
48
+ comment: [GRAY4, BACKGROUND],
49
+ literal: [YELLOW, BACKGROUND],
50
+ string: [GREEN, BACKGROUND],
51
+ local_variable: [RED, BACKGROUND],
52
+ instance_variable: [RED, BACKGROUND],
53
+ constant: [YELLOW, BACKGROUND],
54
+ normal_token: [GRAY5, BACKGROUND],
55
+ object: [YELLOW, BACKGROUND]
56
+ }.freeze
57
+ end
58
+ end
59
+ end
60
+
61
+ RubyJard::ColorSchemes.add_color_scheme('one-half-dark', RubyJard::ColorSchemes::OneHalfDarkColorScheme)