stash-wrapper 0.1.3 → 0.1.4

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: b3b52a64485d0cc1f2d2a166a9c6ad20705eeaea
4
- data.tar.gz: 36d2a6e3328c52ef4ec7d8649196d2aa4a2b4d11
3
+ metadata.gz: ccb2fa67c22b5f93e649abdb1afbd22508e26fb2
4
+ data.tar.gz: 722e4a497c0349dfdf2dfbe3796245fc25270ece
5
5
  SHA512:
6
- metadata.gz: 7ca5349052d42d20eaa529221306c313172629962801a950ba54fefa2ec302dfd763214364627d4e3dba25409e821887177d507582f1b6ca560cc4f0e167ef79
7
- data.tar.gz: 452d94d172643e0b6a75f45a00c2b5bb7910b89e34d698126512772a7abb2c377335a37f52ade374bd696f1dc32883eecb1eef051d12f29d75ae0023642dfd30
6
+ metadata.gz: 95e668d3de0cedb2c5477a11600051bbd7967add8d93a979f851e4bd3cc62a7336714eb243c1e4c8391ea82b8257bc323fbff40008292e2a74ba032bbb24b4bf
7
+ data.tar.gz: 367152e12ed2bdba9577cd6f4734ed524102bd16fe601134eb8f89378f43afbf15df8311d412115b677933ba440cefd81fd3a9277253cc4eafe76480f47c77d0
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.4 (25 April 2016)
2
+
3
+ - Replace all `require_relative` with absolute `require` to avoid symlink issues
4
+
1
5
  # 0.1.3 (19 April 2016)
2
6
 
3
7
  - Add convenience method `StashWrapper.file_names` to return a list of filenames
@@ -1,5 +1,5 @@
1
1
  require 'xml/mapping_extensions'
2
- require_relative 'embargo_type'
2
+ require 'stash/wrapper/embargo_type'
3
3
 
4
4
  module Stash
5
5
  module Wrapper
@@ -1,5 +1,5 @@
1
1
  require 'xml/mapping_extensions'
2
- require_relative 'identifier_type'
2
+ require 'stash/wrapper/identifier_type'
3
3
 
4
4
  module Stash
5
5
  module Wrapper
@@ -1,5 +1,5 @@
1
1
  require 'xml/mapping'
2
- require_relative 'stash_file'
2
+ require 'stash/wrapper/stash_file'
3
3
 
4
4
  module Stash
5
5
  module Wrapper
@@ -5,7 +5,7 @@ module Stash
5
5
  NAME = 'stash-wrapper'
6
6
 
7
7
  # The version of this gem
8
- VERSION = '0.1.3'
8
+ VERSION = '0.1.4'
9
9
 
10
10
  # The copyright notice for this gem
11
11
  COPYRIGHT = 'Copyright (c) 2016 The Regents of the University of California'
@@ -1,5 +1,5 @@
1
1
  require 'xml/mapping'
2
- require_relative 'size_unit'
2
+ require 'stash/wrapper/size_unit'
3
3
 
4
4
  module Stash
5
5
  module Wrapper
@@ -1,8 +1,8 @@
1
1
  require 'xml/mapping'
2
- require_relative 'version'
3
- require_relative 'license'
4
- require_relative 'embargo'
5
- require_relative 'inventory'
2
+ require 'stash/wrapper/version'
3
+ require 'stash/wrapper/license'
4
+ require 'stash/wrapper/embargo'
5
+ require 'stash/wrapper/inventory'
6
6
 
7
7
  module Stash
8
8
  module Wrapper
@@ -1,8 +1,8 @@
1
1
  require 'xml/mapping'
2
2
 
3
- require_relative 'descriptive_node'
4
- require_relative 'identifier'
5
- require_relative 'stash_administrative'
3
+ require 'stash/wrapper/descriptive_node'
4
+ require 'stash/wrapper/identifier'
5
+ require 'stash/wrapper/stash_administrative'
6
6
 
7
7
  module Stash
8
8
  module Wrapper
@@ -137,26 +137,26 @@ module Stash
137
137
  wrapper = StashWrapper.parse_xml(data)
