Sha256: 37fd1c7d7da386cbbd7b8cd7d452179b639ebfaf131128019082ec60c8eface8

Contents?: true

Size: 256 Bytes

Versions: 9

Compression:

Stored size: 256 Bytes

Contents

# frozen_string_literal: true

module Polariscope
  class FileContent < String
    class << self
      def for(path)
        file_path = File.join(Dir.pwd, path)

        File.exist?(file_path) ? new(File.read(file_path)) : new
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
polariscope-0.6.0 lib/polariscope/file_content.rb
polariscope-0.5.0 lib/polariscope/file_content.rb
polariscope-0.4.0 lib/polariscope/file_content.rb
polariscope-0.3.0 lib/polariscope/file_content.rb
polariscope-0.2.0 lib/polariscope/file_content.rb
polariscope-0.1.3 lib/polariscope/file_content.rb
polariscope-0.1.2 lib/polariscope/file_content.rb
polariscope-0.1.1 lib/polariscope/file_content.rb
polariscope-0.1.0 lib/polariscope/file_content.rb