Ryan Davis | 1 Feb 2011 01:18
Gravatar

[ANN] hoe 2.9.0 Released

hoe version 2.9.0 has been released!

* <http://rubyforge.org/projects/seattlerb/>
* <http://seattlerb.rubyforge.org/hoe/>
* <http://seattlerb.rubyforge.org/hoe/Hoe.pdf>
* <http://github.com/jbarnette/hoe-plugin-examples>

Hoe is a rake/rubygems helper for project Rakefiles. It helps you
manage and maintain, and release your project and includes a dynamic
plug-in system allowing for easy extensibility. Hoe ships with
plug-ins for all your usual project tasks including rdoc generation,
testing, packaging, and deployment.

See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed
below.

For extra goodness, see: http://seattlerb.rubyforge.org/hoe/Hoe.pdf

Changes:

### 2.9.0 / 2011-01-31

* 11 minor enhancements:

  * Added Hoe::Package#pkg_path to make package hook writing easier.
  * Added Hoe::Test#test_prelude to allow for code to run before test loading.
  * Added plugin?(name) to allow for easier plugin guarding in hoe spec.
  * Added support for multiple template dirs for sow.
  * Added support for rubygems-test. See http://www.gem-testers.org/
  * Clean up sow a LOT using: include FileUtils::Verbose
(Continue reading)

serialhex | 1 Feb 2011 01:26
Picon
Gravatar

Re: 2011: Which Ruby books have you read? And which would you recommend?

+1 http://rubybestpractices.com/ i'm really enjoying reading this book, the
pdf is a permanent tab in chrome for me.  I'm learning a lot from this book!

i have both the 2nd & 3rd editions of the pickaxe (rb 1.8 & 1.9 resp.
 technically i also have access to the first - online for free)  i love it
for the reference.  i cant seem to get over needing a *physical* book to
turn pages on.  and the fact that i can browse the std lib just by flipping
pages.  linkage: http://pragprog.com/titles/ruby3/programming-ruby-1-9

<http://pragprog.com/titles/ruby3/programming-ruby-1-9>i rather like the
ruby cookbook by o'reilly http://oreilly.com/catalog/9780596523695.  it's
helped me learn a number of things that some people just *assume* you know.
 though i'm sure one can learn alot thats in this book by googling or
looking up source, having this much info at your fingertips is worth the $50
IMO.  unfortunately it dosnt cover ruby 1.9 & if your an experienced
developer it probably wont be much help, but for someone just starting i do
recommend it.

recently i found a book called clever algorithms
http://www.cleveralgorithms.com/ and while it's more aimed toward people
dealing with optimization problems & A.I. all of the example code is written
in ruby (not in a very ruby-ish way, but it's minimalist implementations of
the algorithms).  this book isn't necessarily for everybody, but for those
interested in A.I. & such it's really cool.  AND it's free (print version
~$20).  (this especially rocks cause i found it on my B-day - which was
saturday, and A.I. is my main field of interest, so a ruby book dealing with
A.I. thats free on my B-day... who could pass that up??)

lastly, the book that **REALLY** got me interested in ruby is why's
(poignant) guide to ruby ( http://mislav.uniqpath.com/poignant-guide/ is the
(Continue reading)

Ramsees Rastafa | 1 Feb 2011 02:04
Picon

Date.today.strftime("%A").

Date.today.strftime("%A") returns "Monday", what can I do to get "Lunes"
(in spanish).

Im using Windows 7 with Ruby 1.9.2, my regional settings are set to
"Spanish Mexico".

Thank you.

--

-- 
Posted via http://www.ruby-forum.com/.

Eric Hodel | 1 Feb 2011 02:29
Favicon
Gravatar

[ANN] rubygems-update 1.5.0 Released

rubygems-update version 1.5.0 has been released!

* <http://rubygems.org>
* <http://docs.rubygems.org>
* <http://help.rubygems.org>
* <http://github.com/rubygems>
* <http://rubyforge.org/projects/rubygems>

RubyGems is a package management framework for Ruby.

This gem is an update for the RubyGems software. You must have an
installation of RubyGems before this update can be applied.

See Gem for information on RubyGems (or `ri Gem`)

To upgrade to the latest RubyGems, run:

  $ gem update --system  # you might need to be an administrator or root

See UPGRADING.rdoc for more details and alternative instructions.

-----

NOTE: Ruby 1.9 ships with rubygems and contains a very buggy
"gem-prelude". It is a gem loading system that can interfere with
updating rubygems itself. We do NOT recommend you update to rubygems
1.4 if you're running ruby 1.9.x until we get that sorted out in a
future ruby release.

If you absolutely hate kittens and you _must_ upgrade, you're going to
(Continue reading)

Noah Cutler | 1 Feb 2011 02:34
Picon
Favicon

Re: Ruby & Groovy :: Pros & Cons

Xavier Noria wrote in post #978629:
> On Fri, Jan 28, 2011 at 9:15 PM, Noah Cutler <sit1way <at> hotmail.com>
> wrote:
>
>> Out of curiosity, most Ruby coders likely had experience in other langs
>> before coming to Ruby.  What makes Ruby your preferred lang compared to
>> others you have used?
>
> Ruby is a language I love, but I have no preferred language. I have a
> bias towards general-purpose scripting languages though, did a good
> deal of Perl, and played around with Python for about a year. Reason
> is productivity, one flies implementing solutions to problems in
> scripting languages, and that's my motivation for doing development.
>
> I am restoring dev.rubyonrails.org munging a backup from the wayback
> machine in a mix of shell and Perl. Ruby could serve as well, but I
> have Perl ingrained in my brain for text munging :). Contradiction?
> Heresy? Not at all, my advice is to be fluent in as many languages as
> possible, and to just use them at your will. Don't get too emotional
> about your language choices.
>
> I've doing Ruby almost exclusively since 2005. I do love the language
> of course, but the reason I am doing Ruby is rather practical, I do
> Rails for a living so I better be good at Ruby.

Right, this is what I am coming to realize now, having more tools in the 
toolbox makes not only for a broader skillset, but for a more enjoyable 
programming experience.

As for, "Don't get too emotional about your language choices", if your 
(Continue reading)

Eric Hodel | 1 Feb 2011 02:44
Favicon
Gravatar

Re: [ANN] rubygems-update 1.5.0 Released

On Jan 31, 2011, at 17:29, Eric Hodel wrote:

> NOTE: Ruby 1.9 ships with rubygems and contains a very buggy
> "gem-prelude". It is a gem loading system that can interfere with
> updating rubygems itself. We do NOT recommend you update to rubygems
> 1.4 if you're running ruby 1.9.x until we get that sorted out in a
> future ruby release.

Oops!  I forgot to remove this section from the README before release.  This only applies to 1.4.

RubyGems 1.5 will install on 1.9.2

Jörg W Mittag | 1 Feb 2011 03:05

Re: [ANN] rubygems-update 1.5.0 Released

Eric Hodel wrote:
> On Jan 31, 2011, at 17:29, Eric Hodel wrote:
>> NOTE: Ruby 1.9 ships with rubygems and contains a very buggy
>> "gem-prelude". It is a gem loading system that can interfere with
>> updating rubygems itself. We do NOT recommend you update to rubygems
>> 1.4 if you're running ruby 1.9.x until we get that sorted out in a
>> future ruby release.
> Oops!  I forgot to remove this section from the README before release.  This only applies to 1.4.
> 
> RubyGems 1.5 will install on 1.9.2

Thanks very much. This is great news!

jwm

Jörg W Mittag | 1 Feb 2011 03:15

Re: [ANN] Regex Searching on Arbitrary Sequences

Michael Edgar wrote:
> I've just finished a write-up on an interesting problem: using Ruby's Regexp engine
> to search arbitrary sequences of potentially heterogenous objects. It's based on the
> more specific instance used in Ripper in 1.9. I've packaged it into a gem though it is
> a bit rough around the edges.
> 
> The post can be found here: http://carboni.ca/blog/p/Regex-Search-on-Arbitrary-Sequences
> 
> And the gem can be found here: https://github.com/michaeledgar/object_regex

This is pretty cool. I never understood why pretty much every language
except Erlang artificially restricts Regexps to text. (Erlang also
allows regular-expression-like pattern matching on bit strings.)

Functional languages and increasingly also modern OO languages (e.g.
Newspeak) have structural pattern matching over arbitrary types, but
without the parsing feature of Regexps (alternation, repetition, ...).
Scripting languages have Regexps but only over text strings, not
arbitrary types.

What I *really* would like to see is the union of pattern matching and
Regexps, ranging over arbitrary types. Unfortunately, I don't have the
slightest idea what that would like.

jwm

Josh Cheek | 1 Feb 2011 04:01
Picon
Gravatar

Re: How to know the exit status within at_exit() block?

On Mon, Jan 31, 2011 at 5:09 PM, Iñaki Baz Castillo <ibc <at> aliax.net> wrote:

> Hi, my program invokes "exit true" or "exit false" and I want to catch
> such return code into at_exit() block, but I don't know how to do
> that.
>
> I would like something as:
>
>
> at_exit(exit_status) {
>  puts "exiting with status #{status}"
> }
>
> if SOMETHING
>  exit true
> else
>  exit false
> end
>
>
> Of course I call "exit" from lof of clases/modules under my project so
> I cannot use a local scope variable "status" (and I wouldn't like to
> use a global variable).
>
> Thanks for any suggestion.
>
> --
> Iñaki Baz Castillo
> <ibc <at> aliax.net>
>
(Continue reading)

Gary Wright | 1 Feb 2011 04:10
Picon

Re: why is overloading invalid in ruby.


On Jan 31, 2011, at 2:47 PM, Charles Oliver Nutter wrote:

> On Mon, Jan 31, 2011 at 1:27 PM, Thomas E Enebo <tom.enebo <at> gmail.com> wrote:
>> On Mon, Jan 31, 2011 at 9:00 AM, Gary Wright <gwtmp01 <at> mac.com> wrote:
>>> I think the original poster provided an example of overloading based on the number of parameters but not
their type.
>>> Even restricting yourself to overloading by arity is a bit problematic in Ruby because the arity still
has to be determined (in some cases) dynamically:
>> Actually, arity of callsite is always calculated  in Ruby to know if
>> you should throw an ArgumentError (3 for 0 specified sort of errors)

Maybe I'm overlooking something but I wasn't suggesting that you don't need to calculate arity but instead
was pointing out that you can't just calculate it at parse time but sometimes need to calculate it at call time.

foo(1,2)     # the call arity can be computed at parse time
foo(*a)      # the call arity must be computed at call time

So in an 'overload-based-on-arity' scheme there might be some optimization opportunities for some call
sites but not for every call site.

Seems like you can get pretty far though with just a little meta-programming with no special language support:

module Arity
  def overload(base)
    define_method(base) do |*args|
      argc = args.size
      method_name = "#{base}_#{argc}"
      if respond_to?(method_name)
        send(method_name, *args)
(Continue reading)


Gmane