gem_velocity 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. data/.gitignore +1 -1
  2. data/README.md +18 -49
  3. data/TODO +7 -5
  4. data/examples/README.md +1 -0
  5. data/examples/generate_images.rb +48 -0
  6. data/examples/public/images/AggregatedVelocitator-haml-i18n-extractor-0.4.x.png +0 -0
  7. data/examples/public/images/Multiplexer-haml-i18n-extractor-0.0.17-0.0.16-0.4.x.png +0 -0
  8. data/examples/public/images/Multiplexer-haml-i18n-extractor-0.4.x-0.3.x.png +0 -0
  9. data/examples/public/images/SingleVelocitator-haml-i18n-extractor-0.0.16.png +0 -0
  10. data/examples/public/images/SingleVelocitator-haml-i18n-extractor-0.0.17.png +0 -0
  11. data/lib/gem_velocity/gem_data.rb +1 -1
  12. data/lib/gem_velocity/gruff_builder.rb +16 -13
  13. data/lib/gem_velocity/helpers.rb +26 -0
  14. data/lib/gem_velocity/velocitators/aggregated_velocitator.rb +24 -16
  15. data/lib/gem_velocity/velocitators/base_velocitator.rb +45 -39
  16. data/lib/gem_velocity/velocitators/factory.rb +52 -0
  17. data/lib/gem_velocity/velocitators/multiplexer.rb +65 -0
  18. data/lib/gem_velocity/velocitators/single_velocitator.rb +22 -14
  19. data/lib/gem_velocity/version.rb +1 -1
  20. data/lib/gem_velocity.rb +8 -1
  21. data/spec/aggregated_velocitor_spec.rb +53 -0
  22. data/spec/factory_spec.rb +54 -0
  23. data/spec/gruff_builder_spec.rb +0 -3
  24. data/spec/multiplexer_spec.rb +73 -0
  25. data/spec/no_time_cop_spec.rb +12 -28
  26. data/spec/single_velocitator_spec.rb +92 -0
  27. data/spec/spec_helper.rb +4 -0
  28. metadata +21 -11
  29. data/examples/rails-4.0.0-3.2.14-0.9.1.png +0 -0
  30. data/examples/rails-4.0.0-3.2.14-2.3.5.png +0 -0
  31. data/examples/rails-4.0.1.rc1-4.0.0-4.0.0.rc2-4.0.0.rc1-4.0.0.beta1.png +0 -0
  32. data/lib/gem_velocity/velocitators/all.rb +0 -4
  33. data/lib/gem_velocity/velocitators/multiple_velocitator.rb +0 -34
  34. data/spec/velocitator_spec.rb +0 -189
data/lib/gem_velocity.rb CHANGED
@@ -2,7 +2,14 @@ require "gem_velocity/version"
2
2
  require "gem_velocity/helpers"
3
3
  require "gem_velocity/gem_data"
4
4
  require "gem_velocity/gruff_builder"
5
- require "gem_velocity/velocitators/all"
5
+
6
+ require "gem_velocity/velocitators/base_velocitator"
7
+ require "gem_velocity/velocitators/single_velocitator"
8
+ require "gem_velocity/velocitators/aggregated_velocitator"
9
+ require "gem_velocity/velocitators/multiplexer"
10
+ require "gem_velocity/velocitators/factory"
11
+
12
+
6
13
  require "gem_velocity/errors"
7
14
 
