Class: RuboCop::MagicComment::VimComment
- Inherits:
-
EditorComment
- Object
- RuboCop::MagicComment
- EditorComment
- RuboCop::MagicComment::VimComment
- Defined in:
- lib/rubocop/magic_comment.rb
Overview
Wrapper for Vim style magic comments.
Constant Summary collapse
- FORMAT =
/#\s*vim:\s*(.+)/.freeze
- SEPARATOR =
', '
- OPERATOR =
'='
Constants inherited from RuboCop::MagicComment
Instance Method Summary collapse
-
#encoding ⇒ Object
For some reason the fileencoding keyword only works if there is at least one other token included in the string.
-
#frozen_string_literal ⇒ Object
Vim comments cannot specify frozen string literal behavior.
-
#shareable_constant_value ⇒ Object
Vim comments cannot specify shareable constant values behavior.
Methods inherited from RuboCop::MagicComment
#any?, #encoding_specified?, #frozen_string_literal?, #frozen_string_literal_specified?, #initialize, parse, #shareable_constant_value_specified?, #valid_literal_value?, #valid_shareable_constant_value?
Constructor Details
This class inherits a constructor from RuboCop::MagicComment
Instance Method Details
#encoding ⇒ Object
For some reason the fileencoding keyword only works if there is at least one other token included in the string. For example
# works
# vim: foo=bar, fileencoding=ascii-8bit
# does nothing
# vim: foo=bar, fileencoding=ascii-8bit
195 196 197 |
# File 'lib/rubocop/magic_comment.rb', line 195 def encoding match('fileencoding') if tokens.size > 1 end |
#frozen_string_literal ⇒ Object
Vim comments cannot specify frozen string literal behavior.
200 |
# File 'lib/rubocop/magic_comment.rb', line 200 def frozen_string_literal; end |
#shareable_constant_value ⇒ Object
Vim comments cannot specify shareable constant values behavior.
203 |
# File 'lib/rubocop/magic_comment.rb', line 203 def shareable_constant_value; end |