Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
PATH
remote: .
specs:
singed (0.2.2)
colorize
singed (0.3.0)
stackprof (>= 0.2.13)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
colorize (0.8.1)
diff-lcs (1.5.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
Expand Down Expand Up @@ -78,4 +76,4 @@ DEPENDENCIES
standard

BUNDLED WITH
2.4.4
2.6.9
1 change: 0 additions & 1 deletion lib/singed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require "json"
require "stackprof"
require "colorize"

module Singed
extend self
Expand Down
7 changes: 5 additions & 2 deletions lib/singed/kernel_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ def flamegraph(label = nil, open: true, ignore_gc: false, interval: 1000, io: $s
result = fg.record(&)
fg.save

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

result
Expand Down
3 changes: 1 addition & 2 deletions singed.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Gem::Specification.new do |spec|
spec.name = "singed"

spec.version = "0.2.3"
spec.version = "0.3.0"
spec.license = "MIT"
spec.authors = ["Josh Nichols"]
spec.email = ["josh.nichols@gusto.com"]
Expand All @@ -21,7 +21,6 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "colorize"
spec.add_dependency "stackprof", ">= 0.2.13"

spec.add_development_dependency "rake", "~> 13.0"
Expand Down