Sha256: 953723af9e82557e53f7e0e07193e32e1ec8e50f93aefaa2c30313529adad460

Contents?: true

Size: 764 Bytes

Versions: 4297

Compression:

Stored size: 764 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         = 0 if bar_length < 0

    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

4,297 entries across 4,297 versions & 28 rubygems

Version Path
cybrid_api_bank_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb
cybrid_api_organization_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb