Sha256: 59573b45935b90ea545664c653313f06e35fa255ed024a20c034fdfe160de748
Contents?: true
Size: 477 Bytes
Versions: 3
Compression:
Stored size: 477 Bytes
Contents
# frozen_string_literal: true require 'pathname' # TODO: maybe just extend pathname if you have to module Spellr class File < Pathname def self.wrap(file) file.is_a?(Spellr::File) ? file : Spellr::File.new(file) end def hashbang @hashbang ||= begin return if extname != '' return unless first_line&.start_with?('#!') first_line end end def first_line @first_line ||= each_line.first end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spellr-0.5.0 | lib/spellr/file.rb |
spellr-0.4.1 | lib/spellr/file.rb |
spellr-0.4.0 | lib/spellr/file.rb |