method

truncate

ruby latest stable - Class: Bundler::Thor::Shell::Basic

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

truncate(string, width)
protected

No documentation available.

# File lib/bundler/vendor/thor/lib/thor/shell/basic.rb, line 382
      def truncate(string, width)
        as_unicode do
          chars = string.chars.to_a
          if chars.length <= width
            chars.join
          else
            chars[0, width - 3].join + "..."
          end
        end
      end