8
15
  require 'active_support/all'
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+
3
+ describe AggregatedVelocitator do
4
+ before do
5
+ @gem_name = "haml-i18n-extractor"
6
+ # it's just a regex match ^version
7
+ @major_version = "0x"
8
+ @minor_version = "0.4.x"
9
+ end
10
+
11
+ it "can initialize and find out about all versions in a major" do
12
+ velocitator = AggregatedVelocitator.new(@gem_name, @major_version)
13
+ velocitator.versions.should == ["0.5.9", "0.5.8", "0.5.6", "0.5.5", "0.5.4", "0.5.3", "0.5.2", "0.5.1", "0.5.0", "0.4.3", "0.4.2", "0.4.1", "0.4.0", "0.3.5", "0.3.4", "0.3.2", "0.3.0", "0.2.1", "0.2.0", "0.1.0", "0.0.21", "0.0.20", "0.0.19", "0.0.18", "0.0.17", "0.0.16", "0.0.15", "0.0.12", "0.0.10", "0.0.9", "0.0.5"]
14
+ end
15
+
16
+ it "can initialize and find out about all versions in specific a minor" do
17
+ velocitator = AggregatedVelocitator.new(@gem_name, @minor_version)
18
+ velocitator.versions.should == ["0.4.3", "0.4.2", "0.4.1", "0.4.0"]
19
+ end
20
+
21
+ it "sends the first and last version passed as versions though" do
22
+ velocitator = AggregatedVelocitator.new(@gem_name, @minor_version)
23
+ velocitator.versions = ["0.4.3","0.4.0"]
24
+ end
25
+
26
+ it "sends only one graph that is the total of those versions" do
27
+ velocitator = AggregatedVelocitator.new(@gem_name, @minor_version)
28
+ velocitator.line_data.should_not be_empty # [1,2,3]
29
+ end
30
+
31
+ it "sets the max to the multiple of one of its members max * the amount of versions" do
32
+ velocitator = AggregatedVelocitator.new(@gem_name, @minor_version)
33
+ velocitator.default_max_value.should eq 356
34
+ end
35
+
36
+ it "sends only one graph and can draw a graph of it" do
37
+ velocitator = AggregatedVelocitator.new(@gem_name, @minor_version)
38
+ file = velocitator.graph
39
+ end
40
+
41
+ it "hides the legend caption" do
42
+ velocitator = AggregatedVelocitator.new(@gem_name, "0.0.17")
43
+ velocitator.graph_options[:hide_legend].should == true
44
+ end
45
+
46
+ it "should accumlate the same data as a single_velocitator" do
47
+ a_velocitator = AggregatedVelocitator.new(@gem_name, "0.0.17")
48
+ s_velocitator = SingleVelocitator.new(@gem_name, "0.0.17")
49
+ a_velocitator.versions.should == s_velocitator.versions
50
+ a_velocitator.graph_options[:line_datas].should == s_velocitator.graph_options[:line_datas]
51
+ end
52
+
53
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe "velocitator factory" do
4
+
5
+ # pass in singles, or aggregated
6
+
7
+ it "velocitator generation from name and version" do
8
+ options = { gem_name: "haml-i18n-extractor", version: "0.0.17" }
9
+ vg = Factory.new(options)
10
+ vg.version.should == "0.0.17"
11
+ vg.versions.should == ["0.0.17"]
12
+ vg.gem_name.should =="haml-i18n-extractor"
13
+ end
14
+
15
+ it "velocitator generation from full name single" do
16
+ options = { full_name: "haml-i18n-extractor-0.0.17" }
17
+ vg = Factory.new(options)
18
+ vg.version.should == "0.0.17"
19
+ vg.versions.should == ["0.0.17"]
20
+ vg.gem_name.should =="haml-i18n-extractor"
21
+ end
22
+
23
+ it "velocitator generation from full name aggregated" do
24
+ options = { full_name: "haml-i18n-extractor-0.4.x" }
25
+ vg = Factory.new(options)
26
+ vg.version.should == "0.4.x"
27
+ vg.versions.should == ["0.4.3", "0.4.2", "0.4.1", "0.4.0"]
28
+ vg.gem_name.should =="haml-i18n-extractor"
29
+ end
30
+
31
+ it "velocitator generation from weird full name" do
32
+ options = { full_name: "haml-i18n-extractor-0.0.17-dashes-mix-it-up" }
33
+ lambda {
34
+ # would be this, but we're raising cause we're hitting rubygems
35
+ vg = Factory.new(options)
36
+ vg.version.should == "up"
37
+ vg.versions.should == ["up"]
38
+ vg.gem_name.should =="haml-i18n-extractor-0.0.17-dashes-mix-it"
39
+ }.should raise_error(NoSuchGem)
40
+ end
41
+
42
+ it "is used in making velocitators from base single" do
43
+ options = { gem_name: "haml-i18n-extractor", version: "0.0.17" }
44
+ velocitator = BaseVelocitator.create(options)
45
+ velocitator.class.should == SingleVelocitator
46
+ end
47
+
48
+ it "is used in making velocitators from base aggregated" do
49
+ options = { gem_name: "haml-i18n-extractor", version: "0.4.x" }
50
+ velocitator = BaseVelocitator.create(options)
51
+ velocitator.class.should == AggregatedVelocitator
52
+ end
53
+
54
+ end
@@ -1,9 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe GruffBuilder do
4
- before do
5
- @tmp_dir = SpecHelper.tmpdir
6
- end
7
4
 
