Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.

Commit 678ce2b

Browse files
committed
Update docs for 0.2.1 release
1 parent 0d115a3 commit 678ce2b

File tree

8 files changed

+57
-27
lines changed

8 files changed

+57
-27
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## [0.2.1 - Alpha 3] - Render mechanism and theme system
4+
### UX/UI
5+
- New color scheme: 256, as the default color scheme. It works well with all 256-color terminal emulators.
6+
- New color scheme: deep-space. It's a 24-bit color scheme.
7+
- UX change: swap positions of default panels:
8+
```
9+
Source | Backtrace
10+
Variables | Threads
11+
```
12+
- New narrow layout, which consists of source and variables only. Useful when running tests.
13+
- Add aliases to common commands
14+
### Bug fixes
15+
- https://github.com/nguyenquangminh0711/ruby_jard/issues/2
16+
- Fix display bug that some rows are out of screen if above rows have word wraps.
17+
### Internal Refactoring
18+
- New rendering mechanism, that supports data windowing, selection locating, and cursor.
19+
- Improve compatibility, and add fallbacks in case io/console, or tput are not available.
20+
321
## [0.2.0 - Alpha 2] - UI completeness
422
523
### UX/UI

README.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
![Ruby Jard](./docs/logo.jpg)
22

3-
Jard stands for Just Another Ruby Debugger, aims to provide a better experience while debugging Ruby. Ruby Jard supports the following major features at the moment:
3+
Jard stands for Just Another Ruby Debugger, aims to provide a better experience while debugging Ruby. Ruby Jard supports the following major features at the moment:
44

55
- Informative Terminal UI, reduce your mental effort for repeated stuff so that you can focus on killing bugs.
6-
- Highlighted source code screen.
7-
- Backtrace visualization and navigation.
8-
- Auto variable display in the current context.
6+
- Highlighted source code screen.
7+
- Backtrace visualization and navigation.
8+
- Auto variable display in the current context.
99
- Multi-thread exploration and debugging.
1010

1111
Ruby Jard's core is [Byebug](https://github.com/deivid-rodriguez/byebug), an awesome de factor debugger for Ruby. Therefore, Ruby Jard supports most of Byebug's functionalities.
1212

13-
If you still don't know what it is, let's watch this video.
13+
If you still don't know what it is, let's watch this video.
1414

