Comments (2)
Hi @shoutsid! Great to hear from you.
You should check out the token-parsing
branch, which should fix the problem. Basically, the master branch uses the old parsing method, which loads the Gemfile and hijacks the method calls to try and work out how to piece it all back together again, but some information gets lost (e.g. comments, the position of original code fragments, etc). The token-parsing
branch splits the Gemfile up into tokens and can keep the exact position of the original tokens.
It's not perfect, hence why I haven't merged it into master. It works for 99% of cases, but if you had some unusual but perfectly valid syntax in your Gemfile then it would throw a wobbler. I've got a plan to implement a better parser soon, just need a bit of time ;)
I'll keep this issue open until I can get something working and release a new gem, because it's technically valid for the most recent version.
Thanks
from pessimize.
Hi again @shoutsid,
This has been fixed in version 0.2.0 and even more fixed (hehe) in the very latest version 0.3.0.
This version should keep the Gemfile syntax exactly the same, but insert or replace versions as expected.
Thanks
from pessimize.
Related Issues (20)
- Correctly handle `beta` and `pre` gems HOT 2
- Option to use single quote HOT 1
- Support inline comments HOT 1
- Parser stops after comment
- Downgrades my gems HOT 3
- "rubygems explanation" link is broken HOT 2
- No newline between some statements in output HOT 3
- rake spec fails HOT 1
- Option to unpessimize
- trollop no longer supported HOT 1
- Running pessimize after fresh install, undefined method `[]' for nil:NilClass
- Maybe it should be a Bundler plugin?
- Feature idea: take the more pessimistic version
- Multiple sources in gemfile. HOT 1
- Use an actual ruby parser to parse the Gemfile HOT 5
- License missing from gemspec HOT 4
- Use Bundler's Gemfile.lock parser
- Pessimize generates overly restrictive requirements HOT 3
- Strange Behaviour HOT 8
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 pessimize.