8
5
  it "raises if no root or if versions isnt an array" do
9
6
  lambda { builder = GruffBuilder.new(nil,nil,nil,nil, {}) }.should raise_error
@@ -0,0 +1,73 @@
1
+ require 'spec_helper'
2
+
3
+ # TODO this spec duplicates a lot of the velocitator specs?
4
+ # refactor this spec in conjunction with velocitator_spec
5
+ # also, probably should refactor multiplexer to inherit from base_velocitator
6
+ # instead of being it's own thing.
7
+
8
+ describe Multiplexer do
9
+ before do
10
+ # single
11
+ @v1 = BaseVelocitator.create(:gem_name => "haml-i18n-extractor", :version => "0.0.17")
12
+ @v2 = BaseVelocitator.create(:gem_name => "haml-i18n-extractor", :version => "0.0.16")
13
+ # aggregate
14
+ @v3 = BaseVelocitator.create(:gem_name => "haml-i18n-extractor", :version => "0.4.x")
15
+ @velocitators = [@v1,@v2,@v3]
16
+ @multiplexer = Multiplexer.new(@velocitators)
17
+ end
18
+
19
+ it "initializes with velocitators" do
20
+ @multiplexer = Multiplexer.new(@velocitators)
21
+ @multiplexer.velocitators.should == [@v1,@v2,@v3]
22
+ end
23
+
24
+ it "keeps the line_datas of each velocitator" do
25
+ @multiplexer.graph_options[:line_datas].size.should eq 3
26
+ ld3 = @multiplexer.graph_options[:line_datas].last
27
+ @v3.line_data.each {|total|
28
+ ld3.include?(total).should be_true
29
+ }
30
+ end
31
+
32
+ it "keeps line datas aligned with time" do
33
+ # could be a better test here (time factored in)
34
+ @multiplexer.graph_options[:line_datas].map(&:size).sort.uniq.size.should == 1 # all of them should be the same size (padded with 0's)...
35
+ end
36
+
37
+ it "start time is the earliest date of them all" do
38
+ @velocitators.each { |v|
39
+ v.effective_start_time.should >= @multiplexer.effective_start_time
40
+ }
41
+ end
42
+
43
+ it "end time is the latest" do
44
+ @velocitators.each { |v|
45
+ v.effective_end_time.should <= @multiplexer.effective_end_time
46
+ }
47
+ end
48
+
49
+ it "defines the largest max" do
50
+ @velocitators.each { |v|
51
+ v.effective_max_value <= @multiplexer.effective_max_value
52
+ }
53
+ end
54
+
55
+ it "smallest minimum" do
56
+ @velocitators.each { |v|
57
+ v.effective_min_value >= @multiplexer.effective_min_value
58
+ }
59
+ end
60
+
61
+ # FIXME
62
+ it "sets the root according to the first velocitators root it finds or cwd otherwise" do
63
+ @multiplexer.root.should == Dir.pwd
64
+ @v1.root = @tmp_dir
65
+ @multiplexer.root.should eq @tmp_dir
66
+ end
67
+
68
+ it "can draw a graph" do
69
+ file = @multiplexer.graph
70
+ puts file.inspect
71
+ end
72
+ end
73
+
@@ -5,53 +5,37 @@ describe 'with no time stubbing', :do_not_use_time_cop do
5
5
  # hax slow internet connections make this slow.
6
6
  if ENV['VELOCITATOR_REAL_LONG']
7
7
  it "has a shortcut graph method #1" do
8
- velocitator = SingleVelocitator.new("rails", "2.3.5")
9
- # WTF all is shit
8
+ v = velocitator = SingleVelocitator.new("rails", "2.3.5")
10
9
  # https://rubygems.org/gems/rails/versions/2.3.5
11
- # should be close to 1m!!
10
+ # should be close to 1m, but the total from thei api returned is ~33k.
11
+ # between 2013-03-07 and 2013-03-08 it "starts". but there's a ton of missing data from rubygems.
12
12
  #
13
- # gb = velocitator.send(:gruff_builder)
14
- # gb.line_datas.first.index{|z| z.nonzero?}
15
- # => 1199
16
- # gb.line_datas.first.size #[1199]
17
- # => 1417
18
- # 1417 - 1199
19
- # => 218
13
+ # v.send(:gem_data).downloads_metadata(v.version, v.send(:effective_start_time), v.send(:effective_end_time))
14
+ # _.map(&:last).sum
20
15
  #
21
- # velocitator.send(:gem_data).send(:downloads_metadata, velocitator.versions.first,velocitator.effective_date_range.first, velocitator.effective_date_range.last).size
22
- # => 1417
23
- # velocitator.send(:gem_data).downloads_day(velocitator.versions.first,velocitator.effective_date_range.first, velocitator.effective_date_range.last).size
24
- # => 218
25
- # x = Gems.downloads(velocitator.gem_name, velocitator.versions.first, velocitator.effective_date_range.first, velocitator.effective_date_range.last)
26
- # x.to_a.index{|z| z.last.nonzero?}
27
- # => 1198
28
- #x.to_a.index{|z| z.last.nonzero?}
29
- # FIXME . got local dump of database
30
- #binding.pry
31
- velocitator = SingleVelocitator.new("rails", "2.3.5")
16
+ # FIXME https://github.com/rubygems/rubygems.org/pull/606 has the method under test which is busted in reality.
32
17
  file = velocitator.graph("/tmp")
33
18
  end
34
19
 
35
20
  it "has a shortcut graph method #2" do
36
- velocitator = MultipleVelocitator.new("rails", ["4.0.0","3.2.14","0.9.1"])
37
- file = velocitator.graph("/tmp", [3.months.ago, Time.now])
21
+ versions = ["4.0.0","3.2.14","0.9.1"]
22
+ gem_name = "rails"
23
+ velocitators = versions.map{|v| SingleVelocitator.new(gem_name, v)}
24
+ plexer = Multiplexer.new(velocitators)
25
+ plexer.root = "/tmp"
26
+ file = plexer.graph("/tmp", [3.months.ago, Time.now])
38
27
  File.exist?(file).should be_true
39
28
  end
40
29
 
41
30
  it "has a shortcut graph method #3" do
42
31
  velocitator = AggregatedVelocitator.new("rails", "4")
43
- puts velocitator.versions
44
- puts velocitator.totals.inspect
45
32
  file = velocitator.graph("/tmp")
46
33
  File.exist?(file).should be_true
47
34
  end
48
35
 
49
36
  it "has a shortcut graph method #4" do
50
37
  velocitator = AggregatedVelocitator.new("haml-i18n-extractor", "0") # all of it
51
- puts velocitator.aggregated_versions
52
- puts velocitator.versions
53
38
  file = velocitator.graph("/tmp")
54
- puts file.inspect
55
39
  File.exist?(file).should be_true
56
40
  end
57
41
  end
