webs 0.1.18 → 0.1.19
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/Rakefile +1 -1
- data/lib/controller/webs_controller.rb +2 -6
- data/lib/middleware/parameter_fixer.rb +31 -0
- data/lib/views/layouts/webs_page.html.erb +7 -3
- data/lib/webs.rb +1 -1
- data/webs.gemspec +3 -2
- metadata +66 -59
data/Rakefile
CHANGED
@@ -69,6 +69,7 @@ module Webs
|
|
69
69
|
options = args[0]
|
70
70
|
end
|
71
71
|
|
72
|
+
options ||= {}
|
72
73
|
if options.class.to_s =~ /Hash/
|
73
74
|
partials = options.delete(:partials)
|
74
75
|
end
|
@@ -89,12 +90,7 @@ module Webs
|
|
89
90
|
end
|
90
91
|
|
91
92
|
def set_webs_permapath pp=nil
|
92
|
-
@permapath = pp
|
93
|
-
if @permapath.nil?
|
94
|
-
path = request.env["REQUEST_PATH"]
|
95
|
-
@permapath = path.blank? ? "/" : path.sub(/-[^-]*$/, '')
|
96
|
-
end
|
97
|
-
@permapath
|
93
|
+
@permapath = pp || request.env["REQUEST_PATH"] || "/"
|
98
94
|
end
|
99
95
|
|
100
96
|
def validate_webs_session
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# OK this totally sucked. Basically if you use a session store that sets the session
|
2
|
+
# id via a request param key( :key=>'fw_sig_session_key' in the store config), request.params will get fired off during the middleware init
|
3
|
+
# which hoses the path_parameters. So a quick and dirty is to just clear the request parameters out of
|
4
|
+
# the middleware stack right after they get set by the mem_cache_store by using another Rack middleware.
|
5
|
+
# Here is the line that is causing problems: http://github.com/rails/rails/blob/v3.0.5/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb#L207
|
6
|
+
#
|
7
|
+
# NOTE: I tried to add this directly after the MemCacheStore as follows but to no avail
|
8
|
+
#
|
9
|
+
#Links::Application.config.middleware.insert_after "ActionDispatch::Session::MemCacheStore", "Webs::Middleware::ParameterFixer"
|
10
|
+
#
|
11
|
+
# What did work was adding it at the end, just be careful not to clobber another middleware that might set it, also it looks like this will change in a future release of rails:
|
12
|
+
#
|
13
|
+
#require "middleware/parameter_fixer.rb"
|
14
|
+
#Links::Application.config.middleware.use "Webs::Middleware::ParameterFixer"
|
15
|
+
|
16
|
+
module Webs
|
17
|
+
module Middleware
|
18
|
+
class ParameterFixer
|
19
|
+
def initialize(app)
|
20
|
+
@app = app
|
21
|
+
end
|
22
|
+
|
23
|
+
def call(env)
|
24
|
+
env["action_dispatch.request.parameters"] = nil
|
25
|
+
env["action_dispatch.request.path_parameters"] = nil
|
26
|
+
@app.call(env)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -8,12 +8,16 @@
|
|
8
8
|
<fw:paragraph>
|
9
9
|
<fw:title>
|
10
10
|
<span style="float:left" class="pageTitle">
|
11
|
-
|
12
|
-
|
11
|
+
<% if @title %>
|
12
|
+
<%= @title %>
|
13
|
+
<% else %>
|
14
|
+
<%= raw( %(<fw:page-title path='/' />) ) %>
|
15
|
+
<% end %>
|
13
16
|
</span>
|
17
|
+
<%= yield :fw_title %>
|
14
18
|
<div class="clear clear_head"></div>
|
15
19
|
</fw:title>
|
16
20
|
|
17
21
|
<%= yield %>
|
18
22
|
</fw:paragraph>
|
19
|
-
<% end %>
|
23
|
+
<% end %>
|
data/lib/webs.rb
CHANGED
data/webs.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{webs}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.19"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Chuck Olczak"]
|
9
|
-
s.date = %q{2011-
|
9
|
+
s.date = %q{2011-03-16}
|
10
10
|
s.description = %q{Reusable webs stuff.}
|
11
11
|
s.email = %q{chuck@webs.com}
|
12
12
|
gemfiles = [
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
"lib/helper/application.rb",
|
23
23
|
"lib/helper/params.rb",
|
24
24
|
"lib/helper/tags.rb",
|
25
|
+
"lib/middleware/parameter_fixer.rb",
|
25
26
|
"lib/views/layouts/webs_page.html.erb",
|
26
27
|
"lib/views/layouts/webs_utility.html.erb",
|
27
28
|
"lib/test/webs_test_helper.rb",
|
metadata
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 61
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
version: 0.1.
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 19
|
10
|
+
version: 0.1.19
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
|
-
|
13
|
+
- Chuck Olczak
|
13
14
|
autorequire:
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
+
date: 2011-03-16 00:00:00 -04:00
|
18
19
|
default_executable:
|
19
20
|
dependencies: []
|
20
21
|
|
@@ -25,74 +26,80 @@ executables: []
|
|
25
26
|
extensions: []
|
26
27
|
|
27
28
|
extra_rdoc_files:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
29
|
+
- README.rdoc
|
30
|
+
- lib/webs.rb
|
31
|
+
- lib/cache/cache.rb
|
32
|
+
- lib/config/webs_constants.rb
|
33
|
+
- lib/config/webs_initializer.rb
|
34
|
+
- lib/controller/url_for_context_path.rb
|
35
|
+
- lib/controller/alive_controller.rb
|
36
|
+
- lib/controller/info_controller.rb
|
37
|
+
- lib/controller/webs_controller.rb
|
38
|
+
- lib/helper/application.rb
|
39
|
+
- lib/helper/params.rb
|
40
|
+
- lib/helper/tags.rb
|
41
|
+
- lib/middleware/parameter_fixer.rb
|
42
|
+
- lib/views/layouts/webs_page.html.erb
|
43
|
+
- lib/views/layouts/webs_utility.html.erb
|
44
|
+
- lib/test/webs_test_helper.rb
|
45
|
+
- lib/views/shared/_webs_info.html.erb
|
44
46
|
files:
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
47
|
+
- README.rdoc
|
48
|
+
- lib/webs.rb
|
49
|
+
- lib/cache/cache.rb
|
50
|
+
- lib/config/webs_constants.rb
|
51
|
+
- lib/config/webs_initializer.rb
|
52
|
+
- lib/controller/url_for_context_path.rb
|
53
|
+
- lib/controller/alive_controller.rb
|
54
|
+
- lib/controller/info_controller.rb
|
55
|
+
- lib/controller/webs_controller.rb
|
56
|
+
- lib/helper/application.rb
|
57
|
+
- lib/helper/params.rb
|
58
|
+
- lib/helper/tags.rb
|
59
|
+
- lib/middleware/parameter_fixer.rb
|
60
|
+
- lib/views/layouts/webs_page.html.erb
|
61
|
+
- lib/views/layouts/webs_utility.html.erb
|
62
|
+
- lib/test/webs_test_helper.rb
|
63
|
+
- lib/views/shared/_webs_info.html.erb
|
64
|
+
- Rakefile
|
65
|
+
- webs.gemspec
|
63
66
|
has_rdoc: true
|
64
67
|
homepage: http://github.com/websdotcom/websgem
|
65
68
|
licenses: []
|
66
69
|
|
67
70
|
post_install_message:
|
68
71
|
rdoc_options:
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
72
|
+
- --line-numbers
|
73
|
+
- --inline-source
|
74
|
+
- --title
|
75
|
+
- Webs
|
76
|
+
- --main
|
77
|
+
- README.rdoc
|
75
78
|
require_paths:
|
76
|
-
|
79
|
+
- lib
|
77
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
78
82
|
requirements:
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
84
89
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
85
91
|
requirements:
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
hash: 11
|
95
|
+
segments:
|
96
|
+
- 1
|
97
|
+
- 2
|
98
|
+
version: "1.2"
|
92
99
|
requirements: []
|
93
100
|
|
94
101
|
rubyforge_project: webs
|
95
|
-
rubygems_version: 1.3.
|
102
|
+
rubygems_version: 1.3.7
|
96
103
|
signing_key:
|
97
104
|
specification_version: 3
|
98
105
|
summary: Reusable webs stuff.
|