class RuboCop::MagicComment::EmacsComment
Wrapper for Emacs style magic comments.
@example Emacs style comment
comment = RuboCop::MagicComment.parse( '# -*- encoding: ASCII-8BIT -*-' ) comment.encoding # => 'ascii-8bit'
@see www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html @see git.io/vMCXh Emacs handling in Ruby's parse.y
Constants
- FORMAT
- OPERATOR
- SEPARATOR
Public Instance Methods
encoding()
click to toggle source
# File lib/rubocop/magic_comment.rb, line 135 def encoding match('encoding') end
Private Instance Methods
extract_frozen_string_literal()
click to toggle source
# File lib/rubocop/magic_comment.rb, line 141 def extract_frozen_string_literal match('frozen_string_literal') end