Sha256: ffcbf7bc5ac2b90969905f2cb01546f6e706f1d052ca8fc4cf47f4d9db8fe72b

Contents?: true

Size: 688 Bytes

Versions: 15

Compression:

Stored size: 688 Bytes

Contents

module Traquitana
   class Selector
      def initialize(dir="")
         @dir = dir
      end

      def files
         config = Traquitana::Config.instance
         selected = []
         for file in config.list
            send, *ignore = *file
            mask = "#{@dir}#{send}"
            send_list = Dir.glob(mask).select { |f| File.file?(f) }
            for ignore_mask in ignore
               mask = "#{@dir}#{ignore_mask}"
               ignore_list = Dir.glob(mask).select { |f| File.file?(f) }
               send_list = send_list - ignore_list if ignore_list.size>0
            end
            selected.push(*send_list)
         end
         selected
      end
   end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
traquitana-0.0.26 lib/selector.rb
traquitana-0.0.25 lib/selector.rb
traquitana-0.0.24 lib/selector.rb
traquitana-0.0.23 lib/selector.rb
traquitana-0.0.22 lib/selector.rb
traquitana-0.0.21 lib/selector.rb
traquitana-0.0.20 lib/selector.rb
traquitana-0.0.19 lib/selector.rb
traquitana-0.0.18 lib/selector.rb
traquitana-0.0.17 lib/selector.rb
traquitana-0.0.16 lib/selector.rb
traquitana-0.0.15 lib/selector.rb
traquitana-0.0.14 lib/selector.rb
traquitana-0.0.13 lib/selector.rb
traquitana-0.0.12 lib/selector.rb