Skip to content

Commit 6cdd272

Browse files
committed
Add support for nerdfont based bar_format symbols
Signed-off-by: Gabriel Mazetto <[email protected]>
1 parent 9cd539e commit 6cdd272

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ There are number of preconfigured bar formats you can choose from.
571571
| `:diamond` | `♦♦♦♦♦♢♢♢♢♢` | `♢♦♢` |
572572
| `:dot` | `・・・・・・・・・・` | `・・・` |
573573
| `:heart` | `♥♥♥♥♥♡♡♡♡♡` | `♡♥♡` |
574+
| `:nerdfont`| ``| `` |
574575
| `:rectangle` | `▮▮▮▮▮▯▯▯▯▯` | `▯▮▯` |
575576
| `:square` | `▪▪▪▪▪▫▫▫▫▫` | `▫▪▫` |
576577
| `:star` | `★★★★★☆☆☆☆☆` | `☆★☆` |

lib/tty/progressbar/formats.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ module Formats
7979
incomplete: "♡",
8080
unknown: "♡♥♡"
8181
},
82+
nerdfont: { # 
83+
complete: "",
84+
incomplete: "",
85+
unknown: ""
86+
},
8287
rectangle: { # ▮▮▮▮▮▯▯▯▯▯
8388
complete: "▮",
8489
incomplete: "▯",

spec/unit/new_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"unsupported bar format: :unknown. Available formats are: " \
7070
":arrow, :asterisk, :blade, :block, :box, :bracket, " \
7171
":burger, :button, :chevron, :circle, :classic, :crate, :diamond, :dot, " \
72-
":heart, :rectangle, :square, :star, :track, :tread, :triangle, :wave"
72+
":heart, :nerdfont, :rectangle, :square, :star, :track, "\
73+
":tread, :triangle, :wave"
7374
)
7475
end
7576

0 commit comments

Comments
 (0)