Sha256: 7b6d4ddfac2d169671aa88f37b1a831ab791bb2fa996b52d4affa607bd03e211
Contents?: true
Size: 981 Bytes
Versions: 3
Compression:
Stored size: 981 Bytes
Contents
# frozen_string_literal: true require "rubocop" require "refinements/ios" module Rubysmith module Builders # Builds project skeleton Rubocop code quality support. class Rubocop using Refinements::IOs def self.call realm, builder: Builder new(realm, builder: builder).call end def initialize realm, builder: Builder, runner: RuboCop::CLI.new @realm = realm @builder = builder @runner = runner end def call return unless realm.build_rubocop builder.call(realm.with(template_path: "%project_name%/bin/rubocop.erb")) .render .permit 0o755 builder.call(realm.with(template_path: "%project_name%/.rubocop.yml.erb")).render auto_correct end private attr_reader :realm, :builder, :runner def auto_correct STDOUT.squelch { runner.run ["--auto-correct", realm.project_root.to_s] } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rubysmith-0.5.0 | lib/rubysmith/builders/rubocop.rb |
rubysmith-0.4.0 | lib/rubysmith/builders/rubocop.rb |
rubysmith-0.3.0 | lib/rubysmith/builders/rubocop.rb |