arxiv 0.1.5 → 0.1.6

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: ce7996cf522e9c90561c0a9515aa22f613124d22
4
- data.tar.gz: 0cf53c4ddba5b607f90778c5702de317177b0c1f
3
+ metadata.gz: 57c2d60dbea09301f79c3e2ab2af5f4ce5b419ea
4
+ data.tar.gz: 67f6450e1f727139d09641219cf7d9720610bf47
5
5
  SHA512:
6
- metadata.gz: 0273f198800bf6e4f9c26280baf5ea96d970e9aecf3cfb03da8f434877219786658aee95a570d78dd55fd231e36684f8490abf46e84531283b2e670c6d41b7d3
7
- data.tar.gz: a346fca87434112820fd44407d4f45ddce88bc38abceb16c4ed84c51d5c781249a8028b416840025c1fb3b51a51af51d1d9ae075492f9ded4c85569e20e0f09f
6
+ metadata.gz: bd230edaa1bcde285aff1a5b32988d0070daf87c0f607b4985ce97685d5f7febcfa0c49ab37ab88ba4d71ebe051d6f3dbd52d0670041443ab37a0590d2d30d45
7
+ data.tar.gz: f76d69cfa8f11d7679c6a7f2db902da22a182a466bbacbe8a27b11fef5dbe0bb5315eb4fb8988b0f150a40a7ac86d99f1b85af179e1812218b6821af8cc84721
data/README.md CHANGED
@@ -37,4 +37,5 @@ Look at a manuscript's categories:
37
37
  manuscript.primary_category.description # => "Physics - Instrumentation and Methods for Astrophysics"
38
38
 
39
39
  ### License
40
- This is an open source project built by {Scholastica}[https://scholasticahq.com] under the {MIT-LICENSE}[https://github.com/scholastica/timber/blob/master/MIT-LICENSE].
40
+ This is an open source project built by [Scholastica](https://scholasticahq.com) under the [MIT-LICENSE](https://github.com/scholastica/timber/blob/master/MIT-LICENSE).
41
+
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  # specify any dependencies here; for example:
22
22
  s.add_runtime_dependency "happymapper", '~> 0.4', '>= 0.4.1'
23
23
  s.add_runtime_dependency "nokogiri", '~> 1.6', '>= 1.6.6.2'
24
+ s.add_runtime_dependency "full-name-splitter", '~> 0.1.2'
24
25
 
25
26
  s.add_development_dependency "rspec", '~> 3.3', '>= 3.3.0'
26
27
  s.add_development_dependency "pry", '~> 0.10.2'
@@ -1,6 +1,7 @@
1
1
  require 'open-uri'
2
2
  require 'nokogiri'
3
3
  require 'happymapper'
4
+ require 'full-name-splitter'
4
5
 
5
6
  require 'arxiv/version'
6
7
  require 'arxiv/string_scrubber'
@@ -3,5 +3,25 @@ module Arxiv
3
3
  include HappyMapper
4
4
  element :name, StringScrubber, parser: :scrub
5
5
  has_many :affiliations, StringScrubber, parser: :scrub, tag: 'affiliation'
6
+
7
+ # Unfortunately, the ArXiv API does not provide separate attributes for
8
+ # `author.first_name` and `author.last_name`; it only provides a single
9
+ # `author.name` attribute.
10
+ #
11
+ # Yet most standards within academic publishing (e.g. JATS XML) prefer to
12
+ # differentiate first name and last name of authors. To support that
13
+ # expectation, we've split the name value (leveraging a third-party gem).
14
+ # Ideally, ArXiv would provide this data directly. But until then, this
15
+ # solution should be suitable.
16
+ #
17
+ def first_name
18
+ FullNameSplitter.split(name).first
19
+ end
20
+
21
+ # See code comment for `first_name`.
22
+ #
23
+ def last_name
24
+ FullNameSplitter.split(name).last
25
+ end
6
26
  end
7
27
  end
@@ -1,3 +1,3 @@
1
1
  module Arxiv
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -10,6 +10,18 @@ module Arxiv
10
10
  end
11
11
  end
12
12
 
13
+ describe "first_name" do
14
+ it "should return the author's first name" do
15
+ expect(@author.first_name).to eql("Michael T.")
16
+ end
17
+ end
18
+
19
+ describe "last_name" do
20
+ it "should return the author's last name" do
21
+ expect(@author.last_name).to eql("Murphy")
22
+ end
23
+ end
24
+
13
25
  describe "affiliations" do
14
26
  it "should return an array of the author's affiliations" do
15
27
  expect(@author.affiliations).to include("Swinburne University of Technology")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arxiv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scholastica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: happymapper
@@ -50,6 +50,20 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.6.6.2
53
+ - !ruby/object:Gem::Dependency
54
+ name: full-name-splitter
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: 0.1.2
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: 0.1.2
53
67
  - !ruby/object:Gem::Dependency
54
68
  name: rspec
55
69
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +115,6 @@ files:
101
115
  - README.md
102
116
  - Rakefile
103
117
  - arxiv.gemspec
104
- - circle.yml
105
118
  - lib/arxiv.rb
106
119
  - lib/arxiv/data/category_abbreviation_to_label_mapping.xml
107
120
  - lib/arxiv/models/author.rb
@@ -136,14 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
149
  version: '0'
137
150
  requirements: []
138
151
  rubyforge_project: arxiv
139
- rubygems_version: 2.4.6
152
+ rubygems_version: 2.6.13
140
153
  signing_key:
141
154
  specification_version: 4
142
155
  summary: Ruby wrapper accessing the arXiv API
143
- test_files:
144
- - spec/arxiv/arxiv_spec.rb
145
- - spec/arxiv/models/author_spec.rb
146
- - spec/arxiv/models/category_spec.rb
147
- - spec/arxiv/models/link_spec.rb
148
- - spec/arxiv/models/manuscript_spec.rb
149
- - spec/spec_helper.rb
156
+ test_files: []
data/circle.yml DELETED
@@ -1,10 +0,0 @@
1
- dependencies:
2
- pre:
3
- - "echo -e '---\n:rubygems_api_key: '$RUBYGEMS_API_KEY > ~/.gem/credentials"
4
- - chmod 0600 ~/.gem/credentials
5
- deployment:
6
- production:
7
- branch: master
8
- commands:
9
- - gem build arxiv.gemspec
10
- - gem push `ls | grep *.gem`