torrent_api 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -6,4 +6,5 @@
6
6
  v0.1.1 Fixed Demonoid torrent links to be absolute, not relative.
7
7
  v0.1.2 Fixed PirateBay filesizes to be in bytes.
8
8
  v0.2.0 Added some PirateBay analysis methods for comments and their video/audio ratings. Specs begin.
9
- v0.2.1 Added more api methods to the video/audio ratings
9
+ v0.2.1 Added more api methods to the video/audio ratings
10
+ v0.2.2 No more NaN's being returned by average methods
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('torrent_api', '0.2.1') do |p|
2
+ Echoe.new('torrent_api', '0.2.2') do |p|
3
3
  p.description = "An API to query popular torrent websites"
4
4
  p.url = "http://www.github.com/hjhart/torrent_api"
5
5
  p.author = "James Hart"
@@ -92,7 +92,8 @@ module PirateBay
92
92
  end
93
93
 
94
94
  def video_quality_average
95
- video_quality_score_sum / video_scores.size.to_f
95
+ total_votes = [video_scores.size.to_f, 1].max
96
+ video_quality_score_sum / total_votes
96
97
  end
97
98
 
98
99
  def audio_scores
@@ -104,7 +105,8 @@ module PirateBay
104
105
  end
105
106
 
106
107
  def audio_quality_average
107
- audio_quality_score_sum / audio_scores.size.to_f
108
+ total_votes = [audio_scores.size.to_f, 1].max.to_f
109
+ audio_quality_score_sum / total_votes
108
110
  end
109
111
  end
110
112
  end
data/torrent_api.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "torrent_api"
5
- s.version = "0.2.1"
5
+ s.version = "0.2.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["James Hart"]
9
- s.date = "2011-11-12"
9
+ s.date = "2011-11-13"
10
10
  s.description = "An API to query popular torrent websites"
11
11
  s.email = "hjhart@gmail.com"
12
12
  s.extra_rdoc_files = ["CHANGELOG", "README.markdown", "lib/demonoid/base.rb", "lib/demonoid/result.rb", "lib/demonoid/result_set.rb", "lib/pirate_bay/base.rb", "lib/pirate_bay/categories.rb", "lib/pirate_bay/details.rb", "lib/pirate_bay/result.rb", "lib/pirate_bay/result_set.rb", "lib/torrent_api.rb", "lib/torrent_reactor/base.rb", "lib/torrent_reactor/result.rb", "lib/torrent_reactor/result_set.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torrent_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-12 00:00:00.000000000Z
12
+ date: 2011-11-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &2153617180 !ruby/object:Gem::Requirement
16
+ requirement: &2153190020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153617180
24
+ version_requirements: *2153190020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: hpricot
27
- requirement: &2153616140 !ruby/object:Gem::Requirement
27
+ requirement: &2153188880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153616140
35
+ version_requirements: *2153188880
36
36
  description: An API to query popular torrent websites
37
37
  email: hjhart@gmail.com
38
38
  executables: []