brstring 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,4 +12,3 @@ string_portuguese).each {|req| require File.dirname(__FILE__) + "/brstring/#{req
12
12
 
13
13
  module BrString
14
14
  end
15
-
@@ -39,7 +39,7 @@ class String
39
39
  # String.remover_acentos('texto está com acentuação') ==> 'texto esta com acentuacao'
40
40
  def self.remover_acentos(texto)
41
41
  return texto if texto.blank?
42
- texto = texto.gsub(/[á|à|ã|â|ä]/, 'a').gsub(/(é|è|ê|ë)/, 'e').gsub(/(í|ì|î|ï)/, 'i').gsub(/(ó|ò|õ|ô|ö)/, 'o').gsub(/(ú|ù|û|ü)/, 'u')
42
+ texto = texto.gsub(/(á|à|ã|â|ä)/, 'a').gsub(/(é|è|ê|ë)/, 'e').gsub(/(í|ì|î|ï)/, 'i').gsub(/(ó|ò|õ|ô|ö)/, 'o').gsub(/(ú|ù|û|ü)/, 'u')
43
43
  texto = texto.gsub(/(Á|À|Ã|Â|Ä)/, 'A').gsub(/(É|È|Ê|Ë)/, 'E').gsub(/(Í|Ì|Î|Ï)/, 'I').gsub(/(Ó|Ò|Õ|Ô|Ö)/, 'O').gsub(/(Ú|Ù|Û|Ü)/, 'U')
44
44
  texto = texto.gsub(/ñ/, 'n').gsub(/Ñ/, 'N')
45
45
  texto = texto.gsub(/ç/, 'c').gsub(/Ç/, 'C')
@@ -1,7 +1,7 @@
1
1
  module BrString
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
- MINOR = 1
4
+ MINOR = 2
5
5
  TINY = 0
6
6
 
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
@@ -104,6 +104,17 @@ class StringPortugueseTest < Test::Unit::TestCase
104
104
  assert_equal 'aeiouAEIOU', string
105
105
  end
106
106
 
107
+ def test_nao_trocar_caracter_pipe_pelo_caracter_a_ao_removere_acentos
108
+ assert_equal '|', String.remover_acentos('|')
109
+ assert_not_equal 'a', String.remover_acentos('|')
110
+ assert_equal '|', '|'.remover_acentos
111
+ assert_not_equal 'a', '|'.remover_acentos
112
+ char_pipe = '|'
113
+ char_pipe.remover_acentos!
114
+ assert_equal '|', char_pipe
115
+ assert_not_equal 'a', char_pipe
116
+ end
117
+
107
118
  def test_string_downcase
108
119
  assert_equal String::MINUSCULAS, String.downcase(String::MAIUSCULAS)
109
120
  assert_nil String.downcase(nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brstring
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,11 +15,11 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2012-02-26 00:00:00.000000000Z
18
+ date: 2012-08-28 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activesupport
22
- requirement: &2152331640 !ruby/object:Gem::Requirement
22
+ requirement: !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ! '>='
@@ -27,10 +27,15 @@ dependencies:
27
27
  version: 3.0.0
28
28
  type: :runtime
29
29
  prerelease: false
30
- version_requirements: *2152331640
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: 3.0.0
31
36
  - !ruby/object:Gem::Dependency
32
37
  name: rake
33
- requirement: &2152330800 !ruby/object:Gem::Requirement
38
+ requirement: !ruby/object:Gem::Requirement
34
39
  none: false
35
40
  requirements:
36
41
  - - ! '>='
@@ -38,7 +43,12 @@ dependencies:
38
43
  version: '0'
39
44
  type: :development
40
45
  prerelease: false
41
- version_requirements: *2152330800
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
42
52
  description: brstring é uma das gems que compoem o Brazilian Rails
43
53
  email:
44
54
  - tapajos@gmail.com
@@ -75,7 +85,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
85
  version: '0'
76
86
  segments:
77
87
  - 0
78
- hash: -2295397378933354978
88
+ hash: -2579924115031989464
79
89
  required_rubygems_version: !ruby/object:Gem::Requirement
80
90
  none: false
81
91
  requirements:
@@ -85,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
95
  requirements:
86
96
  - none
87
97
  rubyforge_project: brstring
88
- rubygems_version: 1.8.15
98
+ rubygems_version: 1.8.23
89
99
  signing_key:
90
100
  specification_version: 3
91
101
  summary: brstring é uma das gems que compoem o Brazilian Rails