Comments (5)
@dannguyen I just tried to run it on 1.9 and it won't work. Looks like it uses named arguments.
from database_rewinder.
I know that it's technically not that difficult to rewrite my code here to work under 1.9.
Just replace kwargs with AS extract_options, Module#prepend with AMC, then we will obtain 1.9 compatibility (in exchange for a bit of readability IMO).
And your patches welcome.
However, I'm sure I sooner or later will break the compatibility again since I do no more use 1.9 personally.
I usually live on 2.1, and sometimes switch back to stable 2.0, but do never willingly do rbenv use 1
.
So now let ME ask you a question.
Is there any good (or inevitable) reason for your to stay on Ruby version one?
I guess it's much easier to migrate YOUR code to Ruby 2 than to keep maintaining my code compatibility forever, in terms of the greatest happiness of the greatest number of programmers. Isn't it?
from database_rewinder.
As you state yourself, the regression from introducing 1.9-compatible-code would be a loss in readability. Is that a worthwhile tradeoff for lower adoption? That's only something that should matter to you, the author, as it's your time, your labor of love, etc.
However, it is not realistic to expect everyone to migrate to 2.x. It's not always up to an individual coder. For my situation, I could probably upgrade some existing projects to 2.x without too much trouble. But think of the situation here. Your library is a replacement for database_cleaner...both libraries are very helpful and make coding more of a joy, so that in itself is a credit to you and should be credit enough. However, it is not an essential library in the same way that Rails is. Or any of the SQL wrappers...if those required an immediate move to 2.x, then I'd probably make that change (as long as the migration/bug-checking time was manageable). But I couldn't justify the jump in versions just to have a faster database cleaner, because while database_rewinder might make life more enjoyable in the testing phase, it may not be worth the pain it makes elsewhere.
I don't know enough about database_rewinder's code or about Ruby 2.x to make any judgment on how sticking to 1.9 will stunt its potential. But I would take the bet that compatibility with 1.9, if it could be done without a loss in current features, would most undoubtedly impact a greater number of programmers than sticking to just 2.x. Not just now, but in the future -- it's reasonable to assume that when 1.9 is no longer supportable by database_cleaner, its maintainer will have long fixed it for 2.x, and everyone who has been using it throughout 1.9 will stay with it.
But that's not reason enough for you to change your path, obviously, I was just making that observation. Now's the time where you say, "Well just fork it!"...and I just might when I get some time...just wanted to get a quick understanding of what the scope and need was. Thanks for writing the library! :)
from database_rewinder.
Personally, I was testing it for use on a company application that is stuck - for now - on 1.9.x - although we are working on a 2.0 migration. If it provides a nice speedup on 2.0 we'll probably use it then. I don't necessarily think there's a need to back-port it.
If I get really antsy, maybe I'll try my hand at it in a fork. :)
from database_rewinder.
I hope there's nobody still using ruby 1.x.
from database_rewinder.
Related Issues (20)
- Using multiple connections HOT 3
- Minitest + capybara + fixtures compatibility? HOT 2
- Share solution HOT 3
- retain existing data in tables HOT 1
- Object's created in before(:all) are removed HOT 2
- Support activerecord-import gem HOT 1
- postgresql error HOT 5
- [BUG REPORT] NoMethodError: undefined method `query' for nil:NilClass HOT 5
- 0.7.0 foreign key error occurred HOT 4
- 0.7.1 my test started freezing HOT 4
- Tables created in complex queries are not cleaned HOT 2
- Database Support Outside Postgres? HOT 2
- Use append_after instead of append?
- Support for Rails Engines HOT 1
- New release with Rails 5.1 support? HOT 1
- Can't delete referenced records on Heroku CI HOT 1
- Support for Rails 6.1.0 HOT 2
- Incompatible with multiverse gem after upgrading to v0.9.6 (assumption) HOT 3
- No tables are cleaned in Rails 7 + MySQL HOT 2
- `DatabaseRewinder.clean_all` is not working at rails 7.1.0 HOT 6
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 database_rewinder.