arxiv-references 0.1.6.0 → 0.1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arxiv/references/ArxivReferences.rb +10 -3
- data/lib/arxiv/references/myUtil.rb +2 -2
- data/lib/arxiv/references/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f98d61ad3ab3665e3564ef46e200749d1eb2b8d
|
4
|
+
data.tar.gz: 03a315d483a9a1e2ec3c73dfd38eccf0104c06d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6f4511587087594a703a6354d30efda68f46d33abcfabcc0a2bf258a910793aac607a24075fd9f5684d9b1c6fe9290fad4561405f7b4469ee76621c89925f4
|
7
|
+
data.tar.gz: fa9c34ed375be0dd83e1ae1ecd77484ed157edceaf20bc5efb37ec97c5c9fcb6834299d40929ca9614cae63a9c5aa2bb7be2257c7567311f8e096ea56c7f0f6c
|
@@ -12,22 +12,29 @@ module ArxivReferences
|
|
12
12
|
include ArxivUtil
|
13
13
|
desc 'url', 'Extract references from arxiv URL'
|
14
14
|
option 'work_dir', type: :string, aliases: '-work', desc: 'Set working dir(default: /tmp)'
|
15
|
+
option 'use_dir', type: :boolean, aliases: '-use_dir', desc: 'work to make dir or not(default: true)'
|
15
16
|
def url(urlName)
|
16
|
-
|
17
|
+
work_dir = options['work_dir'].nil? ? '/tmp' : options['work_dir']
|
18
|
+
use_dir = options['use_dir'].nil? ? true : options['use_dir']
|
19
|
+
puts ArxivUtil.fetchFromUrl(urlName, work_dir, use_dir)
|
17
20
|
end
|
18
21
|
|
19
22
|
desc 'id', 'Extract references from Arxiv id'
|
20
23
|
option 'work_dir', type: :string, aliases: '-work', desc: 'Set working dir(default: /tmp)'
|
24
|
+
option 'use_dir', type: :boolean, aliases: '-use_dir', desc: 'work to make dir or not(default: true)'
|
21
25
|
def arxivid(idName)
|
22
26
|
work_dir = options['work_dir'].nil? ? '/tmp' : options['work_dir']
|
23
|
-
|
27
|
+
use_dir = options['use_dir'].nil? ? true : options['use_dir']
|
28
|
+
puts ArxivUtil.fetchFromArxivId(idName, work_dir, use_dir)
|
24
29
|
end
|
25
30
|
|
26
31
|
desc 'pdfurl', 'Extract references from pdf URL'
|
27
32
|
option 'work_dir', type: :string, aliases: '-work', desc: 'Set working dir(default: /tmp)'
|
33
|
+
option 'use_dir', type: :boolean, aliases: '-use_dir', desc: 'work to make dir or not(default: true)'
|
28
34
|
def pdfurl(pdfUrlName)
|
29
35
|
work_dir = options['work_dir'].nil? ? '/tmp' : options['work_dir']
|
30
|
-
|
36
|
+
use_dir = options['use_dir'].nil? ? true : options['use_dir']
|
37
|
+
puts ArxivUtil.fetchFromPdfUrl(pdfUrlName, work_dir, use_dir)
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
@@ -58,9 +58,9 @@ module ArxivUtil
|
|
58
58
|
return result.to_json
|
59
59
|
end
|
60
60
|
|
61
|
-
def self.fetchFromArxivId(id, work_dir)
|
61
|
+
def self.fetchFromArxivId(id, work_dir, use_dir)
|
62
62
|
target_url = "#{BASE_URL}/abs/#{id}"
|
63
|
-
fetchFromUrl(target_url, work_dir)
|
63
|
+
fetchFromUrl(target_url, work_dir, use_dir)
|
64
64
|
end
|
65
65
|
|
66
66
|
def self.fetchPdfFile(pdfUrl,file_name)
|