#63 ✓resolved
bahuvrihi

Root#reduce

Reported by bahuvrihi | July 21st, 2008 @ 06:03 PM

Root#reduce should be a reworked to chop off extensions and versions as necessary. Then match_reduce? should correspondingly match... version and extension only if necessary.


# no paths or extensions since the
# paths may be reduced
%w{
  path/to/file-0.1.0.rb
  path/to/another-0.2.0.txt
}
# => ['file', 'another']

%w{
  path/to/file-0.1.0.rb
  path/to/another/file-0.2.0.txt
}
# => ['to/file', 'another/file']

# versions are kept because there
# is no way to reduce without them
%w{
  path/to/file-0.1.0.rb
  path/to/file-0.2.0.txt
}
# => ['file-0.1.0', 'file-0.2.0']

# extensions are kept because there
# is no way to reduce without them
%w{
  path/to/file.rb
  path/to/file.txt
}
# => ['file.rb', 'file.txt']

# extension and version are kept because 
# there is no way to reduce without them
%w{
  path/to/file-0.1.0.rb
  path/to/file-0.1.0.txt
}
# => ['file-0.1.0.rb', 'file-0.1.0.txt']

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A framework for making configurable, file-based tasks and workflows.

People watching this ticket

Tags

Pages