@@ -0,0 +1,92 @@
1
+ require 'spec_helper'
2
+
3
+ # https://github.com/shaiguitar/rubygems.org/compare/api_not_returning_all_results_over_90_days?expand=1
4
+
5
+ describe "a Velocitator rendering graphs" do
6
+
7
+ # testing single_velocitator is enough to test base
8
+ it "can render a graph" do
9
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
10
+ velocitator.date_range = [ 7.days.ago, 3.days.ago ]
11
+ velocitator.root = SpecHelper.tmpdir
12
+
13
+ # Plausible to change this?
14
+ # the values for the two days mentioned in the date range.
15
+ # should this be the specific date range values?? aggregated since when? not aggregated?
16
+ velocitator.graph_options[:line_datas].should == [[303, 303, 303, 304, 304]]
17
+
18
+ velocitator.graph_options[:title].should == "haml-i18n-extractor-0.0.17\n(downloads: 377)"
19
+ velocitator.graph_options[:labels].should == ({1=>"2013-09-13", (velocitator.line_data.size-2) =>"2013-09-17"})
20
+ velocitator.graph_options[:max_value].should == 306 # the max in the range (time.now)
21
+ velocitator.graph_options[:min_value].should == 0
22
+
23
+ file = velocitator.graph
24
+ File.exist?(file).should be_true
25
+ #`open #{file} -a preview.app`
26
+ #Kernel.sleep(10)
27
+ end
28
+
29
+ it "has a shortcut graph method #1" do
30
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
31
+ file = velocitator.graph(SpecHelper.tmpdir,[1.day.ago, Time.now])
32
+ File.exist?(file).should be_true
33
+ end
34
+
35
+ it "has a shortcut graph method #2" do
36
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
37
+ file = velocitator.graph
38
+ File.exist?(file).should be_true
39
+ end
40
+
41
+ it "has a shortcut graph metho #3" do
42
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
43
+ file = velocitator.graph(nil,nil,0,1000)
44
+ File.exist?(file).should be_true
45
+ end
46
+ end
47
+
48
+ describe SingleVelocitator do
49
+ it 'raises if you dont pass name and version(s)' do
50
+ lambda { SingleVelocitator.new(nil,nil) }.should raise_error ArgumentError
51
+ end
52
+
53
+ it 'raises if the gem is not found' do
54
+ lambda { SingleVelocitator.new("NOSICHGEMPlZ123","0.1") }.should raise_error NoSuchGem
55
+ end
56
+
57
+ it 'raises if the version is not found' do
58
+ lambda { SingleVelocitator.new("haml-i18n-extractor","100.999.42.666.pre") }.should raise_error NoSuchVersion
59
+ end
60
+
61
+ it "holds the totals of the gem" do
62
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
63
+ velocitator.totals.first[:version_downloads].should eq 377
64
+ #binding.pry
65
+ end
66
+
67
+ it "sets a specific date range according to the gem's info" do
68
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
69
+ velocitator.effective_date_range.should eq ["2013-06-16T00:00:00Z", "2013-09-20T00:00:00Z"]
70
+ end
71
+
72
+ it "can override the default time ranges if its in the range" do
73
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
74
+ velocitator.date_range = [1.day.ago, Time.now]
75
+ velocitator.effective_date_range.should eq ["2013-09-19T00:00:00Z", "2013-09-20T00:00:00Z"]
76
+ end
77
+
78
+ it "can override a max and min" do
79
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
80
+ lambda {
81
+ velocitator.max_value = 500
82
+ velocitator.min_value = 10
83
+ }.should_not raise_error
84
+ end
85
+
86
+ it "has line data" do
87
+ velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
88
+ velocitator.line_data.should_not be_empty # [1,2,3]
89
+ end
90
+ end
91
+
92
+
data/spec/spec_helper.rb CHANGED
@@ -42,6 +42,10 @@ RSpec.configure do |c|
42
42
  end
43
43
  end
44
44
 
45
+ c.before(:all) do
46
+ @tmp_dir = SpecHelper.tmpdir
47
+ end
48
+
45
49
  c.after(:suite) do
46
50
  FileUtils.rm_rf(SpecHelper.tmpdir)
47
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_velocity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shai Rosenfeld
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-10-20 00:00:00 Z
18
+ date: 2013-10-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: gruff
@@ -203,9 +203,13 @@ files:
203
203
  - README.md
204
204
  - Rakefile
205
205
  - TODO
