arxivsync 0.0.5 → 0.0.6
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 +7 -0
- data/Gemfile +1 -0
- data/README.md +14 -10
- data/Rakefile +5 -0
- data/arxivsync.gemspec +4 -2
- data/bin/arxivsync +28 -0
- data/lib/arxivsync/downloader.rb +6 -6
- data/lib/arxivsync/parser.rb +51 -41
- data/lib/arxivsync/version.rb +1 -1
- data/lib/arxivsync/xmlarchive.rb +19 -9
- data/lib/arxivsync.rb +1 -0
- data/test/fixtures/47001 +23613 -0
- data/test/parser_test.rb +55 -0
- data/test/test_helper.rb +3 -0
- metadata +58 -40
- data/test/fixtures/406001.xml +0 -23932
- data/test/parser.rb +0 -37
data/test/parser.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'arxivsync'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
|
4
|
-
TEST_ROOT = File.dirname(__FILE__)
|
5
|
-
|
6
|
-
class TestParser < Minitest::Test
|
7
|
-
def test_parser
|
8
|
-
archive = ArxivSync::XMLArchive.new(File.join(TEST_ROOT, 'fixtures'))
|
9
|
-
tested = 0
|
10
|
-
archive.read_metadata do |papers|
|
11
|
-
assert_equal papers.count, 1000
|
12
|
-
papers.each do |paper|
|
13
|
-
if paper.id == "1302.0649"
|
14
|
-
assert_equal paper.created, Date.parse("2013-02-04")
|
15
|
-
assert_equal paper.updated, nil
|
16
|
-
assert_equal paper.title, "Correlation effects in the electronic structure of the Ni-based superconducting KNi2S2"
|
17
|
-
assert_equal paper.license, "http://creativecommons.org/licenses/by/3.0/"
|
18
|
-
assert_equal paper.primary_category, "cond-mat.supr-con"
|
19
|
-
assert_equal paper.crosslists, []
|
20
|
-
assert_includes paper.abstract, "using Gutzwiller approximation method."
|
21
|
-
assert_equal paper.authors.map(&:keyname), ["Lu", "Wang", "Xie", "Zhang"]
|
22
|
-
assert_equal paper.authors.map(&:forenames), ["Feng", "Wei-Hua", "Xinjian", "Fu-Chun"]
|
23
|
-
tested += 1
|
24
|
-
end
|
25
|
-
|
26
|
-
if paper.id == "1302.0758"
|
27
|
-
assert_equal paper.authors[0].affiliation, "Baylor University, Waco, TX, USA"
|
28
|
-
assert_equal paper.comments, "8 pages, 4 figures; presented by BFLW at ICHEP 2012"
|
29
|
-
assert_equal paper.report_no, "BU-HEPP-12-05"
|
30
|
-
tested += 1
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
assert_equal tested, 2
|
36
|
-
end
|
37
|
-
end
|