Sha256: 3877cf678d2293c168479537421de56b24e2ad92eec8ee95bc6238cb9aad0137

Contents?: true

Size: 435 Bytes

Versions: 25

Compression:

Stored size: 435 Bytes

Contents

module Speckle
  module List
    class DirExpander
      def initialize(pattern)
        @pattern = pattern
      end

      def run(item)
        pattern = "#{item}/#{@pattern}"
        #puts "DirExpander:run #{item}, pattern=#{pattern}"
        #puts "is dir = #{File.directory?(item)}"

        if File.directory?(item)
          return Dir.glob(pattern)
        else
          return [item]
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
speckle-0.1.12 lib/speckle/list/dir_expander.rb
speckle-0.1.11 lib/speckle/list/dir_expander.rb
speckle-0.1.10 lib/speckle/list/dir_expander.rb
speckle-0.1.9 lib/speckle/list/dir_expander.rb
speckle-0.1.8 lib/speckle/list/dir_expander.rb