Comments (3)
On line 71 in import-js/ruby/import-js/importer.rb
there are some method calls that are split onto separate lines. I assume my version of Ruby doesn't like that syntax - when I moved those methods all onto one line the error went away.
Edit: Support for newlines after method calls was added in Ruby 1.9 so my Vim installation must be using an old version of Ruby.
@trotzig Moving the placement of the dot makes this backwards compatible with old Ruby versions, like so:
70 string.
71 gsub(/::/, '/').
72 gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
73 gsub(/([a-z\d])([A-Z])/, '\1_\2').
74 tr('-', '_').
75 downcase
However, this Ruby styleguide recommends keeping the dot as the prefix rather than placing it at the end like this. I agree that the 1.9 syntax is more readable.
Options:
- Update the
README
to expect users to have Ruby 1.9+ when using this plugin. - Move to the old syntax and support older versions of Ruby.
I'll submit pull requests for each option.
from import-js.
It looks like you can use the commands :echo has('ruby')
and :ruby puts RUBY_VERSION
to inspect whether Vim has Ruby set up and what version it's running.1
Mine is using '1.8.7' which is probably just the system default. I'm going to try and set it to one of the more recent versions.
from import-js.
Closed by 0cd733e
from import-js.
Related Issues (20)
- Support for jsconfig.json HOT 7
- Option to import with double quotes instead of single quotes HOT 2
- Lodash alias doesn't work HOT 3
- groupImports ends up grouping namedExports separately. HOT 1
- Import maps HOT 2
- active forks HOT 3
- Unable to import files when using smart pipeline operator HOT 5
- Fails to install: node-pre-gyp? HOT 4
- when i move a personal module file to an other folder, the import suggestion of the personal module propose the old folder and the new folder HOT 2
- Config file can't be loaded inside an ES Module project HOT 1
- Move away from Flow? HOT 14
- Move to Prettier, abandon ESlint HOT 4
- Cleaning up stale issues & PRs HOT 2
- Abandon old node versions, update test matrix HOT 2
- React Imports on JSX HOT 1
- Reintroduce some ESlint rules
- Better schema validation errors
- Auto-generate configuration documentation
- Add plugin support HOT 2
- Missing CODECLIMATE_REPO_TOKEN for Github Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-js.