可以在项目所有 Ruby 文件的顶部添加 '# frozen_string_literal: true' 注释
可以在项目所有 Ruby 文件的顶部添加 '# frozen_string_literal: true' 注释
= Magic_frozen_string_literal
Magic_frozen_string_literal is a little tool that allows you to quickly add the magic comment that indicates that the file can safely have its string literals frozen, as will be {the default in Ruby 3.0}[https://bugs.ruby-lang.org/issues/8976].
Cloned from https://github.com/m-ryan/magic_encoding
== Installation
gem install magic_frozen_string_literal rbenv rehash
== Usage
Run the tool from the command line:
magic_frozen_string_literal
this will prepend every ".rb", ".ru", "Rakefile", ".rake", "Gemfile", ".gemspec", ".rabl", ".jbuilder", ".haml", ".slim" file in the given (recursively) with the following magic comment followed by a blank line:
(".haml" and ".slim" files will have a "-" prefix before the comment and no blank line after.)
The parameter is optional. It defaults to the current working directory.
Notes:
暂无开放 Issues,或尚未同步最近议题。