Skip to content

Commit

Permalink
format slugify script code
Browse files Browse the repository at this point in the history
  • Loading branch information
garybernhardt committed Nov 21, 2014
1 parent c775263 commit 6ddc3cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/slugify
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby

def slugify(s)
s.strip.gsub(/[^a-zA-Z0-9]+/, '-').
gsub(/[^a-zA-Z0-9]+$/, "").
gsub(/^[^a-zA-Z0-9]+/, "").
downcase
s.strip.gsub(/[^a-zA-Z0-9]+/, '-')
.gsub(/[^a-zA-Z0-9]+$/, "")
.gsub(/^[^a-zA-Z0-9]+/, "")
.downcase
end

$stdin.readlines.each { |line| puts slugify(line) }

0 comments on commit 6ddc3cb

Please sign in to comment.