Skip to content

Commit 9238d48

Browse files
committed
Initial Release of Rack::Insight
1 parent 3f30862 commit 9238d48

123 files changed

Lines changed: 851 additions & 960 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

History.txt renamed to CHANGELOG

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
== HEAD
1+
== 0.5.0 / 2012-08-29 - transition to rack_insight
2+
3+
* Compatibility
4+
5+
* Restructure gem so Insight is inside a namespace, because I have classes named Insight that are obscured by
6+
logical_insight gem when loaded. Logical also seemed like it may be a class name somewhere, hence going back to
7+
the Rack namespace a la rack-bug. Keeping the (now nested) Insight namespace as well, because - genetics.
8+
9+
*Other
10+
11+
* Fix spelling of retreive => retrieve (Peter Boling)
12+
* Remove redundant time method from cache_panel/stats.rb
13+
14+
== 0.4.X - last of logical_insight
215

316
* New features
417

@@ -21,7 +34,7 @@
2134

2235
* Refactoring and code cleanup (Tim Connor)
2336
* Testing cleanup - better isolation of Rails vs. non-Rails in tests (Tim Connor)
24-
37+
2538
== 0.3.0 / 2010-05-28
2639

2740
* New features

‎Gemfile.lock‎

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,36 @@
11
PATH
22
remote: .
33
specs:
4-
logical-insight (0.4.7)
5-
sqlite3 (~> 1.3.3)
6-
uuid (~> 2.3.1)
4+
rack-insight (0.5.0)
5+
rack
6+
sqlite3 (>= 1.3.3)
7+
uuidtools (>= 2.1.2)
78

89
GEM
910
remote: http://gemcutter.org/
1011
specs:
1112
archive-tar-minitar (0.5.2)
12-
chunky_png (1.2.5)
1313
columnize (0.3.4)
14-
compass (0.12.1)
15-
chunky_png (~> 1.2)
16-
fssm (>= 0.2.7)
17-
sass (~> 3.1)
18-
corundum (0.0.17)
19-
bundler (~> 1.1.0)
20-
compass (>= 0.12.1)
21-
mailfactory (~> 1.4.0)
22-
mattock (>= 0.2.11)
23-
nokogiri
24-
rake-rubygems (>= 0.2.0)
25-
rdoc
26-
rspec (>= 2.0)
27-
sass (>= 3.1)
28-
simplecov (>= 0.5.4)
29-
yard
3014
diff-lcs (1.1.3)
31-
fssm (0.2.9)
32-
json (1.7.3)
3315
linecache19 (0.5.12)
3416
ruby_core_source (>= 0.1.4)
35-
macaddr (1.6.0)
36-
systemu (~> 2.2.0)
37-
mailfactory (1.4.0)
38-
mime-types (>= 1.13.1)
39-
mattock (0.2.12)
40-
tilt (> 0)
41-
valise (>= 0.6)
42-
mime-types (1.18)
43-
multi_json (1.3.5)
4417
nokogiri (1.5.2)
4518
rack (1.3.5)
4619
rack-protection (1.1.4)
4720
rack
4821
rack-test (0.6.1)
4922
rack (>= 1.0)
5023
rake (0.9.2.2)
51-
rake-rubygems (0.2.0)
52-
rake (>= 0.8.7)
53-
rdoc (3.12)
54-
json (~> 1.4)
5524
redcarpet (2.1.1)
25+
reek (1.2.12)
26+
ripper_ruby_parser (~> 0.0.7)
27+
ruby2ruby (~> 1.2.5)
28+
ruby_parser (~> 2.0)
29+
sexp_processor (~> 3.0)
30+
ripper_ruby_parser (0.0.8)
31+
sexp_processor (~> 3.0)
32+
roodi (2.1.0)
33+
ruby_parser
5634
rspec (2.10.0)
5735
rspec-core (~> 2.10.0)
5836
rspec-expectations (~> 2.10.0)
@@ -69,36 +47,35 @@ GEM
6947
columnize (>= 0.3.1)
7048
linecache19 (>= 0.5.11)
7149
ruby-debug-base19 (>= 0.11.19)
50+
ruby2ruby (1.2.5)
51+
ruby_parser (~> 2.0)
52+
sexp_processor (~> 3.0)
7253
ruby_core_source (0.1.5)
7354
archive-tar-minitar (>= 0.5.2)
74-
sass (3.1.18)
75-
simplecov (0.6.4)
76-
multi_json (~> 1.0)
77-
simplecov-html (~> 0.5.3)
78-
simplecov-html (0.5.3)
55+
ruby_parser (2.3.1)
56+
sexp_processor (~> 3.0)
57+
sexp_processor (3.2.0)
7958
sinatra (1.3.1)
8059
rack (~> 1.3, >= 1.3.4)
8160
rack-protection (~> 1.1, >= 1.1.2)
8261
tilt (~> 1.3, >= 1.3.3)
8362
sqlite3 (1.3.6)
84-
systemu (2.2.0)
8563
tilt (1.3.3)
86-
uuid (2.3.5)
87-
macaddr (~> 1.0)
88-
valise (0.6)
64+
uuidtools (2.1.3)
8965
webrat (0.7.3)
9066
nokogiri (>= 1.2.0)
9167
rack (>= 1.0)
9268
rack-test (>= 0.5.3)
93-
yard (0.8.1)
9469

