book_finder 0.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/book_finder.rb +30 -0
  3. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d8d51b5fa354ae3959aa8c9166a99537672ea97481c185555fe144f0a984f976
4
+ data.tar.gz: d6454818e1e2fa03e9146d754952366ca1952636dd7587e35ddeadae66046749
5
+ SHA512:
6
+ metadata.gz: d0cac05529d2e864dabf246f85b57f6764648ab56821e48f8a6beed6479b056cb72c3fd8206e4a3ab922f63f32aeadd0b90dcd9839cead4e0bfb9a9259b8d948
7
+ data.tar.gz: dcb3d4ee6dba3eca37cae82d1291d14ebdd8e67aa1fc17cb5d8c3a4b1f25840f84e68d38ecc95737ad9dcc8a5ee0226fe74c3e1ec9a24cc2e76254f2ff5ab4aa
@@ -0,0 +1,30 @@
1
+ require "./bok.rb"
2
+ require "./libgen.rb"
3
+
4
+ class BookFinder
5
+
6
+ def initialize
7
+ @libgen = Libgen.new
8
+ @bok = Bok.new
9
+ @result = []
10
+ end
11
+
12
+ def search(api: nil, params: {})
13
+
14
+ @result = []
15
+
16
+ return :PARAMS_MISSING if params.empty?
17
+
18
+ if api == nil || api.downcase == "libgen"
19
+ @result += @libgen.search(params)
20
+ end
21
+
22
+ if api == nil || api.downcase == "bok"
23
+ @result += @bok.search(params)
24
+ end
25
+
26
+ @result
27
+
28
+ end
29
+
30
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: book_finder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Amezcua
8
+ - Alejandro Zaizar
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2019-10-30 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description:
15
+ email:
16
+ - gerald.amezcua@michelada.io
17
+ - alejandro.zaizar@michelada.io
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - lib/book_finder.rb
23
+ homepage: ''
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubygems_version: 3.0.3
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: A gem to find books on libgen and b-ok sites
46
+ test_files: []