138
138
 
139
139
  expected = %w(
140
- HSRC_MasterSampleII.dat
141
- HSRC_MasterSampleII.csv
142
- HSRC_MasterSampleII.sas7bdat
143
- formats.sas7bcat
144
- HSRC_MasterSampleII.sas
145
- HSRC_MasterSampleII.sav
146
- HSRC_MasterSampleII.sps
147
- HSRC_MasterSampleII.dta
148
- HSRC_MasterSampleII.dct
149
- HSRC_MasterSampleII.do
140
+ HSRC_MasterSampleII.dat
141
+ HSRC_MasterSampleII.csv
142
+ HSRC_MasterSampleII.sas7bdat
143
+ formats.sas7bcat
144
+ HSRC_MasterSampleII.sas
145
+ HSRC_MasterSampleII.sav
146
+ HSRC_MasterSampleII.sps
147
+ HSRC_MasterSampleII.dta
148
+ HSRC_MasterSampleII.dct
149
+ HSRC_MasterSampleII.do
150
150
  )
151
151
  expect(wrapper.file_names).to eq(expected)
152
152
  end
153
153
 
154
154
  it 'returns an empty array for an empty inventory' do
155
155
  wrapper = StashWrapper.new(
156
- identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
157
- version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
158
- license: License::CC_BY,
159
- descriptive_elements: []
156
+ identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
157
+ version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
158
+ license: License::CC_BY,
159
+ descriptive_elements: []
160
160
  )
161
161
  expect(wrapper.file_names).to eq([])
162
162
  end
@@ -166,14 +166,14 @@ module Stash
166
166
  describe '#initialize' do
167
167
  it 'defaults to no embargo' do
168
168
  wrapper = StashWrapper.new(
169
- identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
170
- version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
171
- license: License::CC_BY,
172
- inventory: Inventory.new(
173
- files: [
174
- StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain')
175
- ]),
176
- descriptive_elements: []
169
+ identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
170
+ version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
171
+ license: License::CC_BY,
172
+ inventory: Inventory.new(
173
+ files: [
174
+ StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain')
175
+ ]),
176
+ descriptive_elements: []
177
177
  )
178
178
  embargo = wrapper.embargo
179
179
  expect(embargo).to be_an(Embargo)
@@ -190,16 +190,16 @@ module Stash
190
190
  describe 'namespace handling' do
191
191
  before :each do
192
192
  wrapper = StashWrapper.new(
193
- identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
194
- version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
195
- license: License::CC_BY,
196
- embargo: Embargo.new(type: EmbargoType::DOWNLOAD, period: '1 year', start_date: Date.new(2014, 8, 18), end_date: Date.new(2013, 8, 18)),
197
- inventory: Inventory.new(
198
- files: [
199
- StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain')
200
- ]),
201
- # Note: the recursive asserts only work because descriptive_elements is empty
202
- descriptive_elements: []
193
+ identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
194
+ version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
195
+ license: License::CC_BY,
196
+ embargo: Embargo.new(type: EmbargoType::DOWNLOAD, period: '1 year', start_date: Date.new(2014, 8, 18), end_date: Date.new(2013, 8, 18)),
197
+ inventory: Inventory.new(
198
+ files: [
199
+ StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain')
200
+ ]),
201
+ # Note: the recursive asserts only work because descriptive_elements is empty
202
+ descriptive_elements: []
203
203
  )
204
204
  @wrapper_xml = wrapper.save_to_xml
205
205
  end
@@ -249,24 +249,24 @@ module Stash
249
249
  payload_xml = REXML::Document.new(payload).root
250
250
 
