Sha256: 60a36ac82b23d4979fd8b681bc8c53f196fc3ad647fdc12aa54955f3e2c5a926

Contents?: true

Size: 953 Bytes

Versions: 28

Compression:

Stored size: 953 Bytes

Contents

# 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.new
        @configuration = configuration
        @client = client
        @content = content
      end

      def call = client.call(settings) && configuration

      private

      attr_reader :configuration, :client, :content

      def settings
        content.merge(action_insert: true, root_dir: configuration.project_root)
               .transmute! configuration,
                           comments: :extensions_pragmater_comments,
                           includes: :extensions_pragmater_includes
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rubysmith-4.9.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.8.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.7.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.6.1 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.6.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.5.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.4.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.3.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.2.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.1.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.0.1 lib/rubysmith/extensions/pragmater.rb
rubysmith-4.0.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.8.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.7.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.6.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.5.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.4.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.3.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.2.0 lib/rubysmith/extensions/pragmater.rb
rubysmith-3.1.0 lib/rubysmith/extensions/pragmater.rb