preformatter 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
data/lib/preformatter.rb CHANGED
@@ -19,7 +19,9 @@ module Preformatter
19
19
  args.each do |field|
20
20
  before_validation do |record|
21
21
  attribute = record.send("#{field.to_s}")
22
- replace = {'á' => 'a','é' => 'e','í' => 'i','ó' => 'o','ú' => 'u'}
22
+ replace = {'á' => 'a','é' => 'e','í' => 'i','ó' => 'o','ú' => 'u',
23
+ 'ñ' => 'n', 'Ñ' => 'N',
24
+ 'Á' => 'A' , 'É' => 'E', 'Í' => 'I', 'Ó' => 'O','Ú' => 'U'}
23
25
  unless attribute.nil?
24
26
  attribute.gsub!(/[#{replace.keys.join('|')}]/).each do |c|
25
27
  replace[c]
data/preformatter.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{preformatter}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adrian Cuadros", "Eduardo Moreno", "Andres Paglayan"]
12
- s.date = %q{2010-05-14}
12
+ s.date = %q{2010-05-18}
13
13
  s.description = %q{The gem helps you by deleting spaces, special characters or replacing accents in the fields you need.}
14
14
  s.email = %q{adrian@innku.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 0.2.0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adrian Cuadros
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-05-14 00:00:00 -05:00
19
+ date: 2010-05-18 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency