News for hackers. Stuff that matters.
Re:Ruby 2.1.0 preview1 released by mmanfrin on Monday September 23, 2013 @02:24AM (#6429421)
From the link:

The notable changes are:

* VM (method cache)

* RGenGC

* refinements

* syntax

* Decimal Literal

* Frozen String Literal

* def's return value

* Bignum

* 128bit

* GMP

* String#scrub

* Socket.getifaddrs

* new Rubygem

Re:Ruby 2.1.0 preview1 released by riffraff on Monday September 23, 2013 @02:26AM (#6429427)
I think def's return value means returning symbol rather than nil? I've been waiting for it for ten years, I had almost forgotten why I wanted it in the first place :)
Re:Ruby 2.1.0 preview1 released by _anshulk on Monday September 23, 2013 @02:41AM (#6429453)
So, this would mean that

private def foo

end

will now work?

Re:Ruby 2.1.0 preview1 released by invisiblefunnel on Monday September 23, 2013 @02:56AM (#6429475)
Re:Ruby 2.1.0 preview1 released by transfire on Monday September 23, 2013 @05:29AM (#6429781)
Yes. And it is somewhat surprising. Matz must have rejected this idea a dozen times. It was certainly one of the oldest feature requests around. Hard to imagine what must have changed his mind. I've rarely seem Matz change his mind.
Re:Ruby 2.1.0 preview1 released by riffraff on Monday September 23, 2013 @05:09PM (#6434186)
I seem to recall the issue was more with returning UnboundMethod objects than with symbols, but possibly what's changed is the fact that now symbols can be GCed?
Re:Ruby 2.1.0 preview1 released by charlysisto on Monday September 23, 2013 @08:17AM (#6430304)
Please tell us, what's the use case ?
Re:Ruby 2.1.0 preview1 released by amccloud on Monday September 23, 2013 @01:54PM (#6432802)
Re:Ruby 2.1.0 preview1 released by transfire on Monday September 23, 2013 @12:06PM (#6431899)
It would allow you to do a number things. For instance: `memo def foo` to transform a method into a memoized version.
Re:Ruby 2.1.0 preview1 released by bradgessler on Monday September 23, 2013 @02:48AM (#6429464)
Could somebody elaborate on "new Rubygem"?

I remember reading a while back that Ruby was going to make an effort to separate stdlib components from the language, which I think is pretty exciting.

The more boring side of this would be a newer version of RubyGems.

Re:Ruby 2.1.0 preview1 released by gnufied on Monday September 23, 2013 @03:02AM (#6429483)
Changelog just means newer version of Rubygems, but with following new features:

1. Rubygems now has a dependency resolution mechanism similar to Bundler.

2. Rubygems has something called StubSpecification which means that complete gemspec of all the gems need not be loaded when using rubygems now. The idea is, we just need dependency from gemspec. Author name, URL etc are irrelevant details which used to get loaded before. So this should make it bit lightweight.

Re:Ruby 2.1.0 preview1 released by chrislaco on Monday September 23, 2013 @09:48AM (#6430823)
"Rubygems now has a dependency resolution mechanism similar to Bundler."

That's a shame, because bundler is a fail. Ok, anger aside, if I had a $ for every time json has been a dep resolution blocker on bundle install, or chef, or net-ssh, Id be rich.

Re:Ruby 2.1.0 preview1 released by lobster_johnson on Monday September 23, 2013 @01:56PM (#6432824)
That's not a Bundler fail, that's a gem packaging fail.
Re:Ruby 2.1.0 preview1 released by chrislaco on Monday September 23, 2013 @09:13PM (#6435222)
Yes and no. Yes, the problem is heightened by people specifying version patterns when they probably don't have to.

However, when you get a bundle install conflict error about json, one gem needing a higher version, and one needing a lower version... adding json to _my_ Gemfile/gemspec to fix it when I'm not using json directly is also not the right answer. Sometimes, even that doesn't work at all.

Re:Ruby 2.1.0 preview1 released by lobster_johnson on Monday September 23, 2013 @09:17PM (#6435242)
Still not Bundler's fault -- it can't install both versions. At any rate, versioning is a hard problem.
Re:Ruby 2.1.0 preview1 released by jeltz on Tuesday September 24, 2013 @05:01PM (#6440727)
Even if you could install both, it would not fix anything since only one version can be loaded.
Re:Ruby 2.1.0 preview1 released by regularfry on Monday September 23, 2013 @08:10PM (#6434998)
That's not why this is a shame. This is a shame because given the same Gemfile, bundler and rubygems do different things.