9570
PLATFORMS
9671
ruby
9772

9873
DEPENDENCIES
99-
corundum (~> 0.0.13)
100-
logical-insight!
74+
rack-insight!
75+
rake
10176
redcarpet
77+
reek (>= 1.2.8)
78+
roodi (>= 2.1.0)
10279
rspec
10380
ruby-debug19
10481
sinatra

‎LICENSE‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2012 Peter H. Boling as rack-insight
2+
Copyright (c) 2011-12 LR Design as logical-insight
3+
Copyright (c) 2009 Bryan Helmkamp as rack-bug
4+
5+
MIT License
6+
7+
Permission is hereby granted, free of charge, to any person obtaining
8+
a copy of this software and associated documentation files (the
9+
"Software"), to deal in the Software without restriction, including
10+
without limitation the rights to use, copy, modify, merge, publish,
11+
distribute, sublicense, and/or sell copies of the Software, and to
12+
permit persons to whom the Software is furnished to do so, subject to
13+
the following conditions:
14+
15+
The above copyright notice and this permission notice shall be
16+
included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎MIT-LICENSE.txt‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎README.md‎

Lines changed: 67 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
Insight
1+
Rack::Insight
22
=========
33

4-
Insight began life as an LRDesign fork of Rack::Bug by brynary. We started a
5-
fork because, at the time, the main project wasn't making progress on Rails 3
6-
support. Since then we've rewritten a lot of the code to make it more modular,
7-
easier to extend, and to store information about multiple requests so you can
8-
use it to inspect your AJAX requests (or any past request), not just previous
9-
page loads.
4+
Rack::Insight began life as an fork of Logical::Insight by LRDesign. I started a
5+
fork because LogicalInsight was namespaced as "Insight", which is causing namespace
6+
collisions everywhere I have an Insight model. I had to re-namespace all the code.
7+
I also needed to build a few extension gems with additional panels, and added the
8+
Config class to allow for custom panel load paths, and other future extensions
9+
that don't work in the *use Middleware* declaration. It should be *even* easier
10+
to extend than LogicalInsight was, because extension gems can access the Config class
11+
and truly bolt-on cleanly.
1012

11-
Having made really significant architectural changes, we'll be keeping Insight
13+
Having made really significant architectural changes, I'll be keeping Rack::Insight
1214
a separate project for the forseeable future.
1315

