Class: Gemsmith::Generators::Pragma
- Defined in:
- lib/gemsmith/generators/pragma.rb
Overview
Formats pragma comments in source files.
Constant Summary
Constants inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #run ⇒ Object
-
#whitelist ⇒ Object
rubocop:disable Metrics/MethodLength.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Gemsmith::Generators::Base
Class Method Details
.comments ⇒ Object
10 11 12 |
# File 'lib/gemsmith/generators/pragma.rb', line 10 def self.comments ["# frozen_string_literal: true"] end |
Instance Method Details
#run ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/gemsmith/generators/pragma.rb', line 34 def run Pragmater::Runner.new( gem_root, comments: self.class.comments, whitelist: whitelist ).run action: :add end |
#whitelist ⇒ Object
rubocop:disable Metrics/MethodLength
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gemsmith/generators/pragma.rb', line 15 def whitelist %W[ **/*Gemfile **/*Guardfile **/*Rakefile **/*config.ru **/*bin/#{configuration.dig :gem, :name} **/*bin/bundle **/*bin/rails **/*bin/rake **/*bin/setup **/*bin/update **/*bin/yarn **/*.gemspec **/*.rake **/*.rb ] end |