Method: ShellHelpers::PathnameExt::Base#new_name
- Defined in:
- lib/shell_helpers/pathname.rb
#new_name(cond) ⇒ Object
loop until we get a name satisfying cond
152 153 154 155 156 157 |
# File 'lib/shell_helpers/pathname.rb', line 152 def new_name(cond) loop.with_index do |_,ind| n=self.class.new(yield(self,ind)) return n if cond.call(n) end end |