sinatra-footnotes 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra-footnotes.rb +2 -1
- data/lib/sinatra-footnotes/notes/flash_note.rb +24 -0
- data/lib/sinatra-footnotes/script.html +1 -0
- data/lib/sinatra-footnotes/version.rb +1 -1
- data/test_sinatra_app.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cfa0dab931a683206f1e36c8ffd571ddb6d1444
|
4
|
+
data.tar.gz: 7e05dd823b2bdab081874314ef80803d04a7b5d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0afa668c5e96f09322b4530756b056a2d914d8b14e110960fe4d933d208b05a72b0a5543c07f005970789e88571615444ea9e17283311ce47feacabb965da47f
|
7
|
+
data.tar.gz: dd29c945a36d1f3741a258c8540051d02887a64e387293e6bed19a13d0b50c388b96b56eea623edcb2284f1d0311e24b9ae49cc9d8c1b3a4639df482aa61f07c
|
data/lib/sinatra-footnotes.rb
CHANGED
@@ -3,7 +3,7 @@ require 'sinatra/base'
|
|
3
3
|
require 'active_support/core_ext'
|
4
4
|
|
5
5
|
dir = File.dirname(__FILE__)
|
6
|
-
%w[session cookies params sinatra_routes env assigns].each do |prefix|
|
6
|
+
%w[session flash cookies params sinatra_routes env assigns].each do |prefix|
|
7
7
|
require File.join(dir, 'sinatra-footnotes', 'notes', "#{prefix}_note.rb")
|
8
8
|
end
|
9
9
|
|
@@ -69,6 +69,7 @@ module Sinatra
|
|
69
69
|
|
70
70
|
notes = []
|
71
71
|
notes.push ::Footnotes::Notes::SessionNote.new(self)
|
72
|
+
notes.push ::Footnotes::Notes::FlashNote.new(self)
|
72
73
|
notes.push ::Footnotes::Notes::CookiesNote.new(self.request)
|
73
74
|
notes.push ::Footnotes::Notes::ParamsNote.new(self)
|
74
75
|
notes.push ::Footnotes::Notes::SinatraRoutesNote.new(app)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/abstract_note"
|
2
|
+
|
3
|
+
module Footnotes
|
4
|
+
module Notes
|
5
|
+
class FlashNote < AbstractNote
|
6
|
+
def initialize(controller)
|
7
|
+
@flash = {}
|
8
|
+
if controller.respond_to? :flash
|
9
|
+
controller.flash.keys.each do |key|
|
10
|
+
@flash[key] = controller.flash[key]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def title
|
16
|
+
"Flash (#{@flash.length})"
|
17
|
+
end
|
18
|
+
|
19
|
+
def content
|
20
|
+
mount_table_for_hash(@flash, :summary => "Debug information for #{title}")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -6,6 +6,7 @@
|
|
6
6
|
Footnotes.hide(document.getElementById('params_debug_info'));
|
7
7
|
Footnotes.hide(document.getElementById('sinatra_routes_debug_info'));
|
8
8
|
Footnotes.hide(document.getElementById('session_debug_info'));
|
9
|
+
Footnotes.hide(document.getElementById('flash_debug_info'));
|
9
10
|
Footnotes.hide(document.getElementById('cookies_debug_info'));
|
10
11
|
Footnotes.hide(document.getElementById('env_debug_info'));
|
11
12
|
}
|
data/test_sinatra_app.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-footnotes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Stutzman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/sinatra-footnotes/notes/assigns_note.rb
|
70
70
|
- lib/sinatra-footnotes/notes/cookies_note.rb
|
71
71
|
- lib/sinatra-footnotes/notes/env_note.rb
|
72
|
+
- lib/sinatra-footnotes/notes/flash_note.rb
|
72
73
|
- lib/sinatra-footnotes/notes/params_note.rb
|
73
74
|
- lib/sinatra-footnotes/notes/session_note.rb
|
74
75
|
- lib/sinatra-footnotes/notes/sinatra_routes_note.rb
|