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.2.0 lib/speckle/list/dir_expander.rb
speckle-0.1.31 lib/speckle/list/dir_expander.rb
speckle-0.1.30 lib/speckle/list/dir_expander.rb
speckle-0.1.29 lib/speckle/list/dir_expander.rb
speckle-0.1.28 lib/speckle/list/dir_expander.rb
speckle-0.1.27 lib/speckle/list/dir_expander.rb
speckle-0.1.26 lib/speckle/list/dir_expander.rb
speckle-0.1.25 lib/speckle/list/dir_expander.rb
speckle-0.1.24 lib/speckle/list/dir_expander.rb
speckle-0.1.23 lib/speckle/list/dir_expander.rb
speckle-0.1.22 lib/speckle/list/dir_expander.rb
speckle-0.1.21 lib/speckle/list/dir_expander.rb
speckle-0.1.20 lib/speckle/list/dir_expander.rb
speckle-0.1.19 lib/speckle/list/dir_expander.rb
speckle-0.1.18 lib/speckle/list/dir_expander.rb
speckle-0.1.17 lib/speckle/list/dir_expander.rb
speckle-0.1.16 lib/speckle/list/dir_expander.rb
speckle-0.1.15 lib/speckle/list/dir_expander.rb
speckle-0.1.14 lib/speckle/list/dir_expander.rb
speckle-0.1.13 lib/speckle/list/dir_expander.rb