Sha256: b230831225eeb6b95fb86652b5e6b4efa32c695aaa7eb15448217fcecda19919

Contents?: true

Size: 734 Bytes

Versions: 6822

Compression:

Stored size: 734 Bytes

Contents

# frozen_string_literal: true

module Byebug
  module Helpers
    #
    # Utilities for interaction with strings
    #
    module StringHelper
      #
      # Converts +str+ from an_underscored-or-dasherized_string to
      # ACamelizedString.
      #
      def camelize(str)
        str.dup.split(/[_-]/).map(&:capitalize).join("")
      end

      #
      # Improves indentation and spacing in +str+ for readability in Byebug's
      # command prompt.
      #
      def prettify(str)
        "\n" + deindent(str) + "\n"
      end

      #
      # Removes a number of leading whitespace for each input line.
      #
      def deindent(str, leading_spaces: 6)
        str.gsub(/^ {#{leading_spaces}}/, "")
      end
    end
  end
end

Version data entries

6,822 entries across 6,818 versions & 33 rubygems

Version Path
ory-client-1.16.4 vendor/bundle/ruby/3.1.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.179 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.177 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.176 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.175 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.174 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.173 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
ory-client-1.16.3 vendor/bundle/ruby/3.1.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.172 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.171 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_id_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb
cybrid_api_organization_ruby-0.123.170 vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/helpers/string.rb