Socket
Book a DemoInstallSign in
Socket

magic-comment

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

magic-comment

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

Magic Comment

Magic Comment is a little tool that allows you to quickly add or modify the magic comments that indicate source file encoding for an entire directory structure, please note that this tool only sets the comments, and does not perform any file encoding conversion whatsoever.

If you are looking for a way to convert files to a specific encoding, check out iconv (GNU)

I originally wrote this to get rid of "invalid multibyte char (US-ASCII)" errors when writing strings containing non ascii characters like éöàüèä in ruby on rails controllers

Installation

gem install magic-comment

Usage

you can pass the path to where you want the tool to run.

magic-comment [path1 [path2 ...]]

this will prepend every ".rb", ".rake" and ".haml" file in the working directory (recursively) with the following line :

# coding: utf-8

Notes :

  • existing magic comments are replaced
  • the rest of the file remains unchanged

FAQs

Package last updated on 12 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.