slugalizer 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slugalizer/sugar.rb +13 -0
- data/lib/slugalizer.rb +4 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 618ffa995db619844163ad93d3be2d8d204dc646
|
4
|
+
data.tar.gz: 561def36959b279639ed6530a3d42e7f7ebfa512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7f8c16591c3e0b9b051c7041b113ce21ca37495a3abcf19d065992040a377404fe6946c6fb2f2399993eed221e75fa03ae85e189c6cef7ab33bfca0c1d830a5
|
7
|
+
data.tar.gz: 8412f9ca8bc192c33ae7ed26f4f04c909633c7d83f24c679884e9e03a280ada02b4f6bfa2647a554cf620ffbc91f32ce36665c66805fb40d2bb614241edba7e5
|
data/lib/slugalizer.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Slugalizer
|
2
|
-
|
2
|
+
def self.to_slug(string = '')
|
3
|
+
return '' if string.nil?
|
3
4
|
|
4
|
-
def to_slug(string = '')
|
5
5
|
# strip the string
|
6
6
|
ret = string.strip
|
7
7
|
|
@@ -17,8 +17,7 @@ module Slugalizer
|
|
17
17
|
# strip off leading/trailing dashes
|
18
18
|
ret.gsub! /\A[-\.]+|[-\.]+\z/,""
|
19
19
|
|
20
|
-
#
|
21
|
-
ret.downcase
|
22
|
-
ret
|
20
|
+
# transform to downcase
|
21
|
+
ret.downcase
|
23
22
|
end
|
24
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slugalizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Aguilar
|
@@ -66,13 +66,14 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: Generate slugs for your models with this tiny tiny gem.
|
70
70
|
email: martinaguilar@outlook.com
|
71
71
|
executables: []
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
75
|
- lib/slugalizer.rb
|
76
|
+
- lib/slugalizer/sugar.rb
|
76
77
|
homepage: http://rubygems.org/gems/slugalizer
|
77
78
|
licenses:
|
78
79
|
- MIT
|