Skip to content

Commit

Permalink
Use Shellwords#shellescape instead of Regexp#escape for paths
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Jul 23, 2011
1 parent f5ff620 commit b133d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/scene_toolkit/cli/helpers.rb
@@ -1,5 +1,7 @@
# encoding: utf-8

require 'shellwords'

module SceneToolkit
class CLI < Optitron::CLI
protected
Expand Down Expand Up @@ -60,7 +62,7 @@ def each_release(source, &block)

releases = []

Dir.glob(File.join(Regexp.escape(source), "**", "*.mp3")).each do |file|
Dir.glob(File.join(Shellwords.shellescape(source), "**", "*.mp3")).each do |file|
release_path = File.expand_path(File.dirname(file))

unless releases.include?(release_path)
Expand Down
3 changes: 2 additions & 1 deletion lib/scene_toolkit/release/helpers.rb
@@ -1,12 +1,13 @@
require 'active_support/concern'
require 'shellwords'

module SceneToolkit
class Release
module Helpers
extend ActiveSupport::Concern

def files
Dir.glob(File.join(Regexp.escape(@path), "*"))
Dir.glob(File.join(Shellwords.shellescape(@path), "*"))
end

included do
Expand Down

0 comments on commit b133d6e

Please sign in to comment.