Sha256: 7632f4608c0d148f50c7d403ce2bdad7e74ff9dc764c6e1f930ed508209493d9

Contents?: true

Size: 782 Bytes

Versions: 4404

Compression:

Stored size: 782 Bytes

Contents

# rubocop:disable Style/InlineComment
class   ProgressBar
class   Time
  TIME_MOCKING_LIBRARY_METHODS = [
                                   :__simple_stub__now,     # ActiveSupport
                                   :now_without_mock_time,  # Timecop
                                   :now_without_delorean,   # Delorean
                                   :now                     # Unmocked
                                 ].freeze

  def initialize(time = ::Time)
    self.time = time
  end

  def now
    time.__send__(unmocked_time_method)
  end

  def unmocked_time_method
    @unmocked_time_method ||= TIME_MOCKING_LIBRARY_METHODS.find do |method|
      time.respond_to? method
    end
  end

  protected

  attr_accessor :time
end
end
# rubocop:enable Style/InlineComment

Version data entries

4,404 entries across 4,404 versions & 30 rubygems

Version Path
cybrid_api_organization_ruby-0.123.194 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.194 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.193 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.193 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.192 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.192 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.191 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.191 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.190 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.190 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.189 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.189 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.186 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.186 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.185 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.185 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_organization_ruby-0.123.184 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.184 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb
cybrid_api_id_ruby-0.123.183 vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb