sinatra-footnotes 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca440dcea28fe77593d7cce0f357d597b81a5078
4
- data.tar.gz: a65c7ae98e974b3739960b5d1bebd0c8fd64a4e7
3
+ metadata.gz: 3cfa0dab931a683206f1e36c8ffd571ddb6d1444
4
+ data.tar.gz: 7e05dd823b2bdab081874314ef80803d04a7b5d5
5
5
  SHA512:
6
- metadata.gz: 733123af926a999b9cc14cd6b18d0ee7598497f6054c90de11ca9f01ec7d1cb56b7e54d5d7e74867a4d44f6ee35aa2f526e46c2e9cbdc6e57c2c9795a37072ce
7
- data.tar.gz: 96aaa4949478e6ddc566676e86e1abf233b5decff7c8b7ddb600a13f62fc86eefdb1da1714715ba907d4f67c15a8f80a8bcc0dc4db233f378a3753c27d526edd
6
+ metadata.gz: 0afa668c5e96f09322b4530756b056a2d914d8b14e110960fe4d933d208b05a72b0a5543c07f005970789e88571615444ea9e17283311ce47feacabb965da47f
7
+ data.tar.gz: dd29c945a36d1f3741a258c8540051d02887a64e387293e6bed19a13d0b50c388b96b56eea623edcb2284f1d0311e24b9ae49cc9d8c1b3a4639df482aa61f07c
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module Footnotes
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -1,5 +1,9 @@
1
1
  require 'sinatra'
2
2
 
3
+ # use Rack::Session::Cookie, secret: SecureRandom.hex
4
+ # require 'rack-flash'
5
+ # use Rack::Flash, sweep: true
6
+
3
7
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)) + "/lib")
4
8
  require 'sinatra-footnotes'
5
9
 
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.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-20 00:00:00.000000000 Z
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