orcid_client 0.9 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +4 -4
  3. data/.github/workflows/release.yml +4 -5
  4. data/CHANGELOG.md +173 -0
  5. data/Gemfile.lock +28 -30
  6. data/README.md +6 -6
  7. data/lib/orcid_client/api.rb +1 -0
  8. data/lib/orcid_client/base.rb +1 -1
  9. data/lib/orcid_client/version.rb +1 -1
  10. data/lib/orcid_client/work.rb +7 -4
  11. data/orcid_client.gemspec +2 -3
  12. data/spec/api_spec.rb +3 -3
  13. data/spec/author_spec.rb +1 -1
  14. data/spec/fixtures/vcr_cassettes/OrcidClient/works/get/should_get_works.yml +10 -6
  15. data/spec/fixtures/vcr_cassettes/OrcidClient/works/post/should_create_work.yml +47 -64
  16. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/data.yml +30 -49
  17. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_data.yml +29 -48
  18. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_item_type_work.yml +23 -20
  19. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/literal.yml +28 -49
  20. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/valid.yml +27 -42
  21. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/with_ORCID_IDs.yml +25 -22
  22. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/data.yml +27 -42
  23. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/publication_date.yml +27 -42
  24. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_ORCID_IDs_for_contributors.yml +25 -22
  25. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_data.yml +26 -41
  26. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_from_DataCite_staging_system.yml +104 -0
  27. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_type_data-set.yml +27 -24
  28. data/spec/fixtures/work.xml +11 -15
  29. data/spec/notification_spec.rb +9 -8
  30. data/spec/work_spec.rb +24 -61
  31. metadata +9 -26
  32. data/.travis.yml +0 -17
  33. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/multiple_titles.yml +0 -109
  34. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_from_DataCite_test_system.yml +0 -101
  35. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/user_example/fail/valid.yml +0 -101
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0d73c24088b4b09aa9c5efe1b99acd7345230e1f9d70166d85ce8367f6186c7
4
- data.tar.gz: 9365924ac2e44d79b64b54d105274a890423efdb4625e4a13a75e36a7d0dbff7
3
+ metadata.gz: 1bbdf8d446414570ce790541a828928b293809228e29c99bd718f00c8c9579a7
4
+ data.tar.gz: 6aac2bd78fc890f7f5e5fb9bd0e8e3accecabdcf280bbfc4229865615d44c195
5
5
  SHA512:
6
- metadata.gz: 49c0cb3cffa12e31e1a11350cf0095433fd2c857628f316753f6ccfc42395954fb49b20e6adec2d5befcd87d08497ea25a019ecb16496b874c1d063aaf87c7a6
7
- data.tar.gz: b40c823a504f4333a096fddc6e722188eb78e6cc85e558b998fbc8ebcfa60c05b6301b48461ae1e8e07d7047238d2181bf478f121538f1efa3f836b1f0ba8528
6
+ metadata.gz: e3a2a8be09010c7e22f0bb48bc6bcbab495ceed815e261a86e3b96debe24d45ba6b66627e632ff99595f378f94a83ff6599180ba71615de194509f380600dd32
7
+ data.tar.gz: a5699d857d001c9d2e5f840e8d00084ef1b21d859fb5f384251f66058a768ca8fb91ff21c043a87b4091881340e9bc001249f7b073c7955b9fd667f150518b12
@@ -24,10 +24,10 @@ jobs:
24
24
  bundle install
25
25
  bundle exec rspec
26
26
 
27
- - name: Publish code coverage
28
- uses: paambaati/codeclimate-action@v2.7.4
29
- env:
30
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
27
+ # - name: Publish code coverage
28
+ # uses: paambaati/codeclimate-action@v2.7.4
29
+ # env:
30
+ # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
31
31
 
32
32
  - name: Notify Slack
33
33
  uses: adamkdean/simple-slack-notify@1.0.4
@@ -23,11 +23,10 @@ jobs:
23
23
  bundle install
24
24
  bundle exec rspec spec
25
25
 
