Sha256: d3a4027a458b41697f6efd66b77088ee0d96ec43435cdd6502274c57ff116b03

Contents?: true

Size: 546 Bytes

Versions: 28

Compression:

Stored size: 546 Bytes

Contents

module Pact
  module Support
    module ExpandFileList
      def self.call pact_files
        pact_files
          .collect{ |path| unixify_path(path) }
          .collect{ | path | expand_path(path) }
          .flatten
      end

      def self.unixify_path(path)
        path.gsub(/\\+/, '/')
      end

      def self.expand_path(path)
        if File.directory?(path)
          Dir.glob(File.join(path, "*.json"))
        elsif Dir.glob(path).any?
          Dir.glob(path)
        else
          path
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
pact-mock_service-3.12.3 lib/pact/support/expand_file_list.rb
pact-mock_service-3.12.2 lib/pact/support/expand_file_list.rb
pact-mock_service-3.12.1 lib/pact/support/expand_file_list.rb
pact-mock_service-3.12.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.11.2 lib/pact/support/expand_file_list.rb
pact-mock_service-3.11.1 lib/pact/support/expand_file_list.rb
pact-mock_service-3.11.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.10.0 lib/pact/support/expand_file_list.rb
hs-pact-mock_service-3.9.2 lib/pact/support/expand_file_list.rb
pact-mock_service-3.9.1 lib/pact/support/expand_file_list.rb
pact-mock_service-3.9.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.8.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.7.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.6.2 lib/pact/support/expand_file_list.rb
pact-mock_service-3.6.1 lib/pact/support/expand_file_list.rb
pact-mock_service-3.6.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.5.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.4.0 lib/pact/support/expand_file_list.rb
pact-mock_service-3.3.1 lib/pact/support/expand_file_list.rb
pact-mock_service-3.3.0 lib/pact/support/expand_file_list.rb