simple_slugs 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.
- data/lib/simple_slugs/act_macro.rb +1 -5
- data/lib/simple_slugs/slug.rb +0 -13
- data/lib/simple_slugs/slugger.rb +3 -0
- data/lib/simple_slugs/version.rb +1 -1
- data/lib/simple_slugs.rb +1 -2
- metadata +4 -4
@@ -1,16 +1,12 @@
|
|
1
1
|
module SimpleSlugs
|
2
2
|
module ActMacro
|
3
3
|
def has_slug(options = {})
|
4
|
-
return if
|
4
|
+
return if respond_to?(:slugger)
|
5
5
|
|
6
6
|
before_validation lambda { |record| record.slugger.unique_slug!(record) }
|
7
7
|
|
8
8
|
class_inheritable_accessor :slugger
|
9
9
|
self.slugger = Slugger.new(self, options)
|
10
10
|
end
|
11
|
-
|
12
|
-
def has_slug?
|
13
|
-
included_modules.include?(SimpleSlugs)
|
14
|
-
end
|
15
11
|
end
|
16
12
|
end
|
data/lib/simple_slugs/slug.rb
CHANGED
@@ -24,18 +24,5 @@ module SimpleSlugs
|
|
24
24
|
def dasherize
|
25
25
|
gsub!(' ', '-')
|
26
26
|
end
|
27
|
-
|
28
|
-
# def normalize(ascii = false)
|
29
|
-
# if ascii
|
30
|
-
# approximate_ascii
|
31
|
-
# to_ascii
|
32
|
-
# end
|
33
|
-
# clean
|
34
|
-
# word_chars
|
35
|
-
# clean
|
36
|
-
# downcase
|
37
|
-
# truncate_bytes(255)
|
38
|
-
# with_dashes
|
39
|
-
# end
|
40
27
|
end
|
41
28
|
end
|
data/lib/simple_slugs/slugger.rb
CHANGED
data/lib/simple_slugs/version.rb
CHANGED
data/lib/simple_slugs.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_slugs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sven Fuchs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-04 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|