15-
[![asciicast](https://asciinema.org/a/348526.svg)](https://asciinema.org/a/348526)
15+
[![Ruby Jard Demo](./docs/demo.png)](https://asciinema.org/a/350233)
1616

1717
## Getting Started
1818

@@ -41,19 +41,19 @@ When Jard attaches at any line of code, the main tile-style UI shows up. By defa
4141

4242
### Source panel
4343

44-
<img src="./docs/screen-source.png" alt="Source screen" style="max-width: 500px;" />
44+
<img src="./docs/screen-source.png" alt="Source screen" />
4545

46-
This panel shows the current line of code that your program is stopping, and surrounding related lines. The number of lines shown in this panel depends on your current terminal height, but never less than 5.
46+
This panel shows the current line of code that your program is stopping, and surrounding related lines. The number of lines shown in this panel depends on your current terminal height, but never less than 5.
4747

4848
Ruby Jard supports any file extensions that your program runs into, especially `.rb`, `.erb`, `.haml` files. Other file types may encounter minor syntax highlighting issues.
4949

5050
Ruby Jard also supports inspecting gems and libraries, if you are interested.
5151

5252
### Backtrace panel
5353

54-
<img src="./docs/screen-backtrace.png" alt="Screen backtrace" style="max-width: 500px;" />
54+
<img src="./docs/screen-backtrace.png" alt="Screen backtrace"/>
5555

56-
This panel describes the current backtrace of the current thread your program is stopping. Each line of this panel describes the current Frame. What is frame and backtrace by the way? Let's step back a little bit at how Ruby executes your code. Internally, Ruby uses an interpreter to read and execute your code, line by line (technically, YARD instructions, but let's go with a simple version). When it meets a chunk of code that needs to open a new scope, like method calls or inline-block call, the interpreter creates a new structure to store the current context so that it can link to the next scope and go back later. This data structure is call Frame. The interpreter pushes frame into a stack, called backtrace (or stack trace, or call stack, whatever), and continues to execute your code. Each thread has a separate backtrace. To understand deeply, you may be interested in this wonderful slide: [Grow and Shrink - Dynamically Extending the Ruby VM Stack](https://www.slideshare.net/KeitaSugiyama1/grow-and-shrink-dynamically-extending-the-ruby-vm-stack).
56+
This panel describes the current backtrace of the current thread your program is stopping. Each line of this panel describes the current Frame. What is frame and backtrace by the way? Let's step back a little bit at how Ruby executes your code. Internally, Ruby uses an interpreter to read and execute your code, line by line (technically, YARD instructions, but let's go with a simple version). When it meets a chunk of code that needs to open a new scope, like method calls or inline-block call, the interpreter creates a new structure to store the current context so that it can link to the next scope and go back later. This data structure is call Frame. The interpreter pushes frame into a stack, called backtrace (or stack trace, or call stack, whatever), and continues to execute your code. Each thread has a separate backtrace. To understand deeply, you may be interested in this wonderful slide: [Grow and Shrink - Dynamically Extending the Ruby VM Stack](https://www.slideshare.net/KeitaSugiyama1/grow-and-shrink-dynamically-extending-the-ruby-vm-stack).
5757

5858
Overall, the whole backtrace panel lets you know where you are stopping at, the trace of how your program is running. When combining with other tools and other panels, you will be surprised by how much information the bugger can help you when you encounter your bugs.
5959

@@ -65,19 +65,19 @@ Each frame includes the following information:
6565

6666
### Variable panel
6767

68-
<img src="./docs/screen-variables.png" alt="Variables screen" style="max-width: 500px;" />
68+
<img src="./docs/screen-variables.png" alt="Variables screen"/>
6969

7070
The variable panel lets you explore all the local variables, instance variables, and constants in the current display context. Each variable is described by:
7171

72-
- Inline indicator: the beginning dot (``) implies a variable that appears in the current line.
72+
- Inline indicator: the beginning dot (``) implies a variable that appears in the current line.
7373
- Variable type: allow you to know the type of a variable at a single glance. Only built-in types, such as `int`, `flt`, `hash`, `bool`, `rng`, are supported. Instances of any classes will be noted as `var`.
7474
- Size of variable: the size of collection-like variables. Current Jard version supports 3 types:
75-
- Hash: this field shows the number of keys
75+
- Hash: this field shows the number of keys
7676
- Array: this field shows the number of items
7777
- String: this field shows the number of character (fetched from`String#size` method)
7878
- Variable inspection: the content of the variable. The current Jard version generates this field by calling `#inspect`. **Known issue**: this accidentally triggers materializing method of objects, such as `ActiveRecord::Relation`. Future Jard version gonna fix this by a new safe generator.
7979

80-
This panel interacts well with backtrace panel and backtrace-exploring commands such as (`up`, `down`, `frame`, etc.) to inspect relative variables at each frame layer in the program. A common use case is to recall the parameter values you forgot when digging too deep into a method call.
80+
This panel interacts well with backtrace panel and backtrace-exploring commands such as (`up`, `down`, `frame`, etc.) to inspect relative variables at each frame layer in the program. A common use case is to recall the parameter values you forgot when digging too deep into a method call.
8181

8282
By default, the variables are sorted by the following criteria:
8383

@@ -90,9 +90,9 @@ By default, the variables are sorted by the following criteria:
9090

9191
### Thread panel
9292

93-
<img src="./docs/screen-threads.png" alt="Screen threads" style="max-width: 500px;" />
93+
<img src="./docs/screen-threads.png" alt="Screen threads" />
9494

95-
Show all the threads running at the moment. This panel is useful when you are working with a complicated multi-threaded environment like web server, or background jobs.
95+
Show all the threads running at the moment. This panel is useful when you are working with a complicated multi-threaded environment like web server, or background jobs.
9696

9797
### Repl panel
9898

@@ -102,12 +102,24 @@ An interactive Repl for you to interact with your program, inspect values, updat
102102

103103
## Commands
104104

105+
### List
106+
107+
**Repl command**: `list`
108+
109+
**Key binding:** F5
110+
111+
**Alias**: `l`
112+
113+
Refresh the whole terminal UI. This command doesn't move you to other steps, nor change any data in your session. It is useful (or the only way) to get back the beautiful UI if you type too much in the REPL console.
114+
105115
### Step
106116

107117
**Repl command**: `step`
108118

109119
**Key binding**: F7
110120

121+
**Alias**: `s`
122+
111123
Detect and step into a method call or block in the current line. If there isn't anything to step in, the program continues to next line. In case there are multiple methods on the same line, Jard hornors Ruby's execution order.
112124

113125
### Step out
@@ -116,6 +128,8 @@ Detect and step into a method call or block in the current line. If there isn't
116128

117129
**Key binding**: Shift + F7
118130

131+
**Alias**: `so`
132+
119133
The opposite of step out. This command is used to finish the execution of current frame, and jump to the next line of upper frame. In other words, this command is equivalent to the sequence `up` and `next`. If the neighbor frame already finishes, it continues with even higher frame.
120134

121135
This command is useful when you loose your interest in frame, and want to quickly go up again. One example is that you accidentally step into a longgggg loop with nothing useful. Another example is that you step into the library source code and don't really care what it does underlying.
@@ -126,14 +140,18 @@ This command is useful when you loose your interest in frame, and want to quickl
126140

127141
**Key binding**: F8
128142

129-
Continue to the next line in the current frame, by pass any steppable method call or blocks in the mid way unless they contains dynamic breakpoint or any `jard` attachment command. If the current frame already reaches the end, it continues to the next line of upper frame and so on.
143+
**Alias**: `n`
144+
145+
Continue to the next line in the current frame, by pass any steppable method call or blocks in the mid way unless they contains dynamic breakpoint or any `jard` attachment command. If the current frame already reaches the end, it continues to the next line of upper frame and so on.
130146

131147
### Continue
132148

133149
**Repl command**: `continue`
134150

135151
**Key binding**: F9
136152

153+
**Alias**: `c`
154+
137155
Continue the execution of your program to the end, or stop at the first dynamic break point or `jard` attachment command. One common confusion is that long-running ruby processes, such as web server or background jobs, won't stop, and may be used to debug the next request without restarting. If you want to end everything and just exit the process, let's use `exit`.
138156

139157
### Up
@@ -142,7 +160,7 @@ Continue the execution of your program to the end, or stop at the first dynamic
142160

143161
**Key binding**: F6
144162

145-
Explore the upper frame. When you use this command, all associated displaying screens will be updated accordingly, but your program current position is still at the latest frame. This command is mostly used to explore, and view the trace, input parameters, or how your program stops at the current position. When use this command, you should have a glance at Variable panel, and Source panel to see the variables at destination frame.
163+
Explore the upper frame. When you use this command, all associated displaying screens will be updated accordingly, but your program current position is still at the latest frame. This command is mostly used to explore, and view the trace, input parameters, or how your program stops at the current position. When use this command, you should have a glance at Variable panel, and Source panel to see the variables at destination frame.
146164

147165
You can combine with `next` or `step` to perform powerful execution redirection at the destination frame. Let's look at an example. You are debugging a chain of 10 rack middlewares, you go deep into the #9 middleware, found something, then want to go back to #5 middleware. It's pretty boring and frustrated to just use `next` or `step-out` and hope it eventually goes back. Now use `up` for some times (or `frame`, described below) to go to your desired frame, and use `next` there. Tada, it's magical, just like teleport.
148166

@@ -164,13 +182,7 @@ Explore the lower frame. See `up` command for more information.
164182

165183
**Examples**:`frame 10`
166184

167-
Explore a particular frame with id `<frame_id>`. It's faster than `up` and `down`. See `up` command for more information.
168-
169-
170-
171-
## Roadmap
172-
173-
The ultimate goal of Ruby Jard is to provide a better experience while debugging Ruby. All the items in the roadmap are supposed to serve that. However, I have a life. There won't be any promises on when those items will be finished. In fact, this roadmap may be changed at anytime, depends on the current direction, focus and circumstances.
185+
Explore a particular frame with id `<frame_id>`. It's faster than `up` and `down`. See `up` command for more information.
174186

175187
### [Done] Version 0.1.0: Proof of concept
176188

@@ -182,7 +194,7 @@ The bootstrap version is just a series of ugly prints on stdout. It's frustrated
182194

183195
### Version 0.3.0: Complete the workflow
184196

185-
This version focuses on making Jard usable for daily activities of any developer. In other words, this version is to become a complete replacement for Byebug (sorry :pray:).
197+
This version focuses on making Jard usable for daily activities of any developer. In other words, this version is to become a complete replacement for Byebug (sorry :pray:).
186198

187199
- Dynamic breakpoints.
188200
- Watch expressions.

docs/demo.png

125 KB
Loading

docs/screen-backtrace.png

105 KB
Loading

docs/screen-source.png

1.18 KB
Loading

docs/screen-threads.png

-25.8 KB
Loading

docs/screen-variables.png

-19.4 KB
Loading

lib/ruby_jard/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Semantic versionn
44
module RubyJard
5-
VERSION = '0.2.0'
5+
VERSION = '0.2.1'
66
end

0 commit comments

Comments
 (0)