clean-this-dirty-string 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac79d832ade34c46c0aca819a51423d8bd83ce54e53a67dceff31c3dd62aed11
4
- data.tar.gz: e2b218bf8f8b5f2b99a85ac2384f6596ae017192e434d73a85bd32026d25b186
3
+ metadata.gz: e4dd2e37bb53427fde78b7dc489d73e693e57efac254f1fb01ddb6ea44ae90f1
4
+ data.tar.gz: 0fdd3971559f9a3c9bf78b4fd7831dd4407bd4dc605ae9147d80c1386a4ab123
5
5
  SHA512:
6
- metadata.gz: c5ecc218b7381576e0af11d1648e234d3096f414e3ae9857d766b1a0a0f7f0a6f0ae1649d60763d93cf7f73580edf6e2c07f4ddaec106ecb3d26348c2378ddf7
7
- data.tar.gz: 3ab4c1c6df668d9662b6c5ac23967c86883bf73573fb9bfd3963139c967b4678346b3b1c530452ae35477b8c2b52ffcd4b289c52f5f10ef05cf954e8a3ecd32f
6
+ metadata.gz: bf693a49cbbc6c9f93fda4d36b6eec50b2048ea0832507d09e535aca62eaed8bf12dfc7a9e52822d5cb7c52332ae85bfb82669cf6ac1bfe462f1a0ce3a925f77
7
+ data.tar.gz: 1cdcdc1983ec6bf7543ddfdbbe2e4eacd07f5e25387ef90db295d834252da8b766ea3e1868f6a05ad014d2dafeaa04bca54491f86b56f678df47f925525ab189
data/README.md CHANGED
@@ -1,4 +1,12 @@
1
1
  # clean-this-dirty-string
2
+ ## Your strings'll be clean
3
+ ## example
4
+ ```ruby
5
+ string = "Привет,\t“Махмед»!\nКак дела?😘"
6
+
7
+ CleanThisDirtyString.clean!(string)
8
+ # => 'Привет, "Махмед"! Как дела?'
9
+ ```
2
10
  ## test
3
11
  ```ruby
4
12
  ruby ./test/clean_this_dirty_string_test.rb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'clean-this-dirty-string'
3
- s.version = '0.0.1'
3
+ s.version = '0.0.2'
4
4
  s.date = '2018-08-28'
5
5
  s.summary = 'It cleans your dirty string'
6
6
  s.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -23,10 +23,16 @@ module CleanThisDirtyString
23
23
  when /[\;]/ then ';'
24
24
  when /[\<]/ then '<'
25
25
  when /[\>]/ then '>'
26
+ when /[\ ]/ then ' '
27
+ when /[\₽]/ then 'Р'
26
28
  else ''
27
29
  end
28
30
  end
29
31
 
30
32
  result.join('')
31
33
  end
34
+
35
+ def diff(string)
36
+ string.split('') - clean!(string).split('')
37
+ end
32
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clean-this-dirty-string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Sadovnikov