piratebay_api 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b168ff9781dba400bb077b9b0cbdb3d97bf76085
4
- data.tar.gz: dbcd7cccc20114078141a9f2ed5ddead8c83dfb8
3
+ metadata.gz: e88cc90ff0ba7d281a6265ebdcce9d3db993107e
4
+ data.tar.gz: 405bf3b6dff50f672241c714734d10174c1a16ed
5
5
  SHA512:
6
- metadata.gz: 3eac4a62f5207e014004562e2fc36fd2c3f5b0f464a54e9efa083fd2d711a1f71559505f0e1296adb41bf615737ea6522f63466cf2c711527d4f8295ef6b4326
7
- data.tar.gz: 06b9e4dacc4ccf9e557f98649c36f0b1925b2d8a3ae8f3c61f5851c3c42366d444978c54e9b0d3042982631326b6a1831d339171b6ae54aa8847799ce4a9f88f
6
+ metadata.gz: 52c5e371feeddf85ebaede5519a6cb739aaf15b1a27dee61b77160865dba7242275103868701a6483fc74acbcbddc4fc7f0c4fbf7cc969d0334b80b8c2973036
7
+ data.tar.gz: cdae071db1552fabcf4451b02403b21ca7c28b2f4c42bc8fc90e4e4f836463f35194805354db7ed3bb2365095c5fec54bc4e74cc0986867d34f55a7335c49abe
data/.idea/workspace.xml CHANGED
@@ -29,11 +29,11 @@
29
29
  </component>
30
30
  <component name="FileEditorManager">
31
31
  <leaf>
32
- <file leaf-file-name="piratebay_api.rb" pinned="false" current-in-tab="false">
32
+ <file leaf-file-name="piratebay_api.rb" pinned="false" current-in-tab="true">
33
33
  <entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
34
34
  <provider selected="true" editor-type-id="text-editor">
35
- <state vertical-scroll-proportion="0.0">
36
- <caret line="30" column="59" selection-start-line="30" selection-start-column="59" selection-end-line="30" selection-end-column="59" />
35
+ <state vertical-scroll-proportion="0.58093524">
36
+ <caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
37
37
  <folding />
38
38
  </state>
39
39
  </provider>
@@ -79,10 +79,10 @@
79
79
  </provider>
80
80
  </entry>
81
81
  </file>
82
- <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
82
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
83
83
  <entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
84
84
  <provider selected="true" editor-type-id="text-editor">
85
- <state vertical-scroll-proportion="0.03057554">
85
+ <state vertical-scroll-proportion="0.0">
86
86
  <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
87
87
  <folding />
88
88
  </state>
@@ -120,9 +120,9 @@
120
120
  <option value="$PROJECT_DIR$/piratebay_api.gemspec" />
121
121
  <option value="$PROJECT_DIR$/lib/piratebay_api/details.rb" />
122
122
  <option value="$PROJECT_DIR$/lib/piratebay_api/result.rb" />
123
- <option value="$PROJECT_DIR$/lib/piratebay_api.rb" />
124
123
  <option value="$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb" />
125
124
  <option value="$PROJECT_DIR$/lib/piratebay_api/version.rb" />
125
+ <option value="$PROJECT_DIR$/lib/piratebay_api.rb" />
126
126
  </list>
127
127
  </option>
128
128
  </component>
@@ -556,18 +556,18 @@
556
556
  </state>
557
557
  </provider>
558
558
  </entry>
559
- <entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
559
+ <entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
560
560
  <provider selected="true" editor-type-id="text-editor">
561
561
  <state vertical-scroll-proportion="0.0">
562
- <caret line="30" column="59" selection-start-line="30" selection-start-column="59" selection-end-line="30" selection-end-column="59" />
562
+ <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
563
563
  <folding />
564
564
  </state>
565
565
  </provider>
566
566
  </entry>
567
- <entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
567
+ <entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
568
568
  <provider selected="true" editor-type-id="text-editor">
569
- <state vertical-scroll-proportion="0.03057554">
570
- <caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
569
+ <state vertical-scroll-proportion="0.58093524">
570
+ <caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
571
571
  <folding />
572
572
  </state>
573
573
  </provider>
data/lib/piratebay_api.rb CHANGED
@@ -17,10 +17,11 @@ end
17
17
  class PiratebayApi
18
18
  attr_accessor :service, :search_term, :results
19
19
 
20
- def initialize(service=:pirate_bay, search_term=nil, url)
20
+ def initialize(service=:pirate_bay, search_term=nil, url, category=0)
21
21
  @service = service
22
22
  @search_term = search_term
23
23
  @base_url = url
24
+ @category = category
24
25
 
25
26
  @results = search if @search_term
26
27
  end
@@ -28,12 +29,12 @@ class PiratebayApi
28
29
  def search
29
30
  if @service == :all
30
31
  results = []
31
- results << PirateBay::Search.new(@search_term, 0, @base_url).execute
32
+ results << PirateBay::Search.new(@search_term, @category, @base_url).execute
32
33
  results = results.flatten.sort_by { |sort| -(sort.seeds) }
33
34
  else
34
35
  case @service
35
36
  when :pirate_bay
36
- handler = PirateBay::Search.new(@search_term, 0, @base_url)
37
+ handler = PirateBay::Search.new(@search_term, @category, @base_url)
37
38
  else
38
39
  raise 'You must select a valid service provider'
39
40
  end
@@ -1,3 +1,3 @@
1
1
  class PiratebayApi
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piratebay_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dani