[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

[PATCH] Pathname.to_a

From: Marc Haisenko <haisenko@...>
Date: 2006-08-09 12:27:03 UTC
List: ruby-core #8568
Hi folks,
today I found myself wanting to get the parent directory name of a file, so I 
was looking whether Pathname has an to_a so I could do:

parent_dir = path.to_a[-2]

Since it didn't exist, I've written a small patch against CVS to add this 
simple function, maybe you find it useful :-)

C'ya,
	Marc

-- 
Marc Haisenko
Comdasys AG

Rüdesheimer Straße 7
D-80686 München
Tel:   +49 (0)89 - 548 43 33 21
Fax:   +49 (0)89 - 548 43 33 29
e-mail: haisenko@comdasys.com
http://www.comdasys.com

--Boundary-00=_TSd2EyMm63MlBlr
Content-Type: text/x-diff;
  charset="utf-8";
  name="pathname-to_a.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="pathname-to_a.patch"

--- pathname.rb.orig	2006-07-08 10:56:27.000000000 +0200
+++ pathname.rb	2006-08-09 14:10:54.000000000 +0200
@@ -242,6 +242,13 @@
     @path.dup
   end
 
+  # Return the path as an Array.
+  def to_a
+    a = @path.split SEPARATOR_PAT
+    a.shift if a[0].size == 0
+    a
+  end
+
   # to_path is implemented so Pathname objects are usable with File.open, etc.
   alias_method TO_PATH, :to_s
 

--Boundary-00=_TSd2EyMm63MlBlr--
--Boundary-00=_TSd2EyMm63MlBlr--

In This Thread

Prev Next