Sha256: 48e64f10c52a170005f676d23a395a1dc48695249aebd44a79cf21cbd1026da2

Contents?: true

Size: 398 Bytes

Versions: 7182

Compression:

Stored size: 398 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Formatter
    # Common logic for UI texts.
    module TextUtil
      module_function

      def pluralize(number, thing, options = {})
        if number.zero? && options[:no_for_zero]
          "no #{thing}s"
        elsif number == 1
          "1 #{thing}"
        else
          "#{number} #{thing}s"
        end
      end
    end
  end
end

Version data entries

7,182 entries across 7,143 versions & 52 rubygems

Version Path
passbase-1.3.0 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/formatter/text_util.rb
rubocop-1.17.0 lib/rubocop/formatter/text_util.rb
rubocop-1.16.1 lib/rubocop/formatter/text_util.rb
rubocop-1.16.0 lib/rubocop/formatter/text_util.rb
rubocop-1.15.0 lib/rubocop/formatter/text_util.rb
cocRb-0.1.0 .bundle/ruby/3.0.0/gems/rubocop-1.14.0/lib/rubocop/formatter/text_util.rb
rubocop-1.14.0 lib/rubocop/formatter/text_util.rb
rubocop-1.13.0 lib/rubocop/formatter/text_util.rb
rubocop-1.12.1 lib/rubocop/formatter/text_util.rb
rubocop-1.12.0 lib/rubocop/formatter/text_util.rb
mfk_openapi_ruby_client-1.0.0 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/formatter/text_util.rb
rubocop-1.11.0 lib/rubocop/formatter/text_util.rb
rubocop-1.10.0 lib/rubocop/formatter/text_util.rb
rubocop-1.9.1 lib/rubocop/formatter/text_util.rb
rubocop-1.9.0 lib/rubocop/formatter/text_util.rb
rubocop-1.8.1 lib/rubocop/formatter/text_util.rb
rubocop-1.8.0 lib/rubocop/formatter/text_util.rb
rubocop-1.7.0 lib/rubocop/formatter/text_util.rb
rubocop-1.6.1 lib/rubocop/formatter/text_util.rb
rubocop-1.6.0 lib/rubocop/formatter/text_util.rb