lib/rubysmith/extensions/pragmater.rb in rubysmith-1.1.0 vs lib/rubysmith/extensions/pragmater.rb in rubysmith-1.1.1
- old
+ new
@@ -1,18 +1,21 @@
# frozen_string_literal: true
require "pragmater"
+require "refinements/structs"
module Rubysmith
module Extensions
# Ensures project skeleton has pragmas.
class Pragmater
+ using Refinements::Structs
+
def self.call(...) = new(...).call
def initialize configuration,
client: ::Pragmater::Runner.new,
- content: ::Pragmater::Configuration::Content
+ content: ::Pragmater::Configuration::Content.new
@configuration = configuration
@client = client
@content = content
end
@@ -21,15 +24,13 @@
private
attr_reader :configuration, :client, :content
def settings
- content[
- action_insert: true,
- comments: configuration.extensions_pragmater_comments,
- includes: configuration.extensions_pragmater_includes,
- root_dir: configuration.project_root
- ]
+ content.merge(action_insert: true, root_dir: configuration.project_root)
+ .transmute! configuration,
+ comments: :extensions_pragmater_comments,
+ includes: :extensions_pragmater_includes
end
end
end
end