Sha256: 5c1ef6496383e42787572f9d4b3ce29b81472333a28906615215c525e9ce77a4

Contents?: true

Size: 646 Bytes

Versions: 6

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

require "rubocop"
require "refinements/ios"

module Rubysmith
  module Builders
    module Rubocop
      # Executes Rubocop auto-correct on newly generated project.
      class Formatter
        using Refinements::IOs

        def self.call realm
          new(realm).call
        end

        def initialize realm, client: RuboCop::CLI.new
          @realm = realm
          @client = client
        end

        def call
          STDOUT.squelch { client.run ["--auto-correct", realm.project_root.to_s] }
          nil
        end

        private

        attr_reader :realm, :client
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.9.1 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.9.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.8.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.7.0 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.6.1 lib/rubysmith/builders/rubocop/formatter.rb
rubysmith-0.6.0 lib/rubysmith/builders/rubocop/formatter.rb