206
- - examples/rails-4.0.0-3.2.14-0.9.1.png
207
- - examples/rails-4.0.0-3.2.14-2.3.5.png
208
- - examples/rails-4.0.1.rc1-4.0.0-4.0.0.rc2-4.0.0.rc1-4.0.0.beta1.png
206
+ - examples/README.md
207
+ - examples/generate_images.rb
208
+ - examples/public/images/AggregatedVelocitator-haml-i18n-extractor-0.4.x.png
209
+ - examples/public/images/Multiplexer-haml-i18n-extractor-0.0.17-0.0.16-0.4.x.png
210
+ - examples/public/images/Multiplexer-haml-i18n-extractor-0.4.x-0.3.x.png
211
+ - examples/public/images/SingleVelocitator-haml-i18n-extractor-0.0.16.png
212
+ - examples/public/images/SingleVelocitator-haml-i18n-extractor-0.0.17.png
209
213
  - gem_velocity.gemspec
210
214
  - lib/gem_velocity.rb
211
215
  - lib/gem_velocity/errors.rb
@@ -213,17 +217,20 @@ files:
213
217
  - lib/gem_velocity/gruff_builder.rb
214
218
  - lib/gem_velocity/helpers.rb
215
219
  - lib/gem_velocity/velocitators/aggregated_velocitator.rb
216
- - lib/gem_velocity/velocitators/all.rb
217
220
  - lib/gem_velocity/velocitators/base_velocitator.rb
218
- - lib/gem_velocity/velocitators/multiple_velocitator.rb
221
+ - lib/gem_velocity/velocitators/factory.rb
222
+ - lib/gem_velocity/velocitators/multiplexer.rb
219
223
  - lib/gem_velocity/velocitators/single_velocitator.rb
220
224
  - lib/gem_velocity/version.rb
225
+ - spec/aggregated_velocitor_spec.rb
226
+ - spec/factory_spec.rb
221
227
  - spec/gem_data_spec.rb
222
228
  - spec/gruff_builder_spec.rb
223
229
  - spec/helpers_spec.rb
230
+ - spec/multiplexer_spec.rb
224
231
  - spec/no_time_cop_spec.rb
232
+ - spec/single_velocitator_spec.rb
225
233
  - spec/spec_helper.rb
226
- - spec/velocitator_spec.rb
227
234
  homepage: https://github.com/shaiguitar/gem_velocities
228
235
  licenses:
229
236
  - MIT
@@ -258,9 +265,12 @@ signing_key:
258
265
  specification_version: 3
259
266
  summary: generate gem velocity images
260
267
  test_files:
268
+ - spec/aggregated_velocitor_spec.rb
269
+ - spec/factory_spec.rb
261
270
  - spec/gem_data_spec.rb
262
271
  - spec/gruff_builder_spec.rb
263
272
  - spec/helpers_spec.rb
273
+ - spec/multiplexer_spec.rb
264
274
  - spec/no_time_cop_spec.rb
275
+ - spec/single_velocitator_spec.rb
265
276
  - spec/spec_helper.rb
266
- - spec/velocitator_spec.rb
Binary file
Binary file
@@ -1,4 +0,0 @@
1
- require "gem_velocity/velocitators/base_velocitator"
2
- require "gem_velocity/velocitators/single_velocitator"
3
- require "gem_velocity/velocitators/multiple_velocitator"
4
- require "gem_velocity/velocitators/aggregated_velocitator"
@@ -1,34 +0,0 @@
1
- class MultipleVelocitator < BaseVelocitator
2
-
3
- def initialize(gem_name, versions)
4
- super(gem_name, versions)
5
- end
6
-
7
- def default_start
8
- base_earliest_time_for(versions)
9
- end
10
-
11
- def default_max_value
12
- base_max_for(versions)
13
- end
14
-
15
- def graph_options
16
- opts = {
17
- :title => title,
18
- :labels => ({1 => time_format_str_small(effective_start_time), (line_datas.first.size-2) => time_format_str_small(effective_end_time) }),
19
- :max_value => effective_max_value,
20
- :min_value => effective_min_value,
21
- :line_datas => line_datas,
22
- }
23
- end
24
-
25
- def line_datas
26
- default_line_datas
27
- end
28
-
29
- def title
30
- "#{gem_name}"
31
- end
32
-
33
-
34
- end