Skip to content

Commit f2eb617

Browse files
authored
Merge pull request #44 from rubyatscale/martinemde/nocolorize
Remove colorize gem, just use the escape codes
2 parents 52273dc + d7ec8b9 commit f2eb617

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Gemfile.lock

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
PATH
22
remote: .
33
specs:
4-
singed (0.2.2)
5-
colorize
4+
singed (0.3.0)
65
stackprof (>= 0.2.13)
76

87
GEM
98
remote: https://rubygems.org/
109
specs:
1110
ast (2.4.2)
12-
colorize (0.8.1)
1311
diff-lcs (1.5.0)
1412
json (2.7.2)
1513
language_server-protocol (3.17.0.3)
@@ -78,4 +76,4 @@ DEPENDENCIES
7876
standard
7977

8078
BUNDLED WITH
81-
2.4.4
79+
2.6.9

lib/singed.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
require "json"
44
require "stackprof"
5-
require "colorize"
65

76
module Singed
87
extend self

lib/singed/kernel_ext.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ def flamegraph(label = nil, open: true, ignore_gc: false, interval: 1000, io: $s
44
result = fg.record(&)
55
fg.save
66

7+
# avoid a dep on a colorizing gem by doing this ourselves
8+
bright_red = "\e[91m"
9+
none = "\e[0m"
710
if open
811
# use npx, so we don't have to add it as a dependency
9-
io.puts "🔥📈 #{"Captured flamegraph, opening with".colorize(:bold).colorize(:red)}: #{fg.open_command}"
12+
io.puts "🔥📈 #{bright_red}Captured flamegraph, opening with#{none}: #{fg.open_command}"
1013
fg.open
1114
else
12-
io.puts "🔥📈 #{"Captured flamegraph to file".colorize(:bold).colorize(:red)}: #{fg.filename}"
15+
io.puts "🔥📈 #{bright_red}Captured flamegraph to file#{none}: #{fg.filename}"
1316
end
1417

1518
result

singed.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Gem::Specification.new do |spec|
44
spec.name = "singed"
55

6-
spec.version = "0.2.3"
6+
spec.version = "0.3.0"
77
spec.license = "MIT"
88
spec.authors = ["Josh Nichols"]
99
spec.email = ["[email protected]"]
@@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
2121
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2222
spec.require_paths = ["lib"]
2323

24-
spec.add_dependency "colorize"
2524
spec.add_dependency "stackprof", ">= 0.2.13"
2625

2726
spec.add_development_dependency "rake", "~> 13.0"

0 commit comments

Comments
 (0)