gem_velocity 0.0.7 → 0.0.8
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.
- data/README.md +37 -10
- data/TODO +2 -0
- 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
- data/lib/gem_velocity/velocitators/aggregated_velocitator.rb +1 -5
- data/lib/gem_velocity/velocitators/base_velocitator.rb +5 -0
- data/lib/gem_velocity/velocitators/multiple_velocitator.rb +1 -1
- data/lib/gem_velocity/velocitators/single_velocitator.rb +1 -5
- data/lib/gem_velocity/version.rb +1 -1
- data/spec/no_time_cop_spec.rb +2 -2
- data/spec/velocitator_spec.rb +3 -3
- metadata +5 -4
data/README.md
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
# GemVelocity
|
2
2
|
|
3
|
-
A way to see gem velocity.
|
3
|
+
A way to see gem velocity. There are three ways you can view graphs.
|
4
4
|
|
5
|
-
|
5
|
+
`AggregatedVelocitator`
|
6
|
+
|
7
|
+
`SingleVelocitator`
|
8
|
+
|
9
|
+
`MultipleVelocitator`
|
10
|
+
|
11
|
+
Some examples are noted below.
|
6
12
|
|
7
13
|
## Note
|
8
14
|
|
9
|
-
|
15
|
+
There may be some inconstancies. These are outlined in:
|
10
16
|
|
11
17
|
[https://gist.github.com/shaiguitar/d2af997b7f58e24fd305](https://gist.github.com/shaiguitar/d2af997b7f58e24fd305)
|
12
18
|
|
13
|
-
I'm investigating though with the help of the rubygems team as per [this](https://github.com/rubygems/rubygems.org/pull/606) and will hopefully have some progress soon.
|
19
|
+
It seems it happens with older data. I'm investigating though with the help of the rubygems team as per [this](https://github.com/rubygems/rubygems.org/pull/606) and will hopefully have some progress soon.
|
14
20
|
|
15
21
|
## Requirements
|
16
22
|
|
17
|
-
It draws graphs. So...you'll need imagemagick/rmagick.
|
23
|
+
It draws graphs. So...you'll need imagemagick/rmagick. Any problems with installation let me know and I'll try to help out.
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
Here's one: [celluloid](https://gist.github.com/shaiguitar/7e6d95971c5254fa3665)
|
25
|
+
There are plans to put it on the web somewhere, so if you wait long enough you may not even need to install it.
|
22
26
|
|
23
|
-
|
27
|
+
# Example
|
24
28
|
|
25
29
|
<pre>
|
26
30
|
velocitator = MultipleVelocitator.new("rails", ["4.0.0","3.2.14","2.3.5"])
|
@@ -42,14 +46,37 @@ Produces:
|
|
42
46
|
|
43
47
|

|
44
48
|
|
49
|
+
<pre>
|
50
|
+
velocitator = AggregatedVelocitator.new("rails", "4")
|
51
|
+
# matches any version /^4.\d/ etc
|
52
|
+
file = velocitator.graph("/tmp")
|
53
|
+
</pre>
|
54
|
+
|
55
|
+
Produces:
|
56
|
+
|
57
|
+

|
58
|
+
|
59
|
+
Another: [celluloid](https://gist.github.com/shaiguitar/7e6d95971c5254fa3665)
|
60
|
+
|
61
|
+
You could do the same with a `SingleVelocitator` as well:
|
62
|
+
|
63
|
+
<pre>
|
64
|
+
velocitator = SingleVelocitator.new("rails", "4.0.0")
|
65
|
+
file = velocitator.graph("/tmp")
|
66
|
+
</pre>
|
67
|
+
|
68
|
+
That image is left as an excerise to the reader. Actually it's late. But try it and see.
|
69
|
+
|
45
70
|
Also, you should be able to pass in max,min values which completes you being able to manipulate the boundries of the graph in question.
|
46
71
|
|
47
72
|
## Web UI
|
48
73
|
|
49
74
|
Do you want to see this with ease (Hey, the api is easy. Whatever) on the web at `http://rubygems-velocity.org/gem/rails/4.0.0,3.2.14` or something similar? I could do it, but I need to know it's worth the hassle.
|
50
75
|
|
76
|
+
Also, if you have any idea of how you'd like to use it, please leave a comment on the [issue](https://github.com/shaiguitar/gem_velocities/issues/3)
|
77
|
+
|
51
78
|
Lemme know.
|
52
79
|
|
53
80
|
## Feedback
|
54
81
|
|
55
|
-
Is appreciated! Any (other) ideas?
|
82
|
+
Is appreciated! Also, contributions! Any (other) ideas?
|
data/TODO
CHANGED
@@ -12,3 +12,5 @@ in default_line_datas.
|
|
12
12
|
if rubygems 606 isn't solved, why not just put a total on there and let the inconsistnecies just be with some notice?
|
13
13
|
|
14
14
|
rename time_format_str_small alias
|
15
|
+
|
16
|
+
swap out gruff_builder to some other composing object of a builder, that can mash up the various velocitators?
|
Binary file
|
@@ -38,11 +38,7 @@ class AggregatedVelocitator < BaseVelocitator
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def title
|
41
|
-
"#{@gem_name}: #{@top_level_ver}X"
|
42
|
-
end
|
43
|
-
|
44
|
-
def totals
|
45
|
-
super.map {|x| x[:version_downloads]}.sum
|
41
|
+
"#{@gem_name}: #{@top_level_ver}X\n(downloads: #{num_downloads})"
|
46
42
|
end
|
47
43
|
|
48
44
|
end
|
@@ -18,7 +18,7 @@ class MultipleVelocitator < BaseVelocitator
|
|
18
18
|
:labels => ({1 => time_format_str_small(effective_start_time), (line_datas.first.size-2) => time_format_str_small(effective_end_time) }),
|
19
19
|
:max_value => effective_max_value,
|
20
20
|
:min_value => effective_min_value,
|
21
|
-
:line_datas => line_datas
|
21
|
+
:line_datas => line_datas,
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
data/lib/gem_velocity/version.rb
CHANGED
data/spec/no_time_cop_spec.rb
CHANGED
@@ -25,11 +25,11 @@ describe 'with no time stubbing', :do_not_use_time_cop do
|
|
25
25
|
# x = Gems.downloads(velocitator.gem_name, velocitator.versions.first, velocitator.effective_date_range.first, velocitator.effective_date_range.last)
|
26
26
|
# x.to_a.index{|z| z.last.nonzero?}
|
27
27
|
# => 1198
|
28
|
-
velocitator = SingleVelocitator.new("rails", "2.3.5")
|
29
28
|
#x.to_a.index{|z| z.last.nonzero?}
|
29
|
+
# FIXME . got local dump of database
|
30
30
|
#binding.pry
|
31
|
+
velocitator = SingleVelocitator.new("rails", "2.3.5")
|
31
32
|
file = velocitator.graph("/tmp")
|
32
|
-
raise 'wtf'
|
33
33
|
end
|
34
34
|
|
35
35
|
it "has a shortcut graph method #2" do
|
data/spec/velocitator_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe "a Velocitator rendering graphs" do
|
|
15
15
|
# should this be the specific date range values?? aggregated since when? not aggregated?
|
16
16
|
velocitator.graph_options[:line_datas].should == [[303, 303, 303, 304, 304]]
|
17
17
|
|
18
|
-
velocitator.graph_options[:title].should == "haml-i18n-extractor-0.0.17"
|
18
|
+
velocitator.graph_options[:title].should == "haml-i18n-extractor-0.0.17\n(downloads: 377)"
|
19
19
|
velocitator.graph_options[:labels].should == ({1=>"2013-09-13", (velocitator.line_datas.first.size-2) =>"2013-09-17"})
|
20
20
|
velocitator.graph_options[:max_value].should == 306 # the max in the range (time.now)
|
21
21
|
velocitator.graph_options[:min_value].should == 0
|
@@ -60,7 +60,7 @@ describe SingleVelocitator do
|
|
60
60
|
|
61
61
|
it "holds the totals of the gem" do
|
62
62
|
velocitator = SingleVelocitator.new("haml-i18n-extractor", "0.0.17")
|
63
|
-
velocitator.totals.should
|
63
|
+
velocitator.totals.first[:version_downloads].should eq 377
|
64
64
|
#binding.pry
|
65
65
|
end
|
66
66
|
|
@@ -103,7 +103,7 @@ describe MultipleVelocitator do
|
|
103
103
|
|
104
104
|
it "holds the totals of the gem" do
|
105
105
|
velocitator = MultipleVelocitator.new("haml-i18n-extractor", ["0.0.17"])
|
106
|
-
velocitator.totals.should eq
|
106
|
+
velocitator.totals.first[:version_downloads].should eq 377
|
107
107
|
end
|
108
108
|
|
109
109
|
it "sets the earliest start range from to all of the versions info" do
|
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:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
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-
|
18
|
+
date: 2013-10-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: gruff
|
@@ -205,6 +205,7 @@ files:
|
|
205
205
|
- TODO
|
206
206
|
- examples/rails-4.0.0-3.2.14-0.9.1.png
|
207
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
|
208
209
|
- gem_velocity.gemspec
|
209
210
|
- lib/gem_velocity.rb
|
210
211
|
- lib/gem_velocity/errors.rb
|