lib/poise_service/utils.rb
def parse_service_name(path)
      parts = Pathname.new(path).each_filename.to_a.reverse!
      # Find the last segment not in common segments, fall back to the last segment.
      parts.find {|seg| !COMMON_SEGMENTS[seg] } || parts.first
    end
def parse_service_name(path)
      parts = Pathname.new(path).each_filename.to_a.reverse!
      # Find the last segment not in common segments, fall back to the last segment.
      parts.find {|seg| !COMMON_SEGMENTS[seg] } || parts.first
    end
Parse the service name from a path. Look at the last component of the
 path, ignoring some common names.

 @param path [String] Path to parse.
 @return [String]
 @example
   attribute(:service_name, kind_of: String, default: lazy { PoiseService::Utils.parse_service_name(path) })