accentless 0.0.2 → 0.1.0

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.
@@ -32,4 +32,16 @@ class String
32
32
 
33
33
  str
34
34
  end
35
+
36
+ def remove_ponctuation
37
+ str = String.new(self)
38
+ str.gsub!(/[^\w\s]/,"")
39
+ str
40
+ end
41
+
42
+ def only_text
43
+ str = String.new(self)
44
+ str.remove_accents.remove_ponctuation
45
+ end
35
46
  end
47
+
@@ -1,3 +1,3 @@
1
1
  module Accentless
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -10,4 +10,17 @@ describe String do
10
10
  it "should remove letter 'e' with tilde" do
11
11
  "Tẽst".remove_accents.should == "Test"
12
12
  end
13
+
14
+ describe "remove_ponctuation" do
15
+ it "should remove especial caracters" do
16
+ "Testing: all! ponctuation?.,'¿! should be removed".remove_ponctuation.should == "Testing all ponctuation should be removed"
17
+ end
18
+ end
19
+
20
+ describe "only_text" do
21
+ it "should remove accents and ponctuation" do
22
+ "Testing: lâmpadas mágicas não existem!".only_text.should == "Testing lampadas magicas nao existem"
23
+ end
24
+ end
25
+
13
26
  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.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-31 00:00:00.000000000 -03:00
13
- default_executable:
12
+ date: 2012-09-11 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rspec
17
- requirement: &21372480 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ~>
@@ -22,7 +21,12 @@ dependencies:
22
21
  version: 2.6.0
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *21372480
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.6.0
26
30
  description: ''
27
31
  email:
28
32
  - lucasas@gmail.com
@@ -43,7 +47,6 @@ files:
43
47
  - lib/accentless/version.rb
44
48
  - spec/accentless/extend_string_spec.rb
45
49
  - spec/spec_helper.rb
46
- has_rdoc: true
47
50
  homepage: ''
48
51
  licenses: []
49
52
  post_install_message:
@@ -64,8 +67,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
67
  version: '0'
65
68
  requirements: []
66
69
  rubyforge_project: accentless
67
- rubygems_version: 1.6.2
70
+ rubygems_version: 1.8.24
68
71
  signing_key:
69
72
  specification_version: 3
70
73
  summary: ''
71
- test_files: []
74
+ test_files:
75
+ - spec/accentless/extend_string_spec.rb
76
+ - spec/spec_helper.rb