intercession 1.0.0 → 2.0.0
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.rdoc +9 -1
- data/Manifest.txt +1 -3
- data/README.rdoc +18 -10
- data/Rakefile +6 -12
- data/lib/intercession.rb +24 -0
- metadata +14 -10
- data/lib/intercession/lifecycle.rb +0 -23
- data/lib/intercession/version.rb +0 -3
- data/rails/init.rb +0 -2
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
-
===
|
1
|
+
=== 2.0.0 / 2009-09-28
|
2
|
+
|
3
|
+
* Different approach. Supports Rails v2.2.2 and v2.3.4.
|
4
|
+
* Rails 2.3 compatibility. [W. Andrew Loe III]
|
5
|
+
* Switch to standard Hoe structure.
|
6
|
+
* Standardizing the Rakefile.
|
7
|
+
* Clean up example gist link.
|
8
|
+
|
9
|
+
=== 1.0.0 / 2009-02-24
|
2
10
|
|
3
11
|
* Birthday!
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
= Intercession
|
2
2
|
|
3
|
+
* http://github.com/jbarnette/intercession
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
3
7
|
Treat your sessions like models, not hashes. Intercession mixes a module into
|
4
8
|
the session on each request, allowing you to nicely encapsulate (and test!)
|
5
9
|
lots of user and session-specific behavior.
|
6
10
|
|
7
11
|
== Examples
|
8
12
|
|
9
|
-
Check out
|
13
|
+
Check out this gist: http://gist.github.com/44506
|
10
14
|
|
11
15
|
Unit tests for your session model! Mix it in to a Hash and go to town:
|
12
16
|
|
@@ -23,9 +27,11 @@ Unit tests for your session model! Mix it in to a Hash and go to town:
|
|
23
27
|
|
24
28
|
== Installation
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
I've used Intercession with Rails v2.2.2 and v2.3.4. Anything else
|
31
|
+
might give you hives.
|
32
|
+
|
33
|
+
Intercession works as a plugin or a gem. If you install it as a
|
34
|
+
plugin, it'll create you a stub session module in
|
29
35
|
<tt>app/models/transient/session.rb</tt>. If you're using it as a gem,
|
30
36
|
do it yourself. :)
|
31
37
|
|
@@ -33,18 +39,20 @@ As a plugin:
|
|
33
39
|
|
34
40
|
$ script/plugin install git://github.com/jbarnette/intercession.git
|
35
41
|
|
36
|
-
As a gem:
|
42
|
+
As a gem (preferred):
|
37
43
|
|
38
|
-
$
|
44
|
+
$ gem install intercession
|
39
45
|
|
40
|
-
If you're using Intercession as a gem, add it to
|
41
|
-
|
46
|
+
If you're using Intercession as a gem, add it to your app's gem
|
47
|
+
dependency mechanism.
|
42
48
|
|
43
|
-
|
49
|
+
After installation, add <tt>include Intercession</tt> to your
|
50
|
+
ApplicationController. To enable Intercession in your tests, call
|
51
|
+
<tt>Intercession.test!</tt> in your <tt>test_helper.rb</tt>.
|
44
52
|
|
45
53
|
== License
|
46
54
|
|
47
|
-
Copyright 2009 John Barnette
|
55
|
+
Copyright 2009 John Barnette (jbarnette@rubyforge.org)
|
48
56
|
|
49
57
|
Permission is hereby granted, free of charge, to any person obtaining
|
50
58
|
a copy of this software and associated documentation files (the
|
data/Rakefile
CHANGED
@@ -1,18 +1,12 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "hoe"
|
3
3
|
|
4
|
-
|
4
|
+
Hoe.plugin :doofus, :git
|
5
5
|
|
6
|
-
Hoe
|
6
|
+
Hoe.spec "intercession" do
|
7
|
+
developer "John Barnette", "jbarnette@rubyforge.org"
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
p.url = "http://github.com/jbarnette/intercession"
|
12
|
-
p.history_file = "CHANGELOG.rdoc"
|
13
|
-
p.readme_file = "README.rdoc"
|
14
|
-
p.extra_rdoc_files = [p.readme_file]
|
15
|
-
p.need_tar = false
|
16
|
-
p.test_globs = %w(test/**/*_test.rb)
|
17
|
-
p.testlib = :helper
|
9
|
+
self.extra_rdoc_files = FileList["*.rdoc"]
|
10
|
+
self.history_file = "CHANGELOG.rdoc"
|
11
|
+
self.readme_file = "README.rdoc"
|
18
12
|
end
|
data/lib/intercession.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
module Intercession
|
2
|
+
|
3
|
+
# Duh.
|
4
|
+
VERSION = "2.0.0"
|
5
|
+
|
6
|
+
def self.included klass
|
7
|
+
klass.append_after_filter :intercede_after
|
8
|
+
|
9
|
+
ks = []
|
10
|
+
ks << ActionController::Session::AbstractStore::SessionHash rescue nil
|
11
|
+
ks << CGI::Session rescue nil
|
12
|
+
|
13
|
+
ks.compact.each { |c| c.send :include, Transient::Session }
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.test!
|
17
|
+
ActionController::TestSession.send :include, Transient::Session
|
18
|
+
end
|
19
|
+
|
20
|
+
def intercede_after
|
21
|
+
# FIX: this obviously won't work with after filters in subclasses.
|
22
|
+
session.before_save if session.respond_to? :before_save
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercession
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Barnette
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-28 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,9 +20,12 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: 2.3.3
|
24
24
|
version:
|
25
|
-
description:
|
25
|
+
description: |-
|
26
|
+
Treat your sessions like models, not hashes. Intercession mixes a module into
|
27
|
+
the session on each request, allowing you to nicely encapsulate (and test!)
|
28
|
+
lots of user and session-specific behavior.
|
26
29
|
email:
|
27
30
|
- jbarnette@rubyforge.org
|
28
31
|
executables: []
|
@@ -31,6 +34,7 @@ extensions: []
|
|
31
34
|
|
32
35
|
extra_rdoc_files:
|
33
36
|
- Manifest.txt
|
37
|
+
- CHANGELOG.rdoc
|
34
38
|
- README.rdoc
|
35
39
|
files:
|
36
40
|
- CHANGELOG.rdoc
|
@@ -38,12 +42,12 @@ files:
|
|
38
42
|
- README.rdoc
|
39
43
|
- Rakefile
|
40
44
|
- install.rb
|
41
|
-
- lib/intercession
|
42
|
-
- lib/intercession/version.rb
|
43
|
-
- rails/init.rb
|
45
|
+
- lib/intercession.rb
|
44
46
|
- session.template
|
45
47
|
has_rdoc: true
|
46
48
|
homepage: http://github.com/jbarnette/intercession
|
49
|
+
licenses: []
|
50
|
+
|
47
51
|
post_install_message:
|
48
52
|
rdoc_options:
|
49
53
|
- --main
|
@@ -65,9 +69,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
69
|
requirements: []
|
66
70
|
|
67
71
|
rubyforge_project: intercession
|
68
|
-
rubygems_version: 1.3.
|
72
|
+
rubygems_version: 1.3.5
|
69
73
|
signing_key:
|
70
|
-
specification_version:
|
71
|
-
summary:
|
74
|
+
specification_version: 3
|
75
|
+
summary: Treat your sessions like models, not hashes
|
72
76
|
test_files: []
|
73
77
|
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Intercession
|
2
|
-
module Lifecycle
|
3
|
-
def self.included klass
|
4
|
-
klass.prepend_before_filter :intercede_before
|
5
|
-
klass.append_after_filter :intercede_after
|
6
|
-
end
|
7
|
-
|
8
|
-
def intercede_before
|
9
|
-
session.extend Transient::Session
|
10
|
-
|
11
|
-
session.controller = self if session.respond_to?(:controller=)
|
12
|
-
session.request = request if session.respond_to?(:request=)
|
13
|
-
session.response = response if session.respond_to?(:response=)
|
14
|
-
|
15
|
-
session.after_initialize if session.respond_to? :after_initialize
|
16
|
-
end
|
17
|
-
|
18
|
-
def intercede_after
|
19
|
-
# FIXME: this obviously won't work with after filters in subclasses.
|
20
|
-
session.before_save if session.respond_to? :before_save
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
data/lib/intercession/version.rb
DELETED
data/rails/init.rb
DELETED