webs 0.1.46 → 0.1.47

Sign up to get free protection for your applications and to get access to all the features.
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.46') do |p|
6
+ Echoe.new('webs', '0.1.47') 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"
@@ -166,6 +166,38 @@ module Webs
166
166
  def fix_request_format
167
167
  request.format = :html if request.format.blank? || ( request.format.to_s =~ /^charset/i || request.format.to_s =~ /^url_encoded_form/i )
168
168
  end
169
+
170
+ def fix_encoding
171
+ fix_encoding_for_hash params
172
+ end
173
+
174
+ def fix_encoding_for_hash h_params
175
+ return if h_params.nil?
176
+ h_params.each_pair do |k,v|
177
+ if v.is_a?(String)
178
+ h_params[k] = to_iso8859( v )
179
+ elsif v.is_a?(Hash)
180
+ fix_encoding_for_hash v
181
+ elsif v.is_a?(Array)
182
+ fix_encoding_for_array v
183
+ end
184
+ end
185
+ end
186
+
187
+
188
+ def fix_encoding_for_array a_params
189
+ return if a_params.nil?
190
+ a_params.each_with_index do |v, idx|
191
+ if v.is_a?(String)
192
+ a_params[idx] = to_iso8859( v )
193
+ elsif v.is_a?(Hash)
194
+ fix_encoding_for_hash v
195
+ elsif v.is_a?(Array)
196
+ fix_encoding_for_array v
197
+ end
198
+ end
199
+ end
200
+
169
201
  end
170
202
  end
171
203
  end
@@ -0,0 +1,18 @@
1
+ require 'iconv'
2
+
3
+ module Webs
4
+ module Helper
5
+ module Encoding
6
+ def to_utf8( s )
7
+ Iconv.conv("utf-8", "ISO-8859-1", s)
8
+ rescue
9
+ s
10
+ end
11
+ def to_iso8859( s )
12
+ Iconv.conv("ISO-8859-1", "utf-8", s )
13
+ rescue
14
+ s
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,7 +1,7 @@
1
1
  <div class="fw-error">
2
2
  <div class="errorExplanation" id="errorExplanation">
3
3
  <% options ||= {:header_tag=>'h2'} %>
4
- <% content_tag( options[:header_tag] ) do %>
4
+ <%= content_tag( options[:header_tag] ) do %>
5
5
  <fw:intl>Please correct the following problems</fw:intl>:
6
6
  <% end %>
7
7
  <ul>
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.46'.freeze
10
+ VERSION = '0.1.47'.freeze
11
11
 
12
12
  def self.app_title
13
13
  APP_NAME.titleize
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.46"
5
+ s.version = "0.1.47"
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-06-15}
9
+ s.date = %q{2011-09-23}
10
10
  s.description = %q{Reusable webs stuff.}
11
11
  s.email = %q{chuck@webs.com}
12
12
  gemfiles = Dir.glob( "**/*.{erb,rb,rdoc}" )
metadata CHANGED
@@ -1,31 +1,22 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: webs
3
- version: !ruby/object:Gem::Version
4
- hash: 71
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.47
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 46
10
- version: 0.1.46
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Chuck Olczak
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-06-15 00:00:00 -04:00
12
+ date: 2011-09-23 00:00:00.000000000 -04:00
19
13
  default_executable:
20
14
  dependencies: []
21
-
22
15
  description: Reusable webs stuff.
23
16
  email: chuck@webs.com
24
17
  executables: []
25
-
26
18
  extensions: []
27
-
28
- extra_rdoc_files:
19
+ extra_rdoc_files:
29
20
  - lib/views/layouts/webs_utility.html.erb
30
21
  - lib/views/layouts/webs_page.html.erb
31
22
  - lib/views/shared/_jquery_noconflict.html.erb
@@ -37,6 +28,7 @@ extra_rdoc_files:
37
28
  - lib/controller/url_for_context_path.rb
38
29
  - lib/controller/alive_controller.rb
39
30
  - lib/controller/permission_converter.rb
31
+ - lib/helper/encoding.rb
40
32
  - lib/helper/tags.rb
41
33
  - lib/helper/params.rb
42
34
  - lib/helper/application.rb
@@ -50,7 +42,7 @@ extra_rdoc_files:
50
42
  - lib/config/initializers/intl_select.rb
51
43
  - lib/config/webs_initializer.rb
52
44
  - README.rdoc
53
- files:
45
+ files:
54
46
  - lib/views/layouts/webs_utility.html.erb
55
47
  - lib/views/layouts/webs_page.html.erb
56
48
  - lib/views/shared/_jquery_noconflict.html.erb
@@ -62,6 +54,7 @@ files:
62
54
  - lib/controller/url_for_context_path.rb
63
55
  - lib/controller/alive_controller.rb
64
56
  - lib/controller/permission_converter.rb
57
+ - lib/helper/encoding.rb
65
58
  - lib/helper/tags.rb
66
59
  - lib/helper/params.rb
67
60
  - lib/helper/application.rb
@@ -80,42 +73,32 @@ files:
80
73
  has_rdoc: true
81
74
  homepage: http://github.com/websdotcom/websgem
82
75
  licenses: []
83
-
84
76
  post_install_message:
85
- rdoc_options:
77
+ rdoc_options:
86
78
  - --line-numbers
87
79
  - --inline-source
88
80
  - --title
89
81
  - Webs
90
82
  - --main
91
83
  - README.rdoc
92
- require_paths:
84
+ require_paths:
93
85
  - lib
94
- required_ruby_version: !ruby/object:Gem::Requirement
86
+ required_ruby_version: !ruby/object:Gem::Requirement
95
87
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 3
100
- segments:
101
- - 0
102
- version: "0"
103
- required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ! '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
93
  none: false
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- hash: 11
109
- segments:
110
- - 1
111
- - 2
112
- version: "1.2"
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '1.2'
113
98
  requirements: []
114
-
115
99
  rubyforge_project: webs
116
100
  rubygems_version: 1.6.2
117
101
  signing_key:
118
102
  specification_version: 3
119
103
  summary: Reusable webs stuff.
120
104
  test_files: []
121
-