251
251
  wrapper = StashWrapper.new(
252
- identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
253
- version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
254
- license: License::CC_BY,
255
- embargo: Embargo.new(type: EmbargoType::DOWNLOAD, period: '1 year', start_date: Date.new(2014, 8, 18), end_date: Date.new(2013, 8, 18)),
256
- inventory: Inventory.new(
257
- files: [
258
- StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain'),
259
- StashFile.new(pathname: 'HSRC_MasterSampleII.csv', size_bytes: 67_890, mime_type: 'text/csv'),
260
- StashFile.new(pathname: 'HSRC_MasterSampleII.sas7bdat', size_bytes: 123_456, mime_type: 'application/x-sas-data'),
261
- StashFile.new(pathname: 'formats.sas7bcat', size_bytes: 78_910, mime_type: 'application/x-sas-catalog'),
262
- StashFile.new(pathname: 'HSRC_MasterSampleII.sas', size_bytes: 11_121, mime_type: 'application/x-sas'),
263
- StashFile.new(pathname: 'HSRC_MasterSampleII.sav', size_bytes: 31_415, mime_type: 'application/x-sav'),
264
- StashFile.new(pathname: 'HSRC_MasterSampleII.sps', size_bytes: 16_171, mime_type: 'application/x-spss'),
265
- StashFile.new(pathname: 'HSRC_MasterSampleII.dta', size_bytes: 81_920, mime_type: 'application/x-dta'),
266
- StashFile.new(pathname: 'HSRC_MasterSampleII.dct', size_bytes: 212_223, mime_type: 'application/x-dct'),
267
- StashFile.new(pathname: 'HSRC_MasterSampleII.do', size_bytes: 242_526, mime_type: 'application/x-do')
268
- ]),
269
- descriptive_elements: [payload_xml]
252
+ identifier: Identifier.new(type: IdentifierType::DOI, value: '10.14749/1407399498'),
253
+ version: Version.new(number: 1, date: Date.new(2013, 8, 18), note: 'Sample wrapped Datacite document'),
254
+ license: License::CC_BY,
255
+ embargo: Embargo.new(type: EmbargoType::DOWNLOAD, period: '1 year', start_date: Date.new(2014, 8, 18), end_date: Date.new(2013, 8, 18)),
256
+ inventory: Inventory.new(
257
+ files: [
258
+ StashFile.new(pathname: 'HSRC_MasterSampleII.dat', size_bytes: 12_345, mime_type: 'text/plain'),
259
+ StashFile.new(pathname: 'HSRC_MasterSampleII.csv', size_bytes: 67_890, mime_type: 'text/csv'),
260
+ StashFile.new(pathname: 'HSRC_MasterSampleII.sas7bdat', size_bytes: 123_456, mime_type: 'application/x-sas-data'),
261
+ StashFile.new(pathname: 'formats.sas7bcat', size_bytes: 78_910, mime_type: 'application/x-sas-catalog'),
262
+ StashFile.new(pathname: 'HSRC_MasterSampleII.sas', size_bytes: 11_121, mime_type: 'application/x-sas'),
263
+ StashFile.new(pathname: 'HSRC_MasterSampleII.sav', size_bytes: 31_415, mime_type: 'application/x-sav'),
264
+ StashFile.new(pathname: 'HSRC_MasterSampleII.sps', size_bytes: 16_171, mime_type: 'application/x-spss'),
265
+ StashFile.new(pathname: 'HSRC_MasterSampleII.dta', size_bytes: 81_920, mime_type: 'application/x-dta'),
266
+ StashFile.new(pathname: 'HSRC_MasterSampleII.dct', size_bytes: 212_223, mime_type: 'application/x-dct'),
267
+ StashFile.new(pathname: 'HSRC_MasterSampleII.do', size_bytes: 242_526, mime_type: 'application/x-do')
268
+ ]),
269
+ descriptive_elements: [payload_xml]
270
270
  )
271
271
 
272
272
  wrapper_xml = wrapper.save_to_xml
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stash-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-19 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typesafe_enum
@@ -209,7 +209,7 @@ files:
209
209
  - spec/unit/stash/wrapper/stash_administrative_spec.rb
210
210
  - spec/unit/stash/wrapper/stash_wrapper_spec.rb
211
211
  - stash-wrapper.gemspec
212
- homepage: http://github.com/dmolesUC3/stash-wrapper
212
+ homepage: http://github.com/CDLUC3/stash-wrapper
213
213
  licenses:
214
214
  - MIT
215
215
  metadata: {}