torrent_api 0.2.3 → 0.2.5

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
@@ -8,4 +8,6 @@
8
8
  v0.2.0 Added some PirateBay analysis methods for comments and their video/audio ratings. Specs begin.
9
9
  v0.2.1 Added more api methods to the video/audio ratings
10
10
  v0.2.2 No more NaN's being returned by average methods
11
- v0.2.3 Ruby 1.8.7 Support
11
+ v0.2.3 Ruby 1.8.7 Support
12
+ v0.2.4 Fixed an issue with bad filename creation in caching
13
+ v0.2.5 Seriously, fixed a fix.
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'echoe'
2
- Echoe.new('torrent_api', '0.2.3') do |p|
2
+ Echoe.new('torrent_api', '0.2.5') 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"
@@ -35,9 +35,15 @@ module PirateBay
35
35
  next_page(doc)
36
36
 
37
37
  end
38
+
39
+ def sanitize_filename(filename)
40
+ filename = filename.gsub(/[^0-9A-Za-z.\-]/, 'x')
41
+ filename = filename.gsub(/^.*(\\|\/)/, '')
42
+ filename.strip
43
+ end
38
44
 
39
45
  def cached_filename
40
- File.join("tmp", "searches", "#{search_string}_#{category_id}_#{page}.html")
46
+ File.join("tmp", "searches", "#{sanitize_filename(search_string)}_#{category_id}_#{page}.html")
41
47
  end
42
48
 
43
49
  def get_quality
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.3"
5
+ s.version = "0.2.5"
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-15"
9
+ s.date = "2012-01-31"
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,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torrent_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Hart
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-15 00:00:00 Z
18
+ date: 2012-01-31 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: nokogiri