session_dump 0.0.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.
- data/MIT-LICENSE +20 -0
- data/README +24 -0
- data/Rakefile.rb +7 -0
- data/lib/session_dump.rb +13 -0
- data/lib/version.rb +14 -0
- data/rails/init.rb +3 -0
- data/tasks/release.rake +75 -0
- metadata +66 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Valentin Mihov
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
SessionDump
|
2
|
+
===========
|
3
|
+
|
4
|
+
This is a small gem, which allows the controllers to easily dump the current session at each request.
|
5
|
+
|
6
|
+
Install
|
7
|
+
=======
|
8
|
+
|
9
|
+
The installation is done through ruby gems:
|
10
|
+
|
11
|
+
gem install session_dump
|
12
|
+
|
13
|
+
Example
|
14
|
+
=======
|
15
|
+
|
16
|
+
Here it is how it is used:
|
17
|
+
|
18
|
+
class ApplicationController < ActionController::Base
|
19
|
+
include SessionDump
|
20
|
+
end
|
21
|
+
|
22
|
+
This will cause all the controllers inheriting from ApplicationController to dump their session data after each request.
|
23
|
+
|
24
|
+
Copyright (c) 2009 Valentin Mihov, released under the MIT license
|
data/Rakefile.rb
ADDED
data/lib/session_dump.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'version')
|
2
|
+
|
3
|
+
module SessionDump
|
4
|
+
def self.included(controller)
|
5
|
+
# controller.extend(ClassMethods)
|
6
|
+
controller.before_filter(:session_dump)
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
def session_dump
|
11
|
+
logger.debug " Session: " + session.instance_eval { @data.inspect }
|
12
|
+
end
|
13
|
+
end
|
data/lib/version.rb
ADDED
data/rails/init.rb
ADDED
data/tasks/release.rake
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rubyforge'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/gempackagetask'
|
6
|
+
require 'lib/session_dump'
|
7
|
+
|
8
|
+
PKG_NAME = 'session_dump'
|
9
|
+
PKG_VERSION = SessionDump::Version.to_s
|
10
|
+
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
11
|
+
RUBY_FORGE_PROJECT = PKG_NAME
|
12
|
+
|
13
|
+
RELEASE_NAME = PKG_VERSION
|
14
|
+
RUBY_FORGE_GROUPID = 7788
|
15
|
+
RUBY_FORGE_PACKAGEID = 10329
|
16
|
+
|
17
|
+
RDOC_TITLE = "Session dump"
|
18
|
+
RDOC_EXTRAS = ["README"]
|
19
|
+
|
20
|
+
namespace 'session_dump' do
|
21
|
+
spec = Gem::Specification.new do |s|
|
22
|
+
s.name = PKG_NAME
|
23
|
+
s.version = PKG_VERSION
|
24
|
+
s.author = "Valentin Mihov"
|
25
|
+
s.email = "valentin.mihov@gmail.com"
|
26
|
+
s.homepage = "http://github.com/valo/session_dump"
|
27
|
+
s.summary = 'A small gem, which allows the controllers to easily dump the current session at each request.'
|
28
|
+
s.description = "A small gem, which allows the controllers to easily dump the current session at each request."
|
29
|
+
s.rubyforge_project = RUBY_FORGE_PROJECT
|
30
|
+
s.platform = Gem::Platform::RUBY
|
31
|
+
s.has_rdoc = true
|
32
|
+
s.rdoc_options << '--title' << RDOC_TITLE << '--line-numbers' << '--main' << 'README'
|
33
|
+
s.extra_rdoc_files = RDOC_EXTRAS
|
34
|
+
files = FileList['**/*']
|
35
|
+
files.exclude 'session_dump.gemspec'
|
36
|
+
files.exclude 'pkg'
|
37
|
+
files.exclude 'pkg/**/*'
|
38
|
+
s.files = files.to_a
|
39
|
+
end
|
40
|
+
|
41
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
42
|
+
pkg.need_zip = true
|
43
|
+
pkg.need_tar = true
|
44
|
+
end
|
45
|
+
|
46
|
+
task :gemspec do
|
47
|
+
File.open('session_dump.gemspec', 'w') {|f| f.write spec.to_ruby }
|
48
|
+
end
|
49
|
+
|
50
|
+
namespace :gem do
|
51
|
+
desc "Uninstall Gem"
|
52
|
+
task :uninstall do
|
53
|
+
sh "gem uninstall #{PKG_NAME}" rescue nil
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "Build and install Gem from source"
|
57
|
+
task :install => [:package, :uninstall] do
|
58
|
+
chdir("#{File.dirname(__FILE__)}/../pkg") do
|
59
|
+
latest = Dir["#{PKG_NAME}-*.gem"].last
|
60
|
+
sh "gem install #{latest}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
desc "Publish the release files to RubyForge."
|
66
|
+
task :release => [:gem, :package] do
|
67
|
+
files = ["gem", "tgz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
|
68
|
+
|
69
|
+
rubyforge = RubyForge.new
|
70
|
+
|
71
|
+
rubyforge.configure
|
72
|
+
rubyforge.login
|
73
|
+
rubyforge.add_release RUBY_FORGE_GROUPID, RUBY_FORGE_PACKAGEID, RELEASE_NAME, *files
|
74
|
+
end
|
75
|
+
end
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: session_dump
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Valentin Mihov
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-02-27 00:00:00 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: A small gem, which allows the controllers to easily dump the current session at each request.
|
17
|
+
email: valentin.mihov@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
files:
|
25
|
+
- lib
|
26
|
+
- lib/session_dump.rb
|
27
|
+
- lib/version.rb
|
28
|
+
- MIT-LICENSE
|
29
|
+
- rails
|
30
|
+
- rails/init.rb
|
31
|
+
- Rakefile.rb
|
32
|
+
- README
|
33
|
+
- tasks
|
34
|
+
- tasks/release.rake
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: http://github.com/valo/session_dump
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options:
|
39
|
+
- --title
|
40
|
+
- Session dump
|
41
|
+
- --line-numbers
|
42
|
+
- --main
|
43
|
+
- README
|
44
|
+
require_paths:
|
45
|
+
- lib
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: "0"
|
51
|
+
version:
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
57
|
+
version:
|
58
|
+
requirements: []
|
59
|
+
|
60
|
+
rubyforge_project: session_dump
|
61
|
+
rubygems_version: 1.3.1
|
62
|
+
signing_key:
|
63
|
+
specification_version: 2
|
64
|
+
summary: A small gem, which allows the controllers to easily dump the current session at each request.
|
65
|
+
test_files: []
|
66
|
+
|