File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33require "csv"
44require "time"
5- require "active_support/all"
65
7- def parameterize ( string , separator : "-" )
8- # Turn unwanted chars into the separator.
9- parameterized_string = string . downcase . gsub! ( /[^a-z0-9\- _]+/ , separator )
6+ def parameterize ( string , separator : "-" )
7+ # Turn unwanted chars into the separator.
8+ parameterized_string = string . downcase . gsub! ( /[^a-z0-9\- _]+/ , separator )
109
11- unless separator . nil? || separator . empty?
12- re_leading_trailing_separator = /^-|-$/
13- parameterized_string . gsub! ( re_leading_trailing_separator , "" . freeze )
14- end
10+ unless separator . nil? || separator . empty?
11+ re_leading_trailing_separator = /^-|-$/
12+ parameterized_string . gsub! ( re_leading_trailing_separator , "" . freeze )
13+ end
1514
16- parameterized_string
17- end
15+ parameterized_string
16+ end
1817
1918CSV . foreach ( ARGV [ 0 ] , headers : true ) . each do |row |
2019 title = row [ "title" ]
You can’t perform that action at this time.
0 commit comments