Skip to content

Commit

Permalink
Rename SlugGenerator.clean => generate_slug
Browse files Browse the repository at this point in the history
  • Loading branch information
smtlaissezfaire committed Aug 5, 2009
1 parent 58b9f29 commit 552af81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/slugify/slug_generator.rb
Expand Up @@ -3,7 +3,7 @@ class SlugGenerator
CHAR_ENCODING_TRANSLATION_TO = 'ascii//ignore//translit'
CHAR_ENCODING_TRANSLATION_FROM = 'utf-8'

def self.clean(str)
def self.generate_slug(str)
str = Iconv.iconv(CHAR_ENCODING_TRANSLATION_TO, CHAR_ENCODING_TRANSLATION_FROM, str).to_s
str.downcase!
str.gsub! /[\'\"\#\$\,\.\!\?\%\@\(\)]+/, ''
Expand Down Expand Up @@ -52,7 +52,7 @@ def build_conditions(slug_value)
end

def cleanup_slug(str)
self.class.clean(str)
self.class.generate_slug(str)
end

def set_unique_slug_value(slug_value)
Expand Down
2 changes: 1 addition & 1 deletion spec/slugify/slug_generation_spec.rb
Expand Up @@ -3,7 +3,7 @@
module Slugify
describe SlugGenerator do
it "should generate slug" do
Slugify::SlugGenerator.clean("Foo Bar").should == "foo-bar"
Slugify::SlugGenerator.generate_slug("Foo Bar").should == "foo-bar"
end
end
end

0 comments on commit 552af81

Please sign in to comment.