stackprof-webnav 0.0.4 → 0.1.0

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
- SHA1:
3
- metadata.gz: a028c26df794a0965aacea7e0b72f9f9625f7744
4
- data.tar.gz: 6515dbbb40cd176241d12288702a45922709c792
2
+ SHA256:
3
+ metadata.gz: d7397a6a9f217b90faf1e1ea5ab1a2bb3b616ffbf678d7953ab1a27c6f69b165
4
+ data.tar.gz: 75dec19185527cecb7a7b7cc5cf1ee1eedb0f9865f27a65eb44f8fe174337e25
5
5
  SHA512:
6
- metadata.gz: dd4e134ae7984043cdfd8cb3cde03175eb2d93ba54c040c554211478caed5f843f30008ee9c550fe444f9612fd2db58f3ee65f83ea9054ea6715088f6f820c3f
7
- data.tar.gz: d83332d8ef03cf1e65a442fb4df4ed02ef409f54985b663a3791a55e9340f9d772132a7fac743f881c345bbbf77ebc0c3106581c8c445923dfe50f257df81018
6
+ metadata.gz: fd15f2fa5bf7461ac0d001d67c1e9629f0238a20bc930141dc357c4f6b8290f4483443d47c7e5715e007db85290c07b256a738d518170ca7259fb0baf78c2ec4
7
+ data.tar.gz: 630b5916db9902f8df747286519fcfc82f653ee373ee8abe8af99654bf2a05b3e3dfdba8ede11664ea9801a08792618171203b4bff629deb176289e1b3fb52f8
data/Gemfile.lock CHANGED
@@ -1,59 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stackprof-webnav (0.0.4)
4
+ stackprof-webnav (0.1.0)
5
+ better_errors (~> 1.1.0)
5
6
  haml (~> 4.0)
6
- nyny (~> 3.4)
7
- sprockets (~> 2.12.2)
7
+ sinatra (~> 2.0.1)
8
8
  stackprof (~> 0.2)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (4.0.10)
14
- activesupport (= 4.0.10)
15
- builder (~> 3.1.0)
16
- erubis (~> 2.7.0)
17
- rack (~> 1.5.2)
18
- rack-test (~> 0.6.2)
19
- activesupport (4.0.10)
20
- i18n (~> 0.6, >= 0.6.9)
21
- minitest (~> 4.2)
22
- multi_json (~> 1.3)
23
- thread_safe (~> 0.1)
24
- tzinfo (~> 0.3.37)
25
13
  better_errors (1.1.0)
26
14
  coderay (>= 1.0.0)
27
15
  erubis (>= 2.6.6)
28
- builder (3.1.4)
29
- coderay (1.1.0)
16
+ coderay (1.1.2)
30
17
  erubis (2.7.0)
31
- haml (4.0.5)
18
+ haml (4.0.7)
32
19
  tilt
33
- hike (1.2.3)
34
- i18n (0.6.11)
35
- minitest (4.7.5)
36
- multi_json (1.10.1)
37
- nyny (3.4.2)
38
- actionpack (~> 4.0.2)
39
- better_errors (~> 1.1.0)
40
- rack-contrib (~> 1.1.0)
41
- tilt (~> 1.4.1)
42
- rack (1.5.2)
43
- rack-contrib (1.1.0)
44
- rack (>= 0.9.1)
45
- rack-test (0.6.2)
46
- rack (>= 1.0)
20
+ mustermann (1.0.2)
21
+ rack (2.0.4)
22
+ rack-protection (2.0.1)
23
+ rack
47
24
  rake (10.3.2)
48
- sprockets (2.12.2)
49
- hike (~> 1.2)
50
- multi_json (~> 1.0)
51
- rack (~> 1.0)
52
- tilt (~> 1.1, != 1.3.0)
53
- stackprof (0.2.7)
54
- thread_safe (0.3.4)
55
- tilt (1.4.1)
56
- tzinfo (0.3.41)
25
+ sinatra (2.0.1)
26
+ mustermann (~> 1.0)
27
+ rack (~> 2.0)
28
+ rack-protection (= 2.0.1)
29
+ tilt (~> 2.0)
30
+ stackprof (0.2.11)
31
+ tilt (2.0.8)
57
32
 
