Class: Tapioca::RBIFormatter
- Inherits:
-
RBI::Formatter
- Object
- RBI::Formatter
- Tapioca::RBIFormatter
- Defined in:
- lib/tapioca/rbi_formatter.rb
Instance Method Summary collapse
-
#write_empty_body_comment!(file) ⇒ Object
: (RBI::File file) -> void.
-
#write_header!(file, command, reason: nil) ⇒ Object
: (RBI::File file, String command, ?reason: String?) -> void.
Instance Method Details
#write_empty_body_comment!(file) ⇒ Object
: (RBI::File file) -> void
16 17 18 19 20 |
# File 'lib/tapioca/rbi_formatter.rb', line 16 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#manually-requiring-parts-of-a-gem") end |
#write_header!(file, command, reason: nil) ⇒ Object
: (RBI::File file, String command, ?reason: String?) -> void
7 8 9 10 11 12 13 |
# File 'lib/tapioca/rbi_formatter.rb', line 7 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}`.") # Prevent the header from being attached to the top-level node when generating YARD docs file.comments << RBI::BlankLine.new end |