stackprof-webnav 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1dc3f5aab4a2ed125868d17bf4657933d657f5d9a697813d182cae1ba1b293e
4
- data.tar.gz: ec484153a1283461143792401a681687c812a0a5698866954fba5b576d87d8c5
3
+ metadata.gz: 1552e5fc93e065620a447d3a7c32e23da16590ee857cfd2e13a5856fcc0972ad
4
+ data.tar.gz: 7514d5a49e0544494ee8fcf924ba6d3f9f2bccfb7cee2021c1b588b8cc6b4af5
5
5
  SHA512:
6
- metadata.gz: a65aaa8975d84e9917af3327c389eb0243060480fbb9f3bf99e017fef3c947f2fd4ac7ccdfba785ac3149ccc7e107cd24bb7a665ca9f40cbc3fc2d9c428df8d5
7
- data.tar.gz: b92cfeffddfec601b8f6412e2f3123c298c407bad8a7256d6485f5a97999e934430ea14f0802ad20ff5681042bc50f0c51f5c75c2cfc84daa387de677274c547
6
+ metadata.gz: 9573405eb7fd02e23b6bf72d9f1065b6a6b6c584cf83c17e07388fa4722c79bfc9fa1e4c5bc8e48d0850ae8d33fd69456f67b6a82c9a5178f9dbb3b4a52b5a6e
7
+ data.tar.gz: 74c6a96b5e19164f8b2ee61803f59f1af867a4b5ccf3155156000e939e9607517468cecedd62671468bd9a81ab2ef9fe2159f11d5b532a2c1b245bbc98f8b889
@@ -0,0 +1,37 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.7']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: Install graphviz
35
+ run: sudo apt-get install -y graphviz
36
+ - name: Run tests
37
+ run: bundle exec rspec
data/bin/stackprof-webnav CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'optparse'
3
- require 'stackprof-webnav'
4
3
  require 'rack'
5
4
 
5
+ require_relative '../lib/stackprof-webnav'
6
+
6
7
  options = {
7
8
  :addr => "127.0.0.1",
8
9
  :port => 9292
@@ -1 +1 @@
1
- require 'stackprof-webnav/server'
1
+ require_relative 'stackprof-webnav/server'
@@ -36,6 +36,6 @@ class Dump
36
36
  end
37
37
 
38
38
  def graph_image_path
39
- @path + ".#{checksum}.graph.png"
39
+ @path + ".#{checksum}.graph.svg"
40
40
  end
41
41
  end
@@ -5,3 +5,14 @@ table {
5
5
  pre code {
6
6
  color: black;
7
7
  }
8
+
9
+ #graph > a {
10
+ position: absolute;
11
+ }
12
+ #graph > div {
13
+ overflow: scroll;
14
+ height: 100%;
15
+ }
16
+ #graph > div > img {
17
+ max-width: initial;
18
+ }
@@ -1,10 +1,10 @@
1
1
  require 'sinatra'
2
2
  require 'haml'
3
- require "stackprof"
3
+ require 'stackprof'
4
4
  require_relative 'presenter'
5
5
  require_relative 'dump'
6
6
  require 'pry'
7
- require "sinatra/reloader" if development?
7
+ require 'sinatra/reloader' if development?
8
8
  require 'ruby-graphviz'
9
9
 
10
10
  module StackProf
@@ -103,7 +103,7 @@ module StackProf
103
103
  send_file(current_dump.flame_graph_path, type: 'text/javascript')
104
104
  end
105
105
 
106
- get '/graph.png' do
106
+ get '/graph.svg' do
107
107
  ensure_file_generated(current_dump.graph_path) do |file|
108
108
  current_report.print_graphviz({}, file)
109
109
  end
@@ -111,10 +111,10 @@ module StackProf
111
111
  ensure_file_generated(current_dump.graph_image_path) do |file|
112
112
  GraphViz
113
113
  .parse(current_dump.graph_path)
114
- .output(png: current_dump.graph_image_path)
114
+ .output(svg: current_dump.graph_image_path)
115
115
  end
116
116
 
117
- send_file(current_dump.graph_image_path, type: 'image/png')
117
+ send_file(current_dump.graph_image_path, type: 'image/svg+xml')
118
118
  end
119
119
 
120
120
  get '/graph' do
@@ -1,5 +1,5 @@
1
1
  module StackProf
2
2
  module Webnav
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
- %a{:href => url_for("/overview")}
2
- %button Back to overview
3
-
4
- %img{src: url_for("/graph.png")}
1
+ #graph
2
+ %a{:href => url_for("/overview")}
3
+ %button Back to overview
4
+ %div
5
+ %img{src: url_for("/graph.svg")}
@@ -8,7 +8,7 @@ RSpec.describe "integration tests" do
8
8
  after(:each) do
9
9
  Dir.glob("spec/fixtures/*.flames.json").each {|file| File.delete(file) }
10
10
  Dir.glob("spec/fixtures/*.digraph.dot").each {|file| File.delete(file) }
11
- Dir.glob("spec/fixtures/*.graph.png").each {|file| File.delete(file) }
11
+ Dir.glob("spec/fixtures/*.graph.svg").each {|file| File.delete(file) }
12
12
  end
13
13
 
14
14
  describe "index" do
@@ -55,8 +55,8 @@ RSpec.describe "integration tests" do
55
55
  end
56
56
 
57
57
  it "is able to render graph" do
58
- app.get "/graph.png", dump: fixture_path("test.dump")
59
- expect(response.get_header("Content-Type")).to eq("image/png")
58
+ app.get "/graph.svg", dump: fixture_path("test.dump")
59
+ expect(response.get_header("Content-Type")).to eq("image/svg+xml")
60
60
  expect(response.body.size).to_not eq(0)
61
61
  end
62
62
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency "better_errors", "~> 1.1.0"
28
28
  spec.add_dependency "ruby-graphviz", "~> 1.2.4"
29
29
  spec.add_dependency "sinatra-contrib", "~> 2.0.5"
30
- spec.add_development_dependency "bundler", "~> 1.5"
30
+ spec.add_development_dependency "bundler", "~> 2.2"
31
31
  spec.add_development_dependency "rake", "~> 10.1"
32
32
  spec.add_development_dependency "rspec", "~> 3.9.0"
33
33
  spec.add_development_dependency "rack-test", "~> 1.1.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackprof-webnav
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Lisnic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2021-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.5'
103
+ version: '2.2'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.5'
110
+ version: '2.2'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +158,7 @@ executables:
158
158
  extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
+ - ".github/workflows/ruby.yml"
161
162
  - ".gitignore"
162
163
  - ".travis.yml"
163
164
  - Gemfile
@@ -217,8 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
218
  - !ruby/object:Gem::Version
218
219
  version: '0'
219
220
  requirements: []
220
- rubyforge_project:
221
- rubygems_version: 2.7.6.2
221
+ rubygems_version: 3.1.4
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: View stackprof dumps in a web UI