elomarns / auto-encoding-for-ruby Goto Github PK
View Code? Open in Web Editor NEWSublime Text 2 plugin to automatically include #encoding: utf-8 on Ruby files when needed.
Sublime Text 2 plugin to automatically include #encoding: utf-8 on Ruby files when needed.
When I manually remove inserted header, plugin automated adds them again. I think, this is bad behaviour.
Plugin must add header only once, and not after manual deleting header by user.
WRONG: #encoding: utf-8
RIGHT: # coding: utf-8
http://stackoverflow.com/questions/6444826/ruby-utf-8-file-encoding
Hi :)
I guess the plugin is not ST3 compatible as i cannot find it with the package manager anymore?
Greetings,
sdepold
It would be nice to have a config option to switch off removal of the encoding comment.
When I search for the package in package control, it doesn't come up.
I presume it is because I am using Sublime Text 3. When will this be available for ST3?
"RSpec" is a diffirent syntax from "Ruby" in ST2, so the plugin does not seem to work with RSpec files at all.
Maybe keep a list of supported syntaxes somewhere?
Thank you for a nice plugin. Unfortunately, it isn't really usable with Rails at this moment.
The syntax for Haml is called "Ruby Haml", and the "# encoding" has a completely different meaning in haml. I'd suggest it to detect some keywords for alternative syntaxes like Haml and RSpec (from #1), and only fall back to plain Ruby if it couldn't find those keywords. Or maybe you should just hardcode a list of syntax names and magic header types to avoid further accidental breakage.
The plugin inserts the encoding stanza at the top, regardless of whether there exists a shebang line
#!/bin/ruby
or similar, which needs to be on the first line (encoding stanza just below works at least in ruby 1.9.3).
I can't seem to get this package to work at all in ST3.
Plugin adds encoding headers in SLIM templates too. Encoding header don't needed in templates.
In my opinion, calling handle_encoding_declaration_on
should only be called on save, that is, change from on_modified
to on_pre_save
. I don't like how my text file changes while I am writing.
Maybe this can be configurable?
Nice package! Here is a suggestion to make it better:
I use this declaration in the top of my files:
# -*- encoding : utf-8 -*-
instead of
#encoding: utf-8
So when I use this package I end up with double declarations. Maybe the style of the declaration could be make configurable?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.