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 +4 -4
- data/lib/web_utils.rb +3 -3
- data/test/test_web_utils.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72d741238181cbc667a37c95803e3d7fe3e28037
|
4
|
+
data.tar.gz: 2709ce8f413c4098bd3fb390fa833d99b7dc2b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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)
|
data/test/test_web_utils.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|