glimpse 0.0.3 → 0.0.4
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.
- data/CHANGELOG.md +5 -0
- data/README.md +11 -7
- data/app/assets/javascripts/glimpse.coffee +5 -1
- data/glimpse.gemspec +2 -1
- data/lib/glimpse.rb +2 -2
- data/lib/glimpse/version.rb +1 -1
- data/test/glimpse_test.rb +0 -4
- data/test/test_helper.rb +2 -0
- metadata +6 -5
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -39,13 +39,13 @@ Feel free to pick and choose from the list or create your own. The order they
|
|
39
39
|
are added to Glimpse, the order they will appear in your bar.
|
40
40
|
|
41
41
|
Next, to render the Glimpse bar in your application just add the following snippet
|
42
|
-
just
|
42
|
+
just after the opening `<body>` tag in your application layout.
|
43
43
|
|
44
44
|
```erb
|
45
45
|
<%= render 'glimpse/bar' %>
|
46
46
|
```
|
47
47
|
|
48
|
-
It will look
|
48
|
+
It will look like:
|
49
49
|
|
50
50
|
```erb
|
51
51
|
<html>
|
@@ -63,10 +63,10 @@ Some Glimpse views require the view to render before data is collected and can
|
|
63
63
|
be presented, ie: the number of MySQL queries ran on the page and how
|
64
64
|
long it took.
|
65
65
|
|
66
|
-
For this to work, you need to include the
|
66
|
+
For this to work, you need to include the `glimpse/results` partial at the end of your
|
67
67
|
application layout.
|
68
68
|
|
69
|
-
It will look
|
69
|
+
It will look like:
|
70
70
|
|
71
71
|
```erb
|
72
72
|
<html>
|
@@ -82,7 +82,7 @@ It will look something like:
|
|
82
82
|
```
|
83
83
|
|
84
84
|
Now that you have the partials in your application, you will need to include the
|
85
|
-
CSS and JS that help make Glimpse
|
85
|
+
CSS and JS that help make Glimpse :sparkles:
|
86
86
|
|
87
87
|
In `app/assets/stylesheets/application.scss`:
|
88
88
|
|
@@ -98,11 +98,12 @@ In `app/assets/javascripts/application.coffee`:
|
|
98
98
|
#= require glimpse
|
99
99
|
```
|
100
100
|
|
101
|
-
Note: Each additional view my have their own CSS and JS you need to require
|
101
|
+
Note: Each additional view my have their own CSS and JS you need to require
|
102
|
+
which should be stated in their usage documentation.
|
102
103
|
|
103
104
|
## Using Glimpse with PJAX
|
104
105
|
|
105
|
-
When using PJAX in your application, by default requests won't render the
|
106
|
+
When using [PJAX](https://github.com/defunkt/jquery-pjax) in your application, by default requests won't render the
|
106
107
|
application layout which ends up not including the required results partial.
|
107
108
|
It's fairly simple to get this working with PJAX if you're using the
|
108
109
|
[pjax_rails](https://github.com/rails/pjax_rails) gem.
|
@@ -151,9 +152,12 @@ end
|
|
151
152
|
- [glimpse-pg](https://github.com/dewski/glimpse-pg)
|
152
153
|
- [glimpse-redis](https://github.com/dewski/glimpse-redis)
|
153
154
|
- [glimpse-resque](https://github.com/dewski/glimpse-resque)
|
155
|
+
- [glimpse-sidekiq](https://github.com/suranyami/glimpse-sidekiq)
|
154
156
|
- Navigation Time :soon:
|
155
157
|
- Unicorn :soon:
|
156
158
|
|
159
|
+
Feel free to submit a Pull Request adding your own Glimpse item to this list.
|
160
|
+
|
157
161
|
## Creating your own Glimpse item
|
158
162
|
|
159
163
|
Each Glimpse item is a self contained Rails engine which gives you the power to
|
@@ -17,7 +17,7 @@ initializeTipsy = ->
|
|
17
17
|
toggleBar = (event) ->
|
18
18
|
return if $(event.target).is ':input'
|
19
19
|
|
20
|
-
if event.keyCode == 96
|
20
|
+
if event.keyCode == 96 && !event.metaKey
|
21
21
|
wrapper = $('#glimpse')
|
22
22
|
if wrapper.hasClass 'disabled'
|
23
23
|
wrapper.removeClass 'disabled'
|
@@ -35,5 +35,9 @@ $(document).on 'glimpse:update', initializeTipsy
|
|
35
35
|
$(document).on 'pjax:end', ->
|
36
36
|
$(this).trigger 'glimpse:update'
|
37
37
|
|
38
|
+
# Also listen to turbolinks page change event
|
39
|
+
$(document).on 'page:change', ->
|
40
|
+
$(this).trigger 'glimpse:update'
|
41
|
+
|
38
42
|
$ ->
|
39
43
|
$(this).trigger 'glimpse:update'
|
data/glimpse.gemspec
CHANGED
@@ -11,11 +11,12 @@ Gem::Specification.new do |gem|
|
|
11
11
|
gem.description = %q{Provide a glimpse into your Rails application.}
|
12
12
|
gem.summary = %q{Provide a glimpse into your Rails application.}
|
13
13
|
gem.homepage = 'https://github.com/dewski/glimpse'
|
14
|
+
gem.license = 'MIT'
|
14
15
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
16
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
19
|
gem.require_paths = ['lib']
|
19
20
|
|
20
|
-
gem.add_dependency 'rails'
|
21
|
+
gem.add_dependency 'rails', '>= 3'
|
21
22
|
end
|
data/lib/glimpse.rb
CHANGED
data/lib/glimpse/version.rb
CHANGED
data/test/glimpse_test.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimpse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '3'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '3'
|
30
30
|
description: Provide a glimpse into your Rails application.
|
31
31
|
email:
|
32
32
|
- me@garrettbjerkhoel.com
|
@@ -59,7 +59,8 @@ files:
|
|
59
59
|
- test/glimpse_test.rb
|
60
60
|
- test/test_helper.rb
|
61
61
|
homepage: https://github.com/dewski/glimpse
|
62
|
-
licenses:
|
62
|
+
licenses:
|
63
|
+
- MIT
|
63
64
|
post_install_message:
|
64
65
|
rdoc_options: []
|
65
66
|
require_paths:
|