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 CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('webs', '0.1.18') do |p|
6
+ Echoe.new('webs', '0.1.19') do |p|
7
7
  p.description = "Reusable webs stuff."
8
8
  p.url = "https://colczak@github.com/websdev/websgem.git"
9
9
  p.author = "Chuck Olczak"
@@ -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
- <%= raw( %(<fw:page-title path='/' />) ) %>
12
- <%= yield :fw_title %>
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
@@ -7,7 +7,7 @@ require dir + 'helper/params'
7
7
  require dir + 'helper/tags'
8
8
 
9
9
  module Webs
10
- VERSION = '0.1.18'.freeze
10
+ VERSION = '0.1.19'.freeze
11
11
 
12
12
  # def self.load_constants
13
13
  # s = File.read("#{Pathname(__FILE__).dirname.expand_path}/config/webs_constants.yml")
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.18"
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-02-11}
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
- - 0
7
- - 1
8
- - 18
9
- version: 0.1.18
7
+ - 0
8
+ - 1
9
+ - 19
10
+ version: 0.1.19
10
11
  platform: ruby
11
12
  authors:
12
- - Chuck Olczak
13
+ - Chuck Olczak
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-02-11 00:00:00 -05:00
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
- - README.rdoc
29
- - lib/webs.rb
30
- - lib/cache/cache.rb
31
- - lib/config/webs_constants.rb
32
- - lib/config/webs_initializer.rb
33
- - lib/controller/url_for_context_path.rb
34
- - lib/controller/alive_controller.rb
35
- - lib/controller/info_controller.rb
36
- - lib/controller/webs_controller.rb
37
- - lib/helper/application.rb
38
- - lib/helper/params.rb
39
- - lib/helper/tags.rb
40
- - lib/views/layouts/webs_page.html.erb
41
- - lib/views/layouts/webs_utility.html.erb
42
- - lib/test/webs_test_helper.rb
43
- - lib/views/shared/_webs_info.html.erb
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
- - README.rdoc
46
- - lib/webs.rb
47
- - lib/cache/cache.rb
48
- - lib/config/webs_constants.rb
49
- - lib/config/webs_initializer.rb
50
- - lib/controller/url_for_context_path.rb
51
- - lib/controller/alive_controller.rb
52
- - lib/controller/info_controller.rb
53
- - lib/controller/webs_controller.rb
54
- - lib/helper/application.rb
55
- - lib/helper/params.rb
56
- - lib/helper/tags.rb
57
- - lib/views/layouts/webs_page.html.erb
58
- - lib/views/layouts/webs_utility.html.erb
59
- - lib/test/webs_test_helper.rb
60
- - lib/views/shared/_webs_info.html.erb
61
- - Rakefile
62
- - webs.gemspec
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
- - --line-numbers
70
- - --inline-source
71
- - --title
72
- - Webs
73
- - --main
74
- - README.rdoc
72
+ - --line-numbers
73
+ - --inline-source
74
+ - --title
75
+ - Webs
76
+ - --main
77
+ - README.rdoc
75
78
  require_paths:
76
- - lib
79
+ - lib
77
80
  required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
78
82
  requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
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
- - !ruby/object:Gem::Version
88
- segments:
89
- - 1
90
- - 2
91
- version: "1.2"
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.6
102
+ rubygems_version: 1.3.7
96
103
  signing_key:
97
104
  specification_version: 3
98
105
  summary: Reusable webs stuff.