Class: Tapioca::RBIFormatter

Inherits:
RBI::Formatter
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/tapioca/rbi_formatter.rb

Instance Method Summary collapse

Instance Method Details

#write_empty_body_comment!(file) ⇒ Object



22
23
24
25
26
# File 'lib/tapioca/rbi_formatter.rb', line 22

def write_empty_body_comment!(file)
  file.comments << RBI::BlankLine.new unless file.comments.empty?
  file.comments << RBI::Comment.new("THIS IS AN EMPTY RBI FILE.")
  file.comments << RBI::Comment.new("see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires")
end

#write_header!(file, command, reason: nil) ⇒ Object



15
16
17
18
19
# File 'lib/tapioca/rbi_formatter.rb', line 15

def write_header!(file, command, reason: nil)
  file.comments << RBI::Comment.new("DO NOT EDIT MANUALLY")
  file.comments << RBI::Comment.new("This is an autogenerated file for #{reason}.") unless reason.nil?
  file.comments << RBI::Comment.new("Please instead update this file by running `#{command}`.")
end