14-
* Forked From: [rack-bug](http://github.com/brynary/rack-bug)
15-
16-
* [Full documentation](http://lrdesign.github.com/logical-insight/)
16+
* Forked From: [logical-insight](http://github.com/LRDesign/logical-insight), [documentation](http://lrdesign.github.com/rack-insight/)
17+
* Which Was Forked From: [rack-bug](http://github.com/brynary/rack-bug)
1718

1819
Description
1920
-----------
2021

21-
Insight adds a diagnostics toolbar to Rack apps. When enabled, it injects a floating div
22-
allowing exploration of logging, database queries, template rendering times, etc. Insight
22+
Rack::Insight adds a diagnostics toolbar to Rack apps. When enabled, it injects a floating div
23+
allowing exploration of logging, database queries, template rendering times, etc. Rack::Insight
2324
stores debugging info over many requests, incuding AJAX requests.
2425

2526
Features
2627
--------
2728

2829
* Password-based security
2930
* IP-based security
30-
* Insight instrumentation/reporting is broken up into panels.
31+
* Rack::Insight instrumentation/reporting is broken up into panels.
3132
* Panels in default configuration:
3233
* Rails Info
3334
* Timer
@@ -54,22 +55,22 @@ Rails quick start
5455
---------------------------
5556

5657
Add this to your Gemfile
57-
gem "logical-insight"
58+
gem "rack-insight"
5859

5960
In config/environments/development.rb, add:
6061

61-
config.middleware.use "Insight::App",
62+
config.middleware.use "Rack::Insight::App",
6263
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring"
6364

64-
Any environment with Insight loaded will have a link to "Insight" added to as
65+
Any environment with Rack::Insight loaded will have a link to "Rack::Insight" added to as
6566
the last child of BODY to normal responses. Clicking that link will load the
66-
toolbar. It's set with an id of "logical-insight-enabler", so it can be styled
67+
toolbar. It's set with an id of "rack-insight-enabler", so it can be styled
6768
to go somewhere more noticeable. E.g. "position: absolute; top: 0; left: 0"
6869

6970
Using with non-Rails Rack apps
7071
------------------------------
7172

72-
Just 'use Insight' as any other middleware. See the SampleApp in the
73+
Just 'use Rack::Insight' as any other middleware. See the SampleApp in the
7374
spec/fixtures folder for an example Sinatra app.
7475

7576
If you wish to use the logger panel define the LOGGER constant that is a ruby
@@ -80,9 +81,9 @@ Configuring custom panels
8081

8182
Specify the set of panels you want, in the order you want them to appear:
8283

83-
require "logical-insight"
84+
require "rack-insight"
8485

85-
ActionController::Dispatcher.middleware.use "Insight::App",
86+
ActionController::Dispatcher.middleware.use "Rack::Insight::App",
8687
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
8788
:panel_files => %w[
8889
timer_panel
@@ -93,14 +94,30 @@ Specify the set of panels you want, in the order you want them to appear:
9394
memory_panel
9495
]
9596

96-
Files are looked up by prepending "insight/panels/" and requiring them.
97-
Subclasses of Insight::Panel are loaded and added to the toolbar. This makes
98-
it easier to work with the configuration and extend Insight with plugin gems.
97+
By default panel files are looked up by prepending "rack/insight/panels/" and requiring them.
98+
Subclasses of Rack::Insight::Panel are loaded and added to the toolbar. This makes
99+
it easier to work with the configuration and extend Rack::Insight with plugin gems.
100+
101+
If you need to customize the load paths where Rack::Insight will look for panels you can configure the load paths in an
102+
initializer. Example config/initializers/rack_insight.rb:
103+
104+
Rack::Insight::Config.configure do |config|
105+
106+
# Note: The parent directory of the 'special' directory must already be in Ruby's load path.
107+
config[:panel_load_paths] = File.join('special','path')
108+
109+
# Example 1: Do not load any of the regular Rack::Insight panels:
110+
config[:panel_load_paths] = File.join('my','custom','panel','directory')
111+
112+
# Example 2: Add your custom path to the existing load paths, to have your panels join the party!
113+
config[:panel_load_paths] << 'custom/panels'
114+
115+
end
99116

100-
Running Insight in staging or production
117+
Running Rack::Insight in staging or production
101118
------------------------------------------
102119

103-
We have have found that Insight is fast enough to run in production for specific troubleshooting efforts.
120+
We have have found that Rack::Insight is fast enough to run in production for specific troubleshooting efforts.
104121

105122
### Configuration ####
106123

@@ -113,23 +130,23 @@ Restrict access to particular IP addresses:
113130

114131
require "ipaddr"
115132

116-
ActionController::Dispatcher.middleware.use "Insight::App"
133+
ActionController::Dispatcher.middleware.use "Rack::Insight::App"
117134
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
118135
:ip_masks => [IPAddr.new("2.2.2.2/0")]
119136

120137
Restrict access using a password:
121138

122-
ActionController::Dispatcher.middleware.use "Insight::App",
139+
ActionController::Dispatcher.middleware.use "Rack::Insight::App",
123140
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
124141
:password => "yourpassword"
125142

126143
#### custom file path for the logging database ####
127144

128-
Logical Insight uses SQLite to store data from requests, and outputs a database
145+
Logical Rack::Insight uses SQLite to store data from requests, and outputs a database
129146
file in the root directory. If you need the file to be created at another
130147
location (i.e. Heroku), you can pass a custom file path.
131148

132-
ActionController::Dispatcher.middleware.use "Insight::App"
149+
ActionController::Dispatcher.middleware.use "Rack::Insight::App"
133150
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
134151
:database_path => "tmp/my_insight_db.sqlite"
135152

@@ -142,15 +159,31 @@ Authors
142159

143160
Thanks
144161
------
145-
Insight owes a lot to Rack::Bug, as the basis project. There's a lot of smart
146-
in there. Many thanks to Bryan for building it.
162+
Rack::Insight owes a lot to both LogicalInsight and Rack::Bug, as the basis projects. There's a lot of smart
163+
in there. Many thanks to Evan, Judson, and Bryan for building them.
147164

148165
Inspiration for Rack::Bug is primarily from the Django debug toolbar.
149166
Additional ideas from Rails footnotes, Rack's ShowException middleware, Oink,
150167
and Rack::Cache
151168

152-
153169
License
154170
-------
155171

156-
See MIT-LICENSE.txt in this directory.
172+
See LICENSE.txt in this directory.
173+
174+
Notes
175+
-----
176+
177+
Legacy files: would like to re-include them, but they need work
178+
179+
lib/insight/views/panels/mongo.html.erb
180+
lib/insight/panels/mongo_panel/mongo_extension.rb
181+
lib/insight/panels/mongo_panel/stats.rb
182+
lib/insight/panels/mongo_panel.rb
183+
184+
lib/insight/views/panels/sphinx.html.erb
185+
lib/insight/panels/sphinx_panel/stats.rb
186+
lib/insight/panels/sphinx_panel.rb
187+
188+
This one is mostly just a curiosity
189+
lib/insight/panels/speedtracer_panel/profiling.rb

0 commit comments

Comments
 (0)