58
33
  PLATFORMS
59
34
  ruby
@@ -62,3 +37,6 @@ DEPENDENCIES
62
37
  bundler (~> 1.5)
63
38
  rake (~> 10.1)
64
39
  stackprof-webnav!
40
+
41
+ BUNDLED WITH
42
+ 1.16.1
data/bin/stackprof-webnav CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'optparse'
3
3
  require 'stackprof-webnav'
4
- require 'sprockets'
5
4
  require 'rack'
6
5
 
7
6
  options = {
@@ -22,18 +21,4 @@ parser.abort(parser.help) unless [:filepath, :uri, :bucket].any? {|key| options.
22
21
  server = StackProf::Webnav::Server
23
22
  server.cmd_options = options
24
23
 
25
- builder = Rack::Builder.new do
26
- map '/' do
27
- run server.new
28
- end
29
-
30
- map '/assets' do
31
- environment = Sprockets::Environment.new
32
- environment.append_path File.expand_path("../../lib/stackprof-webnav/css", __FILE__)
33
- run environment
34
- end
35
- end
36
-
37
- puts File.expand_path("../lib/stackprof-webnav/css", __FILE__)
38
-
39
- Rack::Handler.get('webrick').run builder, :Port => options[:port]
24
+ Rack::Handler.get('webrick').run server.new, :Port => options[:port]
@@ -1,8 +1,6 @@
1
1
  require 'better_errors'
2
2
  require 'stringio'
3
3
  require 'rexml/document'
4
- require 'action_view'
5
- include ActionView::Helpers::NumberHelper
6
4
 
7
5
  module StackProf
8
6
  module Webnav
@@ -37,14 +35,14 @@ module StackProf
37
35
  end
38
36
 
39
37
  def listing_dumps
40
- Server.report_dump_listing += "/" unless Server.report_dump_listing.end_with?("/")
38
+ Server.report_dump_listing += "/" unless Server.report_dump_listing.end_with?("/")
41
39
  xml_data = Net::HTTP.get(URI.parse(Server.report_dump_listing))
42
40
  if xml_data
43
41
  doc = REXML::Document.new(xml_data)
44
42
  dumps = []
45
43
  doc.elements.each('ListBucketResult/Contents') do |ele|
46
44
  dumps << {
47
- :key => ele.elements["Key"].text,
45
+ :key => ele.elements["Key"].text,
48
46
  :date => ele.elements["LastModified"].text,
49
47
  :size => number_with_delimiter(ele.elements["Size"].text.to_i),
50
48
  :uri => Server.report_dump_listing + ele.elements["Key"].text
@@ -74,7 +72,7 @@ module StackProf
74
72
  private
75
73
 
76
74
  def percent value
77
- "%2.2f%" % (value*100)
75
+ "%2.2f%%" % (value*100)
78
76
  end
79
77
 
80
78
  def callers frame, info
@@ -0,0 +1,7 @@
1
+ table {
2
+ width: 100%;
3
+ }
4
+
5
+ pre code {
6
+ color: black;
7
+ }
File without changes
@@ -1,4 +1,4 @@
1
- require 'nyny'
1
+ require 'sinatra'
2
2
  require 'haml'
3
3
  require "stackprof"
4
4
  require 'net/http'
@@ -6,7 +6,7 @@ require_relative 'presenter'
6
6
 
7
7
  module StackProf
8
8
  module Webnav
9
- class Server < NYNY::App
9
+ class Server < Sinatra::Application
10
10
  class << self
11
11
  attr_accessor :cmd_options, :report_dump_path, :report_dump_uri, :report_dump_listing
12
12
 
@@ -38,15 +38,6 @@ module StackProf
38
38
  end
39
39
 
40
40
  helpers do
41
- def template_path name
42
- File.join(__dir__, name)
43
- end
44
-
45
- def render_with_layout *args
46
- args[0] = template_path("views/#{args[0]}.haml")
47
- render(template_path('views/layout.haml')) { render(*args) }
48
- end
49
-
50
41
  def presenter
51
42
  Server.presenter
52
43
  end
@@ -67,9 +58,9 @@ module StackProf
67
58
  get '/' do
68
59
  presenter
69
60
  if Server.report_dump_listing
70
- redirect_to '/listing'
61
+ redirect '/listing'
71
62
  else
72
- redirect_to '/overview'
63
+ redirect '/overview'
73
64
  end
74
65
  end
75
66
 
@@ -81,27 +72,27 @@ module StackProf
81
72
  @file = Server.report_dump_path || Server.report_dump_uri
82
73
  @action = "overview"
83
74
  @frames = presenter.overview_frames
84
- render_with_layout :overview
75
+ haml :overview
85
76
  end
86
77
 
87
78
  get '/listing' do
88
79
  @file = Server.report_dump_listing
89
80
  @action = "listing"
90
81
  @dumps = presenter.listing_dumps
91
- render_with_layout :listing
82
+ haml :listing
92
83
  end
93
84
 
94
85
  get '/method' do
95
86
  @action = params[:name]
96
87
  @frames = presenter.method_info(params[:name])
97
- render_with_layout :method
88
+ haml :method
98
89
  end
99
90
 
100
91
  get '/file' do
101
92
  path = params[:path]
102
93
  @path = path
103
94
  @data = presenter.file_overview(path)
104
- render_with_layout :file
95
+ haml :file
105
96
  end
106
97
  end
107
98
  end
@@ -1,5 +1,5 @@
1
1
  module StackProf
2
2
  module Webnav
3
- VERSION = '0.0.4'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
@@ -1,7 +1,10 @@
1
1
  %html
2
2
  %head
3
3
  %title Stackprof navigator
4
- %link(rel="stylesheet" href="/assets/application.css")
4
+ %link(rel="stylesheet" href="/css/normalize.css")
5
+ %link(rel="stylesheet" href="/css/foundation.min.css")
6
+ %link(rel="stylesheet" href="/css/code.css")
7
+ %link(rel="stylesheet" href="/css/application.css")
5
8
 
6
9
  %body
7
10
  .row
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = 'bin'
22
22
  spec.executables << 'stackprof-webnav'
23
23
 
24
- spec.add_dependency "nyny", "~> 3.4"
24
+ spec.add_dependency "sinatra", "~> 2.0.1"
25
25
  spec.add_dependency "haml", "~> 4.0"
26
26
  spec.add_dependency "stackprof", "~> 0.2"
27
- spec.add_dependency 'sprockets', '~> 2.12.2'
27
+ spec.add_dependency "better_errors", "~> 1.1.0"
28
28
  spec.add_development_dependency "bundler", "~> 1.5"
29
29
  spec.add_development_dependency "rake", "~> 10.1"
30
30
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackprof-webnav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Lisnic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nyny
14
+ name: sinatra
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.4'
19
+ version: 2.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.4'
26
+ version: 2.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: haml
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.2'
55
55
  - !ruby/object:Gem::Dependency
56
- name: sprockets
56
+ name: better_errors
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.12.2
61
+ version: 1.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.12.2
68
+ version: 1.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -111,11 +111,11 @@ files:
111
111
  - Rakefile
112
112
  - bin/stackprof-webnav
113
113
  - lib/stackprof-webnav.rb
114
- - lib/stackprof-webnav/css/application.css
115
- - lib/stackprof-webnav/css/code.css
116
- - lib/stackprof-webnav/css/foundation.min.css
117
- - lib/stackprof-webnav/css/normalize.css
118
114
  - lib/stackprof-webnav/presenter.rb
115
+ - lib/stackprof-webnav/public/css/application.css
116
+ - lib/stackprof-webnav/public/css/code.css
117
+ - lib/stackprof-webnav/public/css/foundation.min.css
118
+ - lib/stackprof-webnav/public/css/normalize.css
119
119
  - lib/stackprof-webnav/server.rb
120
120
  - lib/stackprof-webnav/version.rb
121
121
  - lib/stackprof-webnav/views/file.haml
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.2.2
150
+ rubygems_version: 2.7.5
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: View stackprof dumps in a web UI
@@ -1,13 +0,0 @@
1
- /*
2
- = require normalize
3
- = require foundation.min
4
- = require code
5
- */
6
-
7
- table {
8
- width: 100%;
9
- }
10
-
11
- pre code {
12
- color: black;
13
- }