Class: Rubysmith::Extensions::Pragmater
- Inherits:
-
Object
- Object
- Rubysmith::Extensions::Pragmater
- Defined in:
- lib/rubysmith/extensions/pragmater.rb
Overview
Ensures project skeleton has pragmas.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration, client: ::Pragmater::Inserter.new) ⇒ Pragmater
constructor
A new instance of Pragmater.
Constructor Details
#initialize(configuration, client: ::Pragmater::Inserter.new) ⇒ Pragmater
Returns a new instance of Pragmater.
21 22 23 24 |
# File 'lib/rubysmith/extensions/pragmater.rb', line 21 def initialize configuration, client: ::Pragmater::Inserter.new @configuration = configuration @client = client end |
Class Method Details
.call ⇒ Object
12 |
# File 'lib/rubysmith/extensions/pragmater.rb', line 12 def self.call(...) = new(...).call |
.custom_configuration ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rubysmith/extensions/pragmater.rb', line 14 def self.custom_configuration ::Pragmater::Configuration::Model[ comments: ["# frozen_string_literal: true"], patterns: %w[**/*.rake **/*.rb *.gemspec exe/* bin/* config.ru *file] ] end |
Instance Method Details
#call ⇒ Object
26 27 28 29 |
# File 'lib/rubysmith/extensions/pragmater.rb', line 26 def call configuration.project_root.change_dir { client.call self.class.custom_configuration } configuration end |