class SingleVelocitator

Attributes

version[R]

the one passed in for :versions, it's just [version]

Public Class Methods

new(gem_name, version) click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 7
def initialize(gem_name, version)
  @gem_name = gem_name
  @version = version
  @versions = [version]
  after_init
end

Public Instance Methods

default_max_value() click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 22
def default_max_value
  downloads_per_day(@version).map {|day,total| total}.max
end
default_start() click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 14
def default_start
  time_format_str(Date.parse(time_built))
end
hide_legend?() click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 47
def hide_legend?
  true
end
line_data(start_t = nil, end_t = nil) click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 26
def line_data(start_t = nil, end_t = nil)
  range = nil
  if start_t && end_t
    range = compute_day_range_from_start_end(start_t,end_t)
  else
    range = effective_days_in_range
  end

  range.map do |d|
    downloads_per_day(version)[d] || 0
  end
end
time_built() click to toggle source
Calls superclass method BaseVelocitator#time_built
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 18
def time_built
  super(@version)
end
title() click to toggle source
# File lib/gem_velocity/velocitators/single_velocitator.rb, line 39
def title
  "#{gem_name}-#{version}\n(downloads: #{num_downloads})"
end