dataverse 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: fbc236012c0be76621856d95ab432dd90aa0d61c92749ea70fefcfa7a0eae5d5
4
- data.tar.gz: 2ed45c9065fcb23fc495681a5837d21747d29227cef32eff4167a549ef8fe8c2
3
+ metadata.gz: 1a08ba2d018273239e8d8f23ee61b4e8c13e7565ed4ad4cb22b95c77dc2f38d7
4
+ data.tar.gz: fb0a72b95f9a91354bada40b3dfe0c8607d2c3c2ba2470d7f523415b4c41f088
5
5
  SHA512:
6
- metadata.gz: ec8a0464a4d89a24309f04f008eb38b6950562a799968c7bb38e4eb21be703da55b8447bbcacb01a596cbb5f67fe7b0a49a2616c82a95ce567d0b16fa5943423
7
- data.tar.gz: 99fc439204f3b4a82cd2c7f976d4d894a93d8e3ca490a571752e97807561f80738139c562fb1b14692ddbd10ec7702211f9636d84faa3b0cf615a3a31e34eb35
6
+ metadata.gz: cff68b1067d06fe1b386d626e3e25eaacf77ce8ca28354bee0ad19c1283ab2da5bc5f761adb68b6165d9f0abc2c0c30fd86cd5622e5a7d7856aa527d0c2dbc5f
7
+ data.tar.gz: 34395f76c1b292a75ceb5cabac43e688a94eb688ae97d353df733c434dad5b617b087f5ede2d9ad60298d6c6f14ad4676dbb601fb9b2f0d429423dfdeffb3334
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dataverse (0.1.2)
4
+ dataverse (0.1.3)
5
5
  rest-client (~> 2.0)
6
6
 
7
7
  GEM
@@ -60,4 +60,4 @@ DEPENDENCIES
60
60
  rspec (~> 3.0)
61
61
 
62
62
  BUNDLED WITH
63
- 2.2.15
63
+ 2.2.18
@@ -140,6 +140,13 @@ module Dataverse
140
140
  .merge(version_data(version))
141
141
  .merge('metadata' => metadata(version: version))
142
142
  .merge('files' => files(version: version))
143
+ .tap do |h|
144
+ h['license'] = {
145
+ 'label' => license_name,
146
+ 'uri' => license_url,
147
+ 'iconUrl' => license_icon
148
+ }
149
+ end
143
150
  end
144
151
 
145
152
  def raw_data(version: :latest, with_files: false)
@@ -188,6 +195,18 @@ module Dataverse
188
195
  end
189
196
  end
190
197
 
198
+ def license_url
199
+ fetch('termsOfUse')[/(?<=href=")[^"]*(?=")/]
200
+ end
201
+
202
+ def license_name
203
+ fetch('termsOfUse')[/[^>]*(?=<\/a>.$)/]
204
+ end
205
+
206
+ def license_icon
207
+ fetch('termsOfUse')[/(?<=src=")[^"]*(?=")/]
208
+ end
209
+
191
210
  protected
192
211
 
193
212
  def initialize(id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dataverse
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dataverse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-16 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.2.15
76
+ rubygems_version: 3.1.4
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: Dataverse API.