slugster 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/slugster.rb +5 -7
- data/lib/slugster/version.rb +1 -1
- data/slugster-0.1.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05a65064f0f4ff6b95dfdb15e8e611a40d6502c6
|
4
|
+
data.tar.gz: ce8a396d0454034c63260f73c64113af443395f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7fda9ebd779a8e148799556888aa225fa959f2dc1adcc37bdc306bead0d634b0d5dc76fcc7d47b2e4f2ec6ab0083ef43333541a9b7b4a8861480611312209b2
|
7
|
+
data.tar.gz: 649543c0ac4410f3db90d8b19f3a608872976db0261fe4bd5815ea50e083d1bac1e682731fa646db95a2d68914075fc7c95322744f1cc69e984587bbe2e3fd85
|
data/lib/slugster.rb
CHANGED
@@ -106,7 +106,7 @@ class String #reopen string class to include #slugify
|
|
106
106
|
# Convert periods to dashs
|
107
107
|
string = string.gsub(/[.]/,"-")
|
108
108
|
|
109
|
-
unless options[:
|
109
|
+
unless options[:with_underscores]
|
110
110
|
# Convert underscores to dashs
|
111
111
|
string = string.gsub(/[_]/, "-")
|
112
112
|
end
|
@@ -114,7 +114,7 @@ class String #reopen string class to include #slugify
|
|
114
114
|
# Remove any characters that aren't alphanumeric (or a dash)
|
115
115
|
string = string.gsub(/[^a-zA-Z0-9 \-_]/,"")
|
116
116
|
|
117
|
-
#Replace multiple spaces with single space
|
117
|
+
# Replace multiple spaces with single space
|
118
118
|
string = string.gsub(/[ ]+/," ")
|
119
119
|
|
120
120
|
# Remove single quotes
|
@@ -123,25 +123,23 @@ class String #reopen string class to include #slugify
|
|
123
123
|
# Replace non-word characters (\W) with a space
|
124
124
|
string.gsub!(/\W+/, ' ')
|
125
125
|
|
126
|
-
# A little off the edges
|
126
|
+
# A little off the edges, if you will.
|
127
127
|
string.strip!
|
128
128
|
|
129
129
|
# Replace single spaces with a URL friendly dash (-)
|
130
130
|
string = string.gsub(/ /,"#{delimiter}")
|
131
131
|
|
132
|
-
#
|
132
|
+
# Replace multiple dashes
|
133
133
|
string = string.gsub(/-+/,"-")
|
134
134
|
|
135
|
-
#
|
135
|
+
# Replace multiple underscores
|
136
136
|
string = string.gsub(/_+/,"_")
|
137
137
|
|
138
138
|
# Replace spaces with dashes
|
139
139
|
string.gsub!(' ', '-')
|
140
140
|
|
141
|
-
# All characters should be downcased
|
142
141
|
string.downcase!
|
143
142
|
|
144
|
-
# Return the resulting slug
|
145
143
|
string
|
146
144
|
end
|
147
145
|
end
|
data/lib/slugster/version.rb
CHANGED
data/slugster-0.1.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slugster
|
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
|
- Collin Graves
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- bin/setup
|
71
71
|
- lib/slugster.rb
|
72
72
|
- lib/slugster/version.rb
|
73
|
+
- slugster-0.1.0.gem
|
73
74
|
- slugster.gemspec
|
74
75
|
homepage: http://github.com/collingraves/slugster
|
75
76
|
licenses:
|