web-utils 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 792776e1e1403fef198dc3ad45e8a7d8c59c8527
4
- data.tar.gz: fbce05a63fad14ad5cd278a908e98f3cb4c7c59d
3
+ metadata.gz: 72d741238181cbc667a37c95803e3d7fe3e28037
4
+ data.tar.gz: 2709ce8f413c4098bd3fb390fa833d99b7dc2b6a
5
5
  SHA512:
6
- metadata.gz: f2a8bb1233d38fe0a1a4cdf36658c8b3c344c04e6deb3ad9673c14987cec56921b243a451abe0a263efb94fe517e63432de32dd2fddcabc2b4abc0d722b226b0
7
- data.tar.gz: 6b5edcc51a47f8aec0bc9362d4ecdcd6265b47034bc23b8f511e65a9f76a5a2f8aea05b2b909fa276c6469bb2b3940feb12a9a28421bf6bc8e9487f0d509c9d9
6
+ metadata.gz: f7359c2ff59ab105393dcbff4d35eebab5dc365ff38c9b31f873f7d32f8f9f79788613dcf0a28ca0789ffb6f5307325b55efae91ac4da3e7362564d4062bb0c8
7
+ data.tar.gz: 26077fd8cb5edcf50f0a01dfda3b2af69e7f9f61984e2323b7f32681b86565d382fb37e7315660183f0d68fcaf640b4366875a93b0640ea056140b71380963f5
data/lib/web_utils.rb CHANGED
@@ -5,7 +5,7 @@ require 'uri'
5
5
 
6
6
  module WebUtils
7
7
 
8
- VERSION = '0.1.0'
8
+ VERSION = '0.1.1'
9
9
 
10
10
  # Most methods are supposed to be as simple as possible
11
11
  # and just cover most cases.
@@ -115,9 +115,9 @@ module WebUtils
115
115
  def slugify s, force_lower=true
116
116
  s = s.to_s
117
117
  .tr(ACCENTS, WITHOUT_ACCENTS)
118
- .tr(' .,;:?!/\'"()[]{}<>','-')
118
+ .tr('.,;:?!/\'"()[]{}<>','-')
119
119
  .gsub(/&/, 'and')
120
- .gsub(/-+/,'-')
120
+ .gsub(/[[:space:]\-]+/,'-')
121
121
  .gsub(/(^-|-$)/,'')
122
122
  s = s.downcase if force_lower
123
123
  escape(s)
@@ -232,7 +232,7 @@ describe WebUtils do
232
232
  # For making slug for a document
233
233
  # Possibly used instead of the id
234
234
 
235
- let(:arg) { "Así es la vida by Daniel Bär & Mickaël ? (100%)" }
235
+ let(:arg) { "Así es la vida by Daniel Bär & Mickaël ? (100%)" }
236
236
  it 'Builds a string made of lowercase URL-friendly chars' do
237
237
  assert_equal 'asi-es-la-vida-by-daniel-bar-and-mickael-100%25', utils.slugify(arg)
238
238
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickael Riga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-16 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack