Sha256: a4d41010fcabcaf6f4074c0baeb9cf0ff247f18422f8c6f5d6f730644f1d3c20
Contents?: true
Size: 568 Bytes
Versions: 8
Compression:
Stored size: 568 Bytes
Contents
# frozen_string_literal: true require "refinements/pathname" module Pragmater # Removes pragma comments. class Remover include Import[:settings] using Refinements::Pathname def initialize(parser: Parsers::File.new, **) @parser = parser super(**) end def call Pathname(settings.root_dir).files("{#{settings.patterns.join ","}}").map do |path| yield path if block_given? path.write parser.call(path, settings.comments, action: :remove).join end end private attr_reader :parser end end
Version data entries
8 entries across 8 versions & 1 rubygems