arxiv 0.1.5 → 0.1.8

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: fc827075fdc09f8fb533e604a167f33287097e6d
4
+ data.tar.gz: d3a1194f2fa02a63fa8e1700d004104c77b540a7
5
5
  SHA512:
6
- metadata.gz: 0273f198800bf6e4f9c26280baf5ea96d970e9aecf3cfb03da8f434877219786658aee95a570d78dd55fd231e36684f8490abf46e84531283b2e670c6d41b7d3
7
- data.tar.gz: a346fca87434112820fd44407d4f45ddce88bc38abceb16c4ed84c51d5c781249a8028b416840025c1fb3b51a51af51d1d9ae075492f9ded4c85569e20e0f09f
6
+ metadata.gz: eb36d490ccab9bec0853fcf65bc0da553e0721714d96e00864c01bf51697ea3a95d97e94899e3df768ea2e0fc1e68c500574b67a46d025af0044572db69395f2
7
+ data.tar.gz: 82d80bf60f85deaf5809ad6c0da2bbffa92b5f367d8ad6d0586bd858a6656f24d9e5381e38516c0870b8168d860b13788088ec3d09bbd2639d2ce8cd53181868
@@ -0,0 +1,34 @@
1
+ name: ci
2
+ on:
3
+ push:
4
+ jobs:
5
+ test:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
12
+ - name: Install dependencies
13
+ run: bundle install
14
+ - name: Run tests
15
+ run: rspec .
16
+
17
+ deploy:
18
+ name: Build and publish gem
19
+ if: github.ref == 'refs/heads/main' && needs.test.result == 'success'
20
+ needs: test
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - name: Set up Ruby
26
+ uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
27
+ - name: Publish to GPR
28
+ run: |
29
+ curl -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
30
+ gem build arxiv.gemspec
31
+ gem push `ls | grep *.gem`
32
+ env:
33
+ RUBYGEMS_USERNAME: "${{ secrets.RUBYGEMS_USERNAME }}"
34
+ RUBYGEMS_PASSWORD: "${{ secrets.RUBYGEMS_PASSWORD }}"
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
+
data/arxiv.gemspec CHANGED
@@ -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'
@@ -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
data/lib/arxiv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arxiv
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.8"
3
3
  end
data/lib/arxiv.rb CHANGED
@@ -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'
@@ -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.8
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: 2022-04-28 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
@@ -92,6 +106,7 @@ executables: []
92
106
  extensions: []
93
107
  extra_rdoc_files: []
94
108
  files:
109
+ - ".github/workflows/ci.yml"
95
110
  - ".gitignore"
96
111
  - ".rspec"
97
112
  - ".ruby-gemset"
@@ -101,7 +116,6 @@ files:
101
116
  - README.md
102
117
  - Rakefile
103
118
  - arxiv.gemspec
104
- - circle.yml
105
119
  - lib/arxiv.rb
106
120
  - lib/arxiv/data/category_abbreviation_to_label_mapping.xml
107
121
  - lib/arxiv/models/author.rb
@@ -136,14 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
150
  version: '0'
137
151
  requirements: []
138
152
  rubyforge_project: arxiv
139
- rubygems_version: 2.4.6
153
+ rubygems_version: 2.4.5.5
140
154
  signing_key:
141
155
  specification_version: 4
142
156
  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
157
+ 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`