Class: Pragmater::Inserter
- Inherits:
-
Object
- Object
- Pragmater::Inserter
- Defined in:
- lib/pragmater/inserter.rb
Overview
Inserts pragma comments.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(parser: Parsers::File.new) ⇒ Inserter
constructor
A new instance of Inserter.
Constructor Details
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/pragmater/inserter.rb', line 17 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: :insert).join end end |