Sha256: 370229cae60b9e6a97f6e3a102225dd4c462bcd64e226e6122728a24afda8c9c
Contents?: true
Size: 628 Bytes
Versions: 8
Compression:
Stored size: 628 Bytes
Contents
# frozen_string_literal: true require "refinements/pathnames" module Pragmater # Adds/removes pragma comments for files in given path. class Runner using Refinements::Pathnames def self.for **attributes new Context[attributes] end def initialize context, parser: Parsers::File.new @context = context @parser = parser end def call Pathname(context.root_dir).files("{#{context.includes.join ","}}").map do |path| path.write parser.call(path, context.comments, action: context.action).join end end private attr_reader :context, :parser end end
Version data entries
8 entries across 8 versions & 1 rubygems