How does the magic comment in ruby works? I am talking about:
# Encoding: utf-8
Is this a preprocessing directive? Are there other uses o
As you noted, magic comments are a special preprocessing construct. They must be defined at the top of the file (except, if there is already a unix shebang at the top). As of Ruby 2.3 there are three kinds of magic comments:
frozen_string_literal: true
: Freezes all string literals in the current filewarn_indent: true
: Activates indentation warnings for the current fileMore info: Magic Instructions