26
- - name: Code Climate Test Reporter
27
- uses: aktions/codeclimate-test-reporter@v1
28
- with:
29
- codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
30
- command: after-build
26
+ # - name: Publish code coverage
27
+ # uses: paambaati/codeclimate-action@v2.7.4
28
+ # env:
29
+ # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
31
30
 
32
31
  - name: Publish to RubyGems
33
32
  run: |
data/CHANGELOG.md CHANGED
@@ -0,0 +1,173 @@
1
+ # Changelog
2
+
3
+ ## [0.9.5.1](https://github.com/datacite/orcid_client/tree/0.9.5.1) (2021-09-29)
4
+
5
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9.5...0.9.5.1)
6
+
7
+ ## [0.9.5](https://github.com/datacite/orcid_client/tree/0.9.5) (2021-09-29)
8
+
9
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9.4...0.9.5)
10
+
11
+ ## [0.9.4](https://github.com/datacite/orcid_client/tree/0.9.4) (2021-06-09)
12
+
13
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9.3...0.9.4)
14
+
15
+ ## [0.9.3](https://github.com/datacite/orcid_client/tree/0.9.3) (2021-06-04)
16
+
17
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9.2...0.9.3)
18
+
19
+ ## [0.9.2](https://github.com/datacite/orcid_client/tree/0.9.2) (2021-06-04)
20
+
21
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9.1...0.9.2)
22
+
23
+ ## [0.9.1](https://github.com/datacite/orcid_client/tree/0.9.1) (2021-06-04)
24
+
25
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/0.9...0.9.1)
26
+
27
+ **Implemented enhancements:**
28
+
29
+ - Upgrade to ORCID schema 3.0 [\#12](https://github.com/datacite/orcid_client/issues/12)
30
+
31
+ ## [0.9](https://github.com/datacite/orcid_client/tree/0.9) (2021-06-04)
32
+
33
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.8...0.9)
34
+
35
+ **Merged pull requests:**
36
+
37
+ - Update nokogiri requirement from ~\> 1.10.4 to \>= 1.10.4, \< 1.12.0 [\#13](https://github.com/datacite/orcid_client/pull/13) ([dependabot[bot]](https://github.com/apps/dependabot))
38
+
39
+ ## [v.0.8](https://github.com/datacite/orcid_client/tree/v.0.8) (2019-10-09)
40
+
41
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.6.2...v.0.8)
42
+
43
+ ## [v.0.6.2](https://github.com/datacite/orcid_client/tree/v.0.6.2) (2019-09-14)
44
+
45
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.6.1...v.0.6.2)
46
+
47
+ ## [v.0.6.1](https://github.com/datacite/orcid_client/tree/v.0.6.1) (2019-09-14)
48
+
49
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.6.0...v.0.6.1)
50
+
51
+ ## [v.0.6.0](https://github.com/datacite/orcid_client/tree/v.0.6.0) (2019-09-14)
52
+
53
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.5.2...v.0.6.0)
54
+
55
+ ## [v.0.5.2](https://github.com/datacite/orcid_client/tree/v.0.5.2) (2019-09-01)
56
+
57
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.5.1...v.0.5.2)
58
+
59
+ ## [v.0.5.1](https://github.com/datacite/orcid_client/tree/v.0.5.1) (2018-12-30)
60
+
61
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.5...v.0.5.1)
62
+
63
+ ## [v.0.5](https://github.com/datacite/orcid_client/tree/v.0.5) (2018-12-30)
64
+
65
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.4.4...v.0.5)
66
+
67
+ **Fixed bugs:**
68
+
69
+ - update bolognese gem [\#4](https://github.com/datacite/orcid_client/issues/4)
70
+
71
+ ## [v.0.4.4](https://github.com/datacite/orcid_client/tree/v.0.4.4) (2018-12-13)
72
+
73
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.4.3...v.0.4.4)
74
+
75
+ ## [v.0.4.3](https://github.com/datacite/orcid_client/tree/v.0.4.3) (2018-12-12)
76
+
77
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.4.1...v.0.4.3)
78
+
79
+ **Merged pull requests:**
80
+
81
+ - Chore update Bolognese [\#3](https://github.com/datacite/orcid_client/pull/3) ([kjgarza](https://github.com/kjgarza))
82
+
83
+ ## [v.0.4.1](https://github.com/datacite/orcid_client/tree/v.0.4.1) (2018-04-11)
84
+
85
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.4.2...v.0.4.1)
86
+
87
+ ## [v.0.4.2](https://github.com/datacite/orcid_client/tree/v.0.4.2) (2018-04-11)
88
+
89
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.4...v.0.4.2)
90
+
91
+ ## [v.0.4](https://github.com/datacite/orcid_client/tree/v.0.4) (2018-04-11)
92
+
93
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.3.3...v.0.4)
94
+
95
+ **Closed issues:**
96
+
97
+ - Upgrade to ORCID API 2.1 [\#2](https://github.com/datacite/orcid_client/issues/2)
98
+
99
+ ## [v.0.3.3](https://github.com/datacite/orcid_client/tree/v.0.3.3) (2017-06-25)
100
+
101
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.3.2...v.0.3.3)
102
+
103
+ ## [v.0.3.2](https://github.com/datacite/orcid_client/tree/v.0.3.2) (2017-06-25)
104
+
105
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.3.1...v.0.3.2)
106
+
107
+ **Implemented enhancements:**
108
+
109
+ - Upgrade to ORCID API 2.0 [\#1](https://github.com/datacite/orcid_client/issues/1)
110
+
111
+ ## [v.0.3.1](https://github.com/datacite/orcid_client/tree/v.0.3.1) (2017-06-20)
112
+
113
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.3.0...v.0.3.1)
114
+
115
+ ## [v.0.3.0](https://github.com/datacite/orcid_client/tree/v.0.3.0) (2017-06-20)
116
+
117
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.2.3...v.0.3.0)
118
+
119
+ ## [v.0.2.3](https://github.com/datacite/orcid_client/tree/v.0.2.3) (2017-02-04)
120
+
121
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.2.2...v.0.2.3)
122
+
123
+ ## [v.0.2.2](https://github.com/datacite/orcid_client/tree/v.0.2.2) (2017-02-02)
124
+
125
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.2.1...v.0.2.2)
126
+
127
+ ## [v.0.2.1](https://github.com/datacite/orcid_client/tree/v.0.2.1) (2016-11-27)
128
+
129
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.2...v.0.2.1)
130
+
131
+ ## [v.0.2](https://github.com/datacite/orcid_client/tree/v.0.2) (2016-11-27)
132
+
133
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.8...v.0.2)
134
+
135
+ ## [v.0.1.8](https://github.com/datacite/orcid_client/tree/v.0.1.8) (2016-11-26)
136
+
137
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.7...v.0.1.8)
138
+
139
+ ## [v.0.1.7](https://github.com/datacite/orcid_client/tree/v.0.1.7) (2016-11-26)
140
+
141
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.6...v.0.1.7)
142
+
143
+ ## [v.0.1.6](https://github.com/datacite/orcid_client/tree/v.0.1.6) (2016-11-26)
144
+
145
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.5...v.0.1.6)
146
+
147
+ ## [v.0.1.5](https://github.com/datacite/orcid_client/tree/v.0.1.5) (2016-11-26)
148
+
149
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.4...v.0.1.5)
150
+
151
+ ## [v.0.1.4](https://github.com/datacite/orcid_client/tree/v.0.1.4) (2016-11-25)
152
+
153
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.3...v.0.1.4)
154
+
155
+ ## [v.0.1.3](https://github.com/datacite/orcid_client/tree/v.0.1.3) (2016-11-22)
156
+
157
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.2...v.0.1.3)
158
+
159
+ ## [v.0.1.2](https://github.com/datacite/orcid_client/tree/v.0.1.2) (2016-11-18)
160
+
161
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1.1...v.0.1.2)
162
+
163
+ ## [v.0.1.1](https://github.com/datacite/orcid_client/tree/v.0.1.1) (2016-11-18)
164
+
165
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/v.0.1...v.0.1.1)
166
+
167
+ ## [v.0.1](https://github.com/datacite/orcid_client/tree/v.0.1) (2016-11-18)
168
+
169
+ [Full Changelog](https://github.com/datacite/orcid_client/compare/294490e0ece587608be60f8d8c3085baf2f171e7...v.0.1)
170
+
171
+
172
+
173
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orcid_client (0.9)
4
+ orcid_client (0.9.6)
5
5
  activesupport (>= 4.2.5, < 6)
6
- bolognese (~> 1.3, >= 1.3.19)
6
+ bolognese (~> 1.3, >= 1.9.8)
7
7
  builder (~> 3.2, >= 3.2.2)
8
8
  dotenv (~> 2.1, >= 2.1.1)
9
9
  maremma (>= 4.4)
@@ -24,7 +24,7 @@ GEM
24
24
  benchmark_methods (0.7)
25
25
  bibtex-ruby (6.0.0)
26
26
  latex-decode (~> 0.0)
27
- bolognese (1.9.7)
27
+ bolognese (1.9.12)
28
28
  activesupport (>= 4.2.5)
29
29
  benchmark_methods (~> 0.7)
30
30
  bibtex-ruby (>= 5.1.0)
@@ -40,7 +40,7 @@ GEM
40
40
  json-ld-preloaded (~> 3.1, >= 3.1.3)
41
41
  jsonlint (~> 0.3.0)
42
42
  loofah (~> 2.0, >= 2.0.3)
43
- maremma (>= 4.7, < 5)
43
+ maremma (>= 4.9.4, < 5)
44
44
  namae (~> 1.0)
45
45
  nokogiri (~> 1.11.2)
46
46
  oj (~> 3.10)
@@ -52,24 +52,23 @@ GEM
52
52
  builder (3.2.4)
53
53
  citeproc (1.0.10)
54
54
  namae (~> 1.0)
55
- citeproc-ruby (1.1.13)
55
+ citeproc-ruby (1.1.14)
56
56
  citeproc (~> 1.0, >= 1.0.9)
57
- csl (~> 1.5)
58
- codeclimate-test-reporter (1.0.9)
59
- simplecov (<= 0.13)
57
+ csl (~> 1.6)
60
58
  colorize (0.8.1)
61
- concurrent-ruby (1.1.8)
59
+ concurrent-ruby (1.1.9)
62
60
  crack (0.4.5)
63
61
  rexml
64
62
  crass (1.0.6)
65
- csl (1.5.2)
63
+ csl (1.6.0)
66
64
  namae (~> 1.0)
65
+ rexml
67
66
  csl-styles (1.0.1.11)
68
67
  csl (~> 1.0)
69
68
  diff-lcs (1.4.4)
70
- docile (1.1.5)
69
+ docile (1.4.0)
71
70
  dotenv (2.7.6)
72
- ebnf (2.1.3)
71
+ ebnf (2.2.1)
73
72
  amazing_print (~> 1.2)
74
73
  htmlentities (~> 4.3)
75
74
  rdf (~> 3.1)
@@ -87,7 +86,7 @@ GEM
87
86
  faraday (>= 0.7.4, < 1.0)
88
87
  gender_detector (0.1.2)
89
88
  unicode_utils (>= 1.3.0)
90
- haml (5.2.1)
89
+ haml (5.2.2)
91
90
  temple (>= 0.8.0)
92
91
  tilt
93
92
  hamster (3.0.0)
@@ -97,16 +96,15 @@ GEM
97
96
  i18n (1.8.10)
98
97
  concurrent-ruby (~> 1.0)
99
98
  iso8601 (0.9.1)
100
- json (2.5.1)
101
99
  json-canonicalization (0.2.1)
102
- json-ld (3.1.9)
100
+ json-ld (3.1.10)
103
101
  htmlentities (~> 4.3)
104
102
  json-canonicalization (~> 0.2)
105
103
  link_header (~> 0.0, >= 0.0.8)
106
104
  multi_json (~> 1.14)
107
105
  rack (~> 2.0)
108
106
  rdf (~> 3.1)
109
- json-ld-preloaded (3.1.5)
107
+ json-ld-preloaded (3.1.6)
110
108
  json-ld (~> 3.1)
111
109
  rdf (~> 3.1)
112
110
  jsonlint (0.3.0)
@@ -114,10 +112,10 @@ GEM
114
112
  optimist (~> 3)
115
113
  latex-decode (0.3.2)
116
114
  link_header (0.0.8)
117
- loofah (2.9.1)
115
+ loofah (2.12.0)
118
116
  crass (~> 1.0.2)
119
117
  nokogiri (>= 1.5.9)
120
- maremma (4.7.4)
118
+ maremma (4.9.5)
121
119
  activesupport (>= 4.2.5)
122
120
  addressable (>= 2.3.6)
123
121
  builder (~> 3.2, >= 3.2.2)
@@ -136,7 +134,7 @@ GEM
136
134
  nokogiri (1.11.7)
137
135
  mini_portile2 (~> 2.5.0)
138
136
  racc (~> 1.4)
139
- oj (3.11.5)
137
+ oj (3.13.8)
140
138
  oj_mimic_json (1.0.1)
141
139
  optimist (3.0.1)
142
140
  postrank-uri (1.0.24)
@@ -149,7 +147,7 @@ GEM
149
147
  rack-test (0.8.3)
150
148
  rack (>= 1.0, < 3)
151
149
  rake (13.0.3)
152
- rdf (3.1.14)
150
+ rdf (3.1.15)
153
151
  hamster (~> 3.0)
154
152
  link_header (~> 0.0, >= 0.0.8)
155
153
  rdf-aggregate-repo (3.1.0)
@@ -169,7 +167,7 @@ GEM
169
167
  rdf-turtle (3.1.3)
170
168
  ebnf (~> 2.1)
171
169
  rdf (~> 3.1, >= 3.1.8)
172
- rdf-vocab (3.1.13)
170
+ rdf-vocab (3.1.14)
173
171
  rdf (~> 3.1, >= 3.1.12)
174
172
  rdf-xsd (3.1.1)
175
173
  rdf (~> 3.1)
@@ -189,11 +187,12 @@ GEM
189
187
  rspec-support (~> 3.10.0)
190
188
  rspec-support (3.10.2)
191
189
  scanf (1.0.0)
192
- simplecov (0.13.0)
193
- docile (~> 1.1.0)
194
- json (>= 1.8, < 3)
195
- simplecov-html (~> 0.10.0)
196
- simplecov-html (0.10.2)
190
+ simplecov (0.21.2)
191
+ docile (~> 1.1)
192
+ simplecov-html (~> 0.11)
193
+ simplecov_json_formatter (~> 0.1)
194
+ simplecov-html (0.12.3)
195
+ simplecov_json_formatter (0.1.3)
197
196
  sxp (1.1.0)
198
197
  rdf (~> 3.1)
199
198
  temple (0.8.2)
@@ -202,7 +201,7 @@ GEM
202
201
  tilt (2.0.10)
203
202
  tzinfo (1.2.9)
204
203
  thread_safe (~> 0.1)
205
- unicode-types (1.6.0)
204
+ unicode-types (1.7.0)
206
205
  unicode_utils (1.4.0)
207
206
  vcr (6.0.0)
208
207
  webmock (3.13.0)
@@ -214,8 +213,7 @@ PLATFORMS
214
213
  ruby
215
214
 
216
215
  DEPENDENCIES
217
- bundler (~> 1.0)
218
- codeclimate-test-reporter (~> 1.0.0)
216
+ bundler (>= 2.2.10)
219
217
  orcid_client!
220
218
  rack-test (~> 0)
221
219
  rake
@@ -225,4 +223,4 @@ DEPENDENCIES
225
223
  webmock (~> 3.0, >= 3.0.1)
226
224
 
227
225
  BUNDLED WITH
228
- 1.17.3
226
+ 2.2.28
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Ruby client for ORCID API
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/orcid_client.svg)](https://badge.fury.io/rb/orcid_client)
4
- [![Build Status](https://travis-ci.org/datacite/orcid_client.svg?branch=master)](https://travis-ci.org/datacite/orcid_client)
4
+ ![Build Ruby Gem](https://github.com/datacite/orcid_client/workflows/Build%20Ruby%20Gem/badge.svg)
5
5
  [![Test Coverage](https://codeclimate.com/github/datacite/orcid_client/badges/coverage.svg)](https://codeclimate.com/github/datacite/orcid_client/coverage)
6
6
  [![Code Climate](https://codeclimate.com/github/datacite/orcid_client/badges/gpa.svg)](https://codeclimate.com/github/datacite/orcid_client)
7
7
 
@@ -11,14 +11,14 @@ Ruby gem for integrating Ruby applications with the ORCID API.
11
11
 
12
12
  The following functionality is supported:
13
13
 
14
- * get all works from an ORCID record, including those set to limited access
15
- * create work in an ORCID record
16
- * create notification for an ORCID record (needs special permissions)
14
+ - get all works from an ORCID record, including those set to limited access
15
+ - create work in an ORCID record
16
+ - create notification for an ORCID record (needs special permissions)
17
17
 
18
18
  ## Requirements
19
19
 
20
- * [ORCID membership](https://orcid.org/about/membership), needed to create, update or delete content via the ORCID API
21
- * valid access tokens for ORCID user accounts, collected and safely stored in your application using for example the [omniauth-orcid](https://github.com/datacite/omniauth-orcid) gem.
20
+ - [ORCID membership](https://orcid.org/about/membership), needed to create, update or delete content via the ORCID API
21
+ - valid access tokens for ORCID user accounts, collected and safely stored in your application using for example the [omniauth-orcid](https://github.com/datacite/omniauth-orcid) gem.
22
22
 
23
23
  ## Installation
24
24
 
@@ -29,6 +29,7 @@ module OrcidClient
29
29
  return OpenStruct.new(body: { "errors" => [{ "title" => "ORCID access token missing" }] }) unless orcid_token.present?
30
30
  return OpenStruct.new(body: { "errors" => [{ "title" => "Put code missing" }] }) unless put_code.present?
31
31
 
32
+ self.visibility = nil
32
33
  orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
33
34
 
34
35
  url = "#{orcid_api_url}/v#{API_VERSION}/#{orcid}/work/#{put_code}"
@@ -18,6 +18,6 @@ module OrcidClient
18
18
 
19
19
  # default values for some ENV variables
20
20
  ENV['ORCID_API_URL'] ||= "https://api.sandbox.orcid.org"
21
- ENV['API_URL'] ||= "https://api.datacite.org"
21
+ ENV['API_URL'] ||= "https://api.stage.datacite.org"
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module OrcidClient
2
- VERSION = "0.9"
2
+ VERSION = "0.9.6"
3
3
  end
@@ -17,14 +17,17 @@ module OrcidClient
17
17
 
18
18
  include Bolognese::Utils
19
19
 
20
- attr_reader :doi, :orcid, :schema, :orcid_token, :sandbox, :put_code, :validation_errors, :name_detector
20
+ attr_reader :doi, :orcid, :schema, :orcid_token, :sandbox, :put_code, :visibility, :validation_errors, :name_detector
21
+
22
+ attr_writer :visibility
21
23
 
22
24
  def initialize(doi:, orcid:, orcid_token:, **options)
23
25
  @doi = doi
24
26
  @orcid = orcid
25
27
  @orcid_token = orcid_token
26
- @sandbox = options.fetch(:sandbox, nil) || ENV['API_URL'] == "https://api.test.datacite.org"
28
+ @sandbox = options.fetch(:sandbox, nil) || ENV['API_URL'] == "https://api.stage.datacite.org"
27
29
  @put_code = options.fetch(:put_code, nil)
30
+ @visibility = options.fetch(:visibility, 'public')
28
31
  end
29
32
 
30
33
  SCHEMA = File.expand_path("../../../resources/record_#{API_VERSION}/work-#{API_VERSION}.xsd", __FILE__)
@@ -42,7 +45,7 @@ module OrcidClient
42
45
  Array.wrap(metadata.creators).map do |contributor|
43
46
  orcid = Array.wrap(contributor["nameIdentifiers"]).find { |c| c["nameIdentifierScheme"] == "ORCID" }.to_h.fetch("nameIdentifier", nil)
44
47
  credit_name = contributor["familyName"].present? ? [contributor["givenName"], contributor["familyName"]].join(" ") : contributor["name"]
45
-
48
+
46
49
  { orcid: orcid,
47
50
  credit_name: credit_name,
48
51
  role: nil }.compact
@@ -179,7 +182,7 @@ module OrcidClient
179
182
 
180
183
  def root_attributes
181
184
  { :'put-code' => put_code,
182
- :'visibility' => 'public',
185
+ :'visibility' => visibility,
183
186
  :'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
184
187
  :'xsi:schemaLocation' => 'http://www.orcid.org/ns/work ../work-3.0.xsd',
185
188
  :'xmlns:common' => 'http://www.orcid.org/ns/common',
data/orcid_client.gemspec CHANGED
@@ -20,14 +20,13 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # Declary dependencies here, rather than in the Gemfile
22
22
  s.add_dependency 'activesupport', '>= 4.2.5', '< 6'
23
- s.add_dependency 'bolognese', '~> 1.3', '>= 1.3.19'
23
+ s.add_dependency 'bolognese', '~> 1.3', '>= 1.9.8'
24
24
  s.add_dependency 'builder', '~> 3.2', '>= 3.2.2'
25
25
  s.add_dependency 'dotenv', '~> 2.1', '>= 2.1.1'
26
26
  s.add_dependency 'maremma', '>= 4.4'
27
27
  s.add_dependency 'namae', '~> 1.0.1'
28
28
  s.add_dependency 'nokogiri', '>= 1.10.4', '< 1.12.0'
29
- s.add_development_dependency 'bundler', '~> 1.0'
30
- s.add_development_dependency 'codeclimate-test-reporter', '~> 1.0.0'
29
+ s.add_development_dependency "bundler", ">= 2.2.10"
31
30
  s.add_development_dependency 'rack-test', '~> 0'
32
31
  s.add_development_dependency 'rake'
33
32
  s.add_development_dependency 'rspec', '~> 3.4'
data/spec/api_spec.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OrcidClient, vcr: true do
4
- let(:doi) { "10.5281/zenodo.59983"}
4
+ let(:doi) { "10.5438/h5xp-x178"}
5
5
  let(:orcid) { "0000-0001-6528-2027" }
6
6
  let(:orcid_token) { ENV["ORCID_TOKEN"] }
7
7
  let(:notification_access_token) { ENV["NOTIFICATION_ACCESS_TOKEN"] }
8
- let(:put_code) { "921977" }
8
+ let(:put_code) { "1256188" }
9
9
  let(:fixture_path) { "spec/fixtures/" }
10
10
 
11
11
  subject { OrcidClient::Work.new(doi: doi, orcid: orcid, orcid_token: orcid_token, put_code: put_code) }
@@ -31,7 +31,7 @@ describe OrcidClient, vcr: true do
31
31
  it 'should get works' do
32
32
  response = subject.get_works(sandbox: true)
33
33
  works = response.body.fetch("data", {}).fetch("group", {})
34
- expect(works.length).to eq(22)
34
+ expect(works.length).to eq(23)
35
35
  work = works.first
36
36
  expect(work["external-ids"]).to eq("external-id" => [{"external-id-normalized"=>{"transient"=>true, "value"=>"10.5256/f1000research.67475.r16884"}, "external-id-normalized-error"=>nil, "external-id-relationship"=>"self", "external-id-type"=>"doi", "external-id-url"=>nil, "external-id-value"=>"10.5256/f1000research.67475.r16884"}])
37
37
  end
data/spec/author_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OrcidClient, vcr: true do
4
- let(:doi) { "10.5281/zenodo.59983"}
4
+ let(:doi) { "10.5438/h5xp-x178"}
5
5
  let(:orcid) { "0000-0001-6528-2027" }
6
6
  let(:orcid_token) { ENV['ORCID_TOKEN'] }
7
7
  let(:notification_access_token) { ENV['NOTIFICATION_ACCESS_TOKEN'] }