Sha256: c3cbb9e0686de05bfc610d2467d07ceb34f1dec2fbe10fc045a64a3f7cde673b

Contents?: true

Size: 730 Bytes

Versions: 10

Compression:

Stored size: 730 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 realm
        new(realm).call
      end

      def initialize realm, runner: Pragmater::Runner
        @realm = realm
        @runner = runner
      end

      def call
        runner.for(**attributes).call
        nil
      end

      private

      attr_reader :realm, :runner

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubysmith-0.8.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.7.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.6.1 lib/rubysmith/builders/pragma.rb
rubysmith-0.6.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.5.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.4.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.3.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.2.0 lib/rubysmith/builders/pragma.rb
rubysmith-0.1.1 lib/rubysmith/builders/pragma.rb
rubysmith-0.1.0 lib/rubysmith/builders/pragma.rb