Sha256: 427391be7f4ce05954d0b69beeca94a4c938c4bf7fdc065472d266300740d1f3

Contents?: true

Size: 778 Bytes

Versions: 2726

Compression:

Stored size: 778 Bytes

Contents

class   ProgressBar
module  Format
class   Formatter
  def self.process(format_string, max_length, bar)
    processed_string = format_string.dup

    format_string.non_bar_molecules.each do |molecule|
      processed_string.gsub!(molecule.full_key, molecule.lookup_value(bar, nil))
    end

    processed_string.gsub!(/%%/, '%')

    bar_length         = max_length -
                         processed_string.displayable_length +
                         format_string.bar_molecule_placeholder_length
    bar_length         = (bar_length < 0) ? 0 : bar_length

    format_string.bar_molecules.each do |molecule|
      processed_string.gsub!(molecule.full_key,
                             molecule.lookup_value(bar, bar_length))
    end

    processed_string
  end
end
end
end

Version data entries

2,726 entries across 2,676 versions & 44 rubygems

Version Path
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.20.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.19.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.18.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.17.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.15.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.14.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.13.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.12.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.11.1 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
mux_ruby-3.11.0 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.62.65 vendor/bundle/ruby/3.2.0/gems/ruby-progressbar-1.11.0/lib/ruby-progressbar/format/formatter.rb