Sha256: cf7869ff555f11cf65fdda6545e26e7a7ab9483a1b92596cc45e7de2247c7aef

Contents?: true

Size: 880 Bytes

Versions: 23

Compression:

Stored size: 880 Bytes

Contents

# typed: strict
# frozen_string_literal: true

class GitAttributes
  class << self
    extend T::Sig

    sig { params(path: Pathname).void }
    def create_generated_attribute_file(path)
      create_gitattributes_file(path, <<~CONTENT)
        **/*.rbi linguist-generated=true
      CONTENT
    end

    sig { params(path: Pathname).void }
    def create_vendored_attribute_file(path)
      create_gitattributes_file(path, <<~CONTENT)
        **/*.rbi linguist-vendored=true
      CONTENT
    end

    private

    sig { params(path: Pathname, content: String).void }
    def create_gitattributes_file(path, content)
      # We don't want to start creating folders, just to write
      # the `.gitattributes` file. So, if the folder doesn't
      # exist, we just return.
      return unless path.exist?

      File.write(path.join(".gitattributes"), content)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tapioca-0.16.4 lib/tapioca/helpers/git_attributes.rb
tapioca-0.16.3 lib/tapioca/helpers/git_attributes.rb
tapioca-0.16.2 lib/tapioca/helpers/git_attributes.rb
tapioca-0.16.1 lib/tapioca/helpers/git_attributes.rb
tapioca-0.16.0 lib/tapioca/helpers/git_attributes.rb
tapioca-0.15.1 lib/tapioca/helpers/git_attributes.rb
tapioca-0.15.0 lib/tapioca/helpers/git_attributes.rb
tapioca-0.14.4 lib/tapioca/helpers/git_attributes.rb
tapioca-0.14.3 lib/tapioca/helpers/git_attributes.rb
tapioca-0.13.3 lib/tapioca/helpers/git_attributes.rb
tapioca-0.13.2 lib/tapioca/helpers/git_attributes.rb
tapioca-0.13.1 lib/tapioca/helpers/git_attributes.rb
tapioca-0.13.0 lib/tapioca/helpers/git_attributes.rb
tapioca-0.12.0 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.17 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.16 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.15 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.14 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.13 lib/tapioca/helpers/git_attributes.rb
tapioca-0.11.12 lib/tapioca/helpers/git_attributes.rb