Sha256: b35a3204a6a5a6ef71f118cbe6fcf975d7e7e11d51c523b11871eec005b28363

Contents?: true

Size: 373 Bytes

Versions: 3

Compression:

Stored size: 373 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'pathname'
module Pacto
  class ContractFiles
    def self.for(path)
      full_path = Pathname.new(path).realpath

      if  full_path.directory?
        all_json_files = "#{full_path}/**/*.json"
        Dir.glob(all_json_files).map do |f|
          Pathname.new(f)
        end
      else
        [full_path]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pacto-0.4.0.rc3 lib/pacto/contract_files.rb
pacto-0.4.0.rc2 lib/pacto/contract_files.rb
pacto-0.4.0.rc1 lib/pacto/contract_files.rb