Module: Zugzwang::Helpers
- Included in:
- CLI
- Defined in:
- lib/zugzwang/helpers.rb
Instance Method Summary collapse
Instance Method Details
#sanitize_path(path) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/zugzwang/helpers.rb', line 3 def sanitize_path(path) dir, file = File.dirname(path), File.basename(path,'.*') file.strip! do |name| name.gsub!(/^.*(\\|\/)/, '') name.gsub!(/[^0-9A-Za-z.\-]/, '_') end "#{dir}/#{file}" end |