Sha256: ebb1dca2b43c01acbf963c6454e1f0a6fa9589e38fef268b00bbb4a214c8cd5a

Contents?: true

Size: 279 Bytes

Versions: 33

Compression:

Stored size: 279 Bytes

Contents

# frozen_string_literal: true

require 'pathname'

class Pathname
  # @param suffix [String]
  # @return [Pathname]
  def basename_sub(suffix = '')
    new_basename = basename(suffix)
    new_basename = yield(new_basename) if block_given?
    parent.join(new_basename)
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
eac_ruby_utils-0.123.0 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.121.0 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.120.0 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.76.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.76.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.75.2 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.119.2 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.75.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.75.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.119.1 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.74.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.74.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.73.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.119.0 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.72.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.118.1 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_ruby_utils-0.118.0 lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.70.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.70.0 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb
eac_tools-0.69.1 sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/basename_sub.rb