torrent_api 0.1.1 → 0.1.2

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/CHANGELOG CHANGED
@@ -3,4 +3,5 @@
3
3
  v0.0.3 fixed minor issue with 0.0.2
4
4
  v0.0.9 Migrated from tpb to torrent_api (now includes torrent_reactor and demonoid as searches)
5
5
  v0.1.0 Fixed Demonoid. Stable performance on :all and :demonoid.
6
- v0.1.1 Fixed Demonoid torrent links to be absolute, not relative.
6
+ v0.1.1 Fixed Demonoid torrent links to be absolute, not relative.
7
+ v0.1.2 Fixed PirateBay filesizes to be in bytes.
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('torrent_api', '0.1.1') do |p|
2
+ Echoe.new('torrent_api', '0.1.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"
@@ -18,8 +18,6 @@ module PirateBay
18
18
  magnet_link = nil
19
19
  end
20
20
 
21
- raw_filesize = row.css(".detDesc").first.content.match(/Size (.*[G|M|K]iB)/i)[1]
22
- filesize_in_bytes = PirateBay::Result.filesize_in_bytes(raw_filesize)
23
21
 
24
22
  self.name = row.css(".detName").first.content
25
23
  self.seeds = row.css("td")[2].content.to_i
@@ -28,7 +26,9 @@ module PirateBay
28
26
  self.link = row.css("td")[1].css("a[title='Download this torrent']").first[:href]
29
27
  self.magnet_link = magnet_link
30
28
  self.status = status
31
- self.size = filesize_in_bytes
29
+
30
+ raw_filesize = row.css(".detDesc").first.content.match(/Size (.*[G|M|K]iB)/i)[1]
31
+ self.size = filesize_in_bytes(raw_filesize)
32
32
 
33
33
  end
34
34
 
@@ -36,7 +36,7 @@ module PirateBay
36
36
  "<PirateBay::Result @name => #{name}, @seeds => #{seeds}, @size => #{size}>"
37
37
  end
38
38
 
39
- def self.filesize_in_bytes(filesize)
39
+ def filesize_in_bytes(filesize)
40
40
  match = filesize.match(/([\d.]+)(.*)/)
41
41
 
42
42
  if match
data/torrent_api.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{torrent_api}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.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"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - James Hart