[#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

[rake] patch to rule

From: nobu@...
Date: 2006-08-20 14:21:13 UTC
List: ruby-core #8666
Hi,

The latest rake doesn't work with some patterns.

1) file name with source extension
  rule '.o' => %w[.c Rakefile] do |t|
    p "#{t.name} #{t.sources.join(' ')}"
  end

2) file name which starts with a dot
  file '.foo'
  rule '.o' => %w[.c .foo] do |t|
    p "#{t.name} #{t.sources.join(' ')}"
  end

3) target name without extension
  rule 'foo' => %w[.c] do |t|
    p "#{t.name} #{t.sources.join(' ')}"
  end

It doesn't seem natural to replace the extension with the string
which doesn't start with a dot.

This is a patch to check it and allow file/task name starting
with a dot.


Index: lib/rake.rb
===================================================================
--- lib/rake.rb	(revision 568)
+++ lib/rake.rb	(working copy)
@@ -1552,12 +1552,9 @@
     # Attempt to create a rule given the list of prerequisites.
     def attempt_rule(task_name, extensions, block, level)
-      sources = make_sources(task_name, extensions)
-      prereqs = sources.collect { |source|
+      prereqs = make_sources(task_name, extensions) { |source|
         if File.exist?(source) || Rake::Task.task_defined?(source)
           source
-        elsif parent = enhance_with_matching_rule(sources.first, level+1)
+        elsif parent = enhance_with_matching_rule(source, level+1)
           parent.name
-        else
-          return nil
         end
       }
@@ -1573,7 +1570,8 @@
         case ext
         when String
-          task_name.sub(/\.[^.]*$/, ext)
+          yield ext.sub(/\A(?=\.)/) {task_name.sub(/\.[^.]*$/, '')} or
+            yield ext or ext
         when Proc
-          ext.call(task_name)
+          yield ext.call(task_name)
         else
           fail "Don't know how to handle rule dependent: #{ext.inspect}"


-- 
Nobu Nakada

In This Thread

Prev Next