24 April 2014

The Ruby Reflector

Topic

Enumerator

  Source Favicon
By Joey of Global Nerdy 1 year ago.
Email

Enumerable#lazy and Enumerator::Lazy, for (possibly infinite) lazy stream

Enumerator#size and Range#size, for lazy size evaluation

#to_h, which is a new convention for conversion to Hash

Onigmo, which is a new regexp engine (a fork of Oniguruma)

Asynchronous exception handling API

Debug support

DTrace support, which enables run-time diagnosis in production

TracePoint, which is an improved tracing API

Performance improvements

GC optimization by bitmap marking …

globalnerdy.com Read
  Source Favicon
On Ruby News 1 year ago.
Email

Enumerable#lazy and Enumerator::Lazy, for (possibly infinite) lazy stream

Enumerator#size and Range#size, for lazy size evaluation

#to_h, which is a new convention for conversion to Hash

Onigmo, which is a new regexp engine (a fork of Oniguruma)

Asynchronous exception handling API

Debug support

DTrace support, which enables run-time diagnosis in production

TracePoint, which is an improved tracing API

Performance improvements

GC optimization by bitmap marking …

ruby-lang.org Read
  Source Favicon
On Ruby News 1 year ago.
Email

<URL:https://speakerdeck.com/nagachika/rubyist-enumeratorlazy> ( Enumerator::Lazy, in Japanese)

(If you volunteer to provide additional articles, we may cite or refer to them in the next release announcement.)

Notes

Incompatibility

There are three notable incompatibilities we know of:

The default encoding for ruby scripts is now UTF-8 [#6679] . Some people report that it affects existing programs, such as some benchmark programs becoming very slow [ruby-dev:46547] …

ruby-lang.org Read
  Source Favicon
By Tom Ward of Tom Ward over 1 year ago.
Email

…# select never returned. If instead of using # select we use a new Enumerator to do our selecting, we can work around this:

odd_squares = Enumerator . new do | yielder | squares . each do | square | yielder . yield square if ( square % 2 == 1 ) end end >> odd_squares . take ( 5 ) => [ 1 , 9 , 25 , 49 , 81 ] >> odd_squares . take ( 10 ) => [ 1 , 9 , 25 , 49 , 81 , 121 , 169 , 225 , 289 , 361 ]

Our new Enumerator iterates lazily through our original sequence, yielding …

tomafro.net Read
  Source Favicon
By Peter Cooper of Ruby Inside over 1 year ago.
Email

classy_enum: Class Based Enumerator Gem for Rails

Adds class-based enumerator functionality to ActiveRecord attributes.

Hamster: Efficient, Immutable, Thread-Safe Collection Classes

Rubyception: A Realtime Rails Log in Your Browser

Add Rubyception to your Rails project, navigate to /rubyception and get WebSocket-powered live log updates.

Clear Eyes: Automatic Retina Image Handling for Rails 3.1+

Axlsx: Office Open XML

rubyinside.com Read
  Source Favicon
By Gregory Brown of Practicing Ruby 2 years ago.
Email

Keeping with my promise to release content from my Practicing Ruby journal , I've put together a massive link dump of articles from its second volume. Please enjoy them and share them with your friends.

Issue 2.1: Ways to load code

Issue 2.2: How to attack sticky problems

Issue 2.3: A closure is a double edged sword

Issue 2.4: Implementing Enumerable & Enumerator in Ruby

Issue 2.5: Thoughts on regression testing

Issue 2.6: Learning new things step-by-step

blog.rubybestpractices.com Read
  Source Favicon
By Gregory Brown of Practicing Ruby over 2 years ago.
Email

Issue 2.4: Implementing Enumerable & Enumerator in Ruby

Issue 2.6: Learning new things step-by-step

Issue 2.11: Domain specific API construction

While reading these articles might give you a sense of the quality of the content I've been producing, that's only part of the overall picture. Behind the scenes, you'll find that:

Many of the Practicing Ruby article lead to great conversations among folks who are serious about becoming better …

blog.rubybestpractices.com Read
  Source Favicon
By Erik Andrejko of Rails Illustrated over 1 year ago.
Email

…into memory at once by making use of Ruby's Enumerator class. An Enumerator objects encapsulates the traversal of an enumerable, without performing the complete traversal . Thus, by using an Enumerator we can express the loading of the file in a functional way, without loading the file all at once into an Array at the very first step.

It is easy to construct an Enumerator for many of the methods defined in the Enumerable module using the enum_for method: [:a, :b, :c].enum_for(:reject) …

railsillustrated.com Read
  Source Favicon
By Iain Hecker of Adventures with Ruby 4 years ago.
Email

…And you can use it in any object, not just inside views. And lets add some extra arguments and some Enumerator -love too:

In case you are wondering, the position you can specify is to tell where the arguments need to go. Position 0 is the method name, so you shouldn't use that, but any other value is okay. An example might be that you cant to wrap an array of texts into span-tags:

So there you have it. I'm probably solving a problem that doesn't exist. It is however a nice …

iain.nl Read
  Source Favicon
By iain hecker of Adventures with Ruby 4 years ago.
Email

…And you can use it in any object, not just inside views. And lets add some extra arguments and some Enumerator -love too: class SomeClass include ProcProxyHelper def initialize (name, list) @ name , @ list = name, list end def apply (value, index, seperator) " #{ @ name } , #{ index } #{ separator } #{ value } " end def applied_list @ list .map.with_index(&it.apply( " : " )) end end

In case you are wondering, the position you can specify is to tell …

iain.nl Read