kat 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfab5385cdf49e90d2b42afe3443e02f8546ee0c
4
- data.tar.gz: 66e259a2001265d6afcc3c940a00977f93d99f66
3
+ metadata.gz: 4f3be486a3fd589863e335ead0b32a513054e179
4
+ data.tar.gz: 7bc186e7ea503e98e08c5207b303a6bef0df1a1c
5
5
  SHA512:
6
- metadata.gz: d79200e83980110c7fed1f4f3004aa082fdfe840c61e0bdd85a866bbb7b4414213c250d8acc2e0202578145fb418f6f2893a8dd894851a0e4ba056b7d34de4d2
7
- data.tar.gz: 1b7d5484002a1d9770ca7dee463e4b2a876b2f0e0dd812ed609603de21889000b5d3c9c5c16bc4512625a89cabaf121449f46a7a6be3e0389dea15e2afabb210
6
+ metadata.gz: dd8f7d2fb1dabb22aadf4ee12afe7ff674f46f2826753fedb52bbf12d2d69db74c04878ec46886040fd6979a9229d110bcf79a3fa1285394741d482ad7622dc5
7
+ data.tar.gz: 7177822f76aca68680aceed28f3f6da2e3800329fa40d6688245f37387f065c67a6412e3f12139592229abb4f6a224c29d06de7ce6017d9244491da4afbd6bf3
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kat.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Fission Xuiptz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Kat
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'kat'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install kat
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path '../lib', __FILE__
3
+ $LOAD_PATH.unshift lib unless $LOAD_PATH.include? lib
4
+ require 'kat/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'kat'
8
+ s.version = Kat::VERSION
9
+ s.date = '2013-08-09'
10
+ s.author = 'Fission Xuiptz'
11
+ s.email = 'fissionxuiptz@softwaremojo.com'
12
+ s.homepage = 'http://github.com/fissionxuiptz/kat'
13
+ s.license = 'MIT'
14
+
15
+ s.rubyforge_project = 'kat'
16
+
17
+ s.summary = 'Kickass Torrents Interface'
18
+ s.description = 'A Ruby interface to Kickass Torrents'
19
+
20
+ s.files = `git ls-files`.split $/
21
+ s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f }
22
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
23
+ s.require_paths = [ 'lib' ]
24
+
25
+ s.add_runtime_dependency 'nokogiri'
26
+ end
data/lib/kat.rb CHANGED
@@ -1,27 +1,3 @@
1
- # The MIT License (MIT)
2
-
3
- # Copyright (c) 2013 Fission Xuiptz
4
-
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
-
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
-
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
-
23
-
24
-
25
1
  # TODO: Implement field sort and sort order
26
2
  # Lookup advanced search for language and platform values
27
3
  # Comments
@@ -31,8 +7,6 @@ require 'nokogiri'
31
7
  require 'open-uri'
32
8
 
33
9
  class Kat
34
- VERSION = '0.1.1'
35
-
36
10
  KAT_URL = 'http://kickass.to'
37
11
  SEARCH_URL = "#{KAT_URL}/usearch/"
38
12
  ADVANCED_URL = "#{KAT_URL}/torrents/search/advanced/"
@@ -46,7 +20,7 @@ class Kat
46
20
  def initialize search_term = nil, opts = {}
47
21
  @search_term = []
48
22
  @options = opts.is_a?(Hash) ? opts : {}
49
- self.query = search_term.dup
23
+ self.query = search_term.is_a? Array ? search_term.dup : search_term
50
24
  end
51
25
 
52
26
  def self.search search_term
@@ -54,7 +28,7 @@ class Kat
54
28
  end
55
29
 
56
30
  def query page = 0
57
- @query.join(' ').gsub(/[^a-z0-9\-: _]/i, '') + (page > 0 ? "/#{page + 1}" : '') + (@query.empty? ? '' : '/')
31
+ @query.join(' ').gsub(/[^a-z0-9: _-]/i, '') + (page > 0 ? "/#{page + 1}" : '') + (@query.empty? ? '' : '/')
58
32
  end
59
33
 
60
34
  def query= search_term
@@ -0,0 +1,3 @@
1
+ class Kat
2
+ VERSION = '0.1.2'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fission Xuiptz
@@ -30,8 +30,15 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - .gitignore
34
+ - Gemfile
35
+ - LICENSE
36
+ - README.md
37
+ - Rakefile
38
+ - kat.gemspec
33
39
  - lib/kat.rb
34
- homepage: http://rubygems.org/gems/kat
40
+ - lib/kat/version.rb
41
+ homepage: http://github.com/fissionxuiptz/kat
35
42
  licenses:
36
43
  - MIT
37
44
  metadata: {}
@@ -50,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
57
  - !ruby/object:Gem::Version
51
58
  version: '0'
52
59
  requirements: []
53
- rubyforge_project:
60
+ rubyforge_project: kat
54
61
  rubygems_version: 2.0.3
55
62
  signing_key:
56
63
  specification_version: 4