Sha256: 9cb62f5df217e26f0aeb46a65a256777ff0187191cdd03ee23ca26c30e684954

Contents?: true

Size: 439 Bytes

Versions: 9

Compression:

Stored size: 439 Bytes

Contents

require 'opal/hike_path_finder'

module Opal
  class PathReader
    def initialize(file_finder = HikePathFinder.new)
      @file_finder = file_finder
    end

    def read(path)
      full_path = expand(path)
      return nil if full_path.nil?
      File.read(full_path)
    end

    def expand(path)
      file_finder.find(path)
    end

    def paths
      file_finder.paths
    end


    private

    attr_reader :file_finder
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
opal-0.7.2 lib/opal/path_reader.rb
opal-0.7.1 lib/opal/path_reader.rb
opal-0.7.0 lib/opal/path_reader.rb
opal-0.7.0.rc1 lib/opal/path_reader.rb
opal-0.7.0.beta3 lib/opal/path_reader.rb
opal-0.7.0.beta2 lib/opal/path_reader.rb
opal-cj-0.7.0.beta2 lib/opal/path_reader.rb
opal-cj-0.7.0.beta1 lib/opal/path_reader.rb
opal-0.7.0.beta1 lib/opal/path_reader.rb