accentless 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
Binary file
|
@@ -34,6 +34,11 @@ class String
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def remove_ponctuation
|
37
|
+
warn "[DEPRECATION] Method renamed to remove_punctuation"
|
38
|
+
remove_punctuation
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_punctuation
|
37
42
|
str = String.new(self)
|
38
43
|
str.gsub!(/[^\w\s]/,"")
|
39
44
|
str
|
@@ -41,7 +46,7 @@ class String
|
|
41
46
|
|
42
47
|
def only_text
|
43
48
|
str = String.new(self)
|
44
|
-
str.remove_accents.
|
49
|
+
str.remove_accents.remove_punctuation
|
45
50
|
end
|
46
51
|
end
|
47
52
|
|
data/lib/accentless/version.rb
CHANGED
@@ -11,14 +11,14 @@ describe String do
|
|
11
11
|
"Tẽst".remove_accents.should == "Test"
|
12
12
|
end
|
13
13
|
|
14
|
-
describe "
|
14
|
+
describe "remove_punctuation" do
|
15
15
|
it "should remove especial caracters" do
|
16
|
-
"Testing: all!
|
16
|
+
"Testing: all! punctuation?.,'¿! should be removed".remove_punctuation.should == "Testing all punctuation should be removed"
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "only_text" do
|
21
|
-
it "should remove accents and
|
21
|
+
it "should remove accents and punctuation" do
|
22
22
|
"Testing: lâmpadas mágicas não existem!".only_text.should == "Testing lampadas magicas nao existem"
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accentless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- Gemfile.lock
|
42
42
|
- README
|
43
43
|
- Rakefile
|
44
|
+
- accentless-0.1.0.gem
|
44
45
|
- accentless.gemspec
|
45
46
|
- lib/accentless.rb
|
46
47
|
- lib/accentless/extend_string.rb
|