Sha256: 8689ab279150731ea4a59a24a90debc53c21f2d44fd95120b9f6c66673f6f3a0

Contents?: true

Size: 746 Bytes

Versions: 6

Compression:

Stored size: 746 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(...) = new(...).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

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.16.1 lib/rubysmith/builders/pragma.rb
rubysmith-0.16.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.15.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.14.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.13.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.12.0 lib/rubysmith/builders/pragma.rb