Sha256: 7f828c4e91ab947f7602e33edeb6aac81d542f8eb758b6e3aff6b933249bb5c9

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

# frozen_string_literal: true

require "pragmater"

module Rubysmith
  module Builders
    # Builds project skeleton pragmas so all Ruby strings are frozen by default.
    class Pragma
      def self.call(configuration) = new(configuration).call

      def initialize configuration, client: Pragmater::Runner
        @configuration = configuration
        @client = client
      end

      def call = client.for(**attributes).call && nil

      private

      attr_reader :configuration, :client

      def attributes
        {
          action: :insert,
          root_dir: configuration.project_root,
          comments: configuration.builders_pragmater_comments,
          includes: configuration.builders_pragmater_includes
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubysmith-0.11.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.10.0 lib/rubysmith/builders/pragma.rb