stackprof-webnav 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +37 -0
- data/bin/stackprof-webnav +2 -1
- data/lib/stackprof-webnav.rb +1 -1
- data/lib/stackprof-webnav/dump.rb +1 -1
- data/lib/stackprof-webnav/public/css/application.css +11 -0
- data/lib/stackprof-webnav/server.rb +5 -5
- data/lib/stackprof-webnav/version.rb +1 -1
- data/lib/stackprof-webnav/views/graph.haml +5 -4
- data/spec/integration_spec.rb +3 -3
- data/stackprof-webnav.gemspec +1 -1
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1552e5fc93e065620a447d3a7c32e23da16590ee857cfd2e13a5856fcc0972ad
         | 
| 4 | 
            +
              data.tar.gz: 7514d5a49e0544494ee8fcf924ba6d3f9f2bccfb7cee2021c1b588b8cc6b4af5
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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
    
    
    
        data/lib/stackprof-webnav.rb
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
             | 
| 1 | 
            +
            require_relative 'stackprof-webnav/server'
         | 
| @@ -1,10 +1,10 @@ | |
| 1 1 | 
             
            require 'sinatra'
         | 
| 2 2 | 
             
            require 'haml'
         | 
| 3 | 
            -
            require  | 
| 3 | 
            +
            require 'stackprof'
         | 
| 4 4 | 
             
            require_relative 'presenter'
         | 
| 5 5 | 
             
            require_relative 'dump'
         | 
| 6 6 | 
             
            require 'pry'
         | 
| 7 | 
            -
            require  | 
| 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. | 
| 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( | 
| 114 | 
            +
                        .output(svg: current_dump.graph_image_path)
         | 
| 115 115 | 
             
                    end
         | 
| 116 116 |  | 
| 117 | 
            -
                    send_file(current_dump.graph_image_path, type: 'image/ | 
| 117 | 
            +
                    send_file(current_dump.graph_image_path, type: 'image/svg+xml')
         | 
| 118 118 | 
             
                  end
         | 
| 119 119 |  | 
| 120 120 | 
             
                  get '/graph' do
         | 
| @@ -1,4 +1,5 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
              % | 
| 3 | 
            -
             | 
| 4 | 
            -
            % | 
| 1 | 
            +
            #graph
         | 
| 2 | 
            +
              %a{:href => url_for("/overview")}
         | 
| 3 | 
            +
                %button Back to overview
         | 
| 4 | 
            +
              %div
         | 
| 5 | 
            +
                %img{src: url_for("/graph.svg")}
         | 
    
        data/spec/integration_spec.rb
    CHANGED
    
    | @@ -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. | 
| 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. | 
| 59 | 
            -
                expect(response.get_header("Content-Type")).to eq("image/ | 
| 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 |  | 
    
        data/stackprof-webnav.gemspec
    CHANGED
    
    | @@ -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", "~>  | 
| 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. | 
| 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:  | 
| 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: ' | 
| 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: ' | 
| 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 | 
            -
             | 
| 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
         |