stash-sword 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +42 -0
  3. data/.rubocop.yml +25 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +2 -0
  6. data/.yardopts +3 -0
  7. data/Gemfile +6 -0
  8. data/LICENSE.md +22 -0
  9. data/README.md +4 -0
  10. data/Rakefile +49 -0
  11. data/examples/example.rb +26 -0
  12. data/examples/uploads/example.zip +0 -0
  13. data/examples/uploads/example/lorem-ipsum.txt +7 -0
  14. data/examples/uploads/example/mrt-datacite.xml +22 -0
  15. data/examples/uploads/example/mrt-dc.xml +13 -0
  16. data/examples/uploads/example/stash-wrapper.xml +56 -0
  17. data/lib/stash/sword.rb +39 -0
  18. data/lib/stash/sword/client.rb +132 -0
  19. data/lib/stash/sword/deposit_receipt.rb +44 -0
  20. data/lib/stash/sword/header_utils.rb +42 -0
  21. data/lib/stash/sword/http_helper.rb +120 -0
  22. data/lib/stash/sword/iri.rb +12 -0
  23. data/lib/stash/sword/log_utils.rb +39 -0
  24. data/lib/stash/sword/module_info.rb +12 -0
  25. data/lib/stash/sword/namespace.rb +30 -0
  26. data/lib/stash/sword/sequence_io.rb +105 -0
  27. data/notes/Dash_Submission_To_Merritt.txt +40 -0
  28. data/notes/service-document.xml +15 -0
  29. data/spec/.rubocop.yml +10 -0
  30. data/spec/data/deposit_receipt_merritt.xml +25 -0
  31. data/spec/data/deposit_receipt_spec.xml +58 -0
  32. data/spec/rspec_custom_matchers.rb +118 -0
  33. data/spec/spec_helper.rb +33 -0
  34. data/spec/unit/stash/sword2/client_spec.rb +110 -0
  35. data/spec/unit/stash/sword2/deposit_receipt_spec.rb +48 -0
  36. data/spec/unit/stash/sword2/http_helper_get_spec.rb +131 -0
  37. data/spec/unit/stash/sword2/http_helper_post_spec.rb +143 -0
  38. data/spec/unit/stash/sword2/http_helper_put_spec.rb +143 -0
  39. data/spec/unit/stash/sword2/log_spec.rb +23 -0
  40. data/spec/unit/stash/sword2/namespaces_spec.rb +31 -0
  41. data/spec/unit/stash/sword2/sequence_io_spec.rb +153 -0
  42. data/stash-sword.gemspec +47 -0
  43. metadata +279 -0
@@ -0,0 +1,47 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ require 'uri'
6
+ require 'stash/sword/module_info'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = Stash::Sword::NAME
10
+ spec.version = Stash::Sword::VERSION
11
+ spec.authors = ['David Moles']
12
+ spec.email = ['david.moles@ucop.edu']
13
+ spec.summary = 'Stash SWORD 2.0 connector'
14
+ spec.description = 'A minimal SWORD 2.0 connector providing those features needed for Stash'
15
+ spec.license = 'MIT'
16
+
17
+ origin = `git config --get remote.origin.url`.chomp
18
+ origin_uri = origin.start_with?('http') ? URI(origin) : URI(origin.gsub(%r{git@([^:]+)(.com|.org)[^\/]+}, 'http://\1\2'))
19
+ spec.homepage = URI::HTTP.build(host: origin_uri.host, path: origin_uri.path.chomp('.git')).to_s
20
+
21
+ spec.files = `git ls-files -z`.split("\x0")
22
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
+
24
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
25
+ spec.require_paths = ['lib']
26
+
27
+ spec.add_dependency 'rest-client', '2.0.0.rc2'
28
+ spec.add_dependency 'typesafe_enum', '~> 0.1', '>= 0.1.7'
29
+ spec.add_dependency 'xml-mapping_extensions', '~> 0.4', '>= 0.4.1'
30
+
31
+ # spec.add_dependency 'swordruby', '~> 1.0'
32
+ # spec.add_dependency 'multipart-post', '~> 2.0'
33
+ #
34
+ # spec.add_dependency 'stash-wrapper', '~> 0.1', '>= 0.1.2'
35
+ # spec.add_dependency 'datacite-mapping', '~> 0.1', '>= 0.1.8'
36
+
37
+ spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
38
+
39
+ spec.add_development_dependency 'bundler', '~> 1.7'
40
+ spec.add_development_dependency 'rake', '~> 10.4'
41
+ spec.add_development_dependency 'rspec', '~> 3.3'
42
+ spec.add_development_dependency 'simplecov', '~> 0.9.2'
43
+ spec.add_development_dependency 'simplecov-console', '~> 0.2.0'
44
+ spec.add_development_dependency 'rubocop', '~> 0.38'
45
+ spec.add_development_dependency 'webmock', '~> 1.24'
46
+ spec.add_development_dependency 'yard', '~> 0.8'
47
+ end
metadata ADDED
@@ -0,0 +1,279 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stash-sword
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - David Moles
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-06-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.rc2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0.rc2
27
+ - !ruby/object:Gem::Dependency
28
+ name: typesafe_enum
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.1.7
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.1'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.1.7
47
+ - !ruby/object:Gem::Dependency
48
+ name: xml-mapping_extensions
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.4'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.4.1
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.4'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 0.4.1
67
+ - !ruby/object:Gem::Dependency
68
+ name: equivalent-xml
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: 0.6.0
74
+ type: :development
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: 0.6.0
81
+ - !ruby/object:Gem::Dependency
82
+ name: bundler
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '1.7'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '1.7'
95
+ - !ruby/object:Gem::Dependency
96
+ name: rake
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
100
+ - !ruby/object:Gem::Version
101
+ version: '10.4'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '10.4'
109
+ - !ruby/object:Gem::Dependency
110
+ name: rspec
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '3.3'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '3.3'
123
+ - !ruby/object:Gem::Dependency
124
+ name: simplecov
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: 0.9.2
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: 0.9.2
137
+ - !ruby/object:Gem::Dependency
138
+ name: simplecov-console
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: 0.2.0
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: 0.2.0
151
+ - !ruby/object:Gem::Dependency
152
+ name: rubocop
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - "~>"
156
+ - !ruby/object:Gem::Version
157
+ version: '0.38'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '0.38'
165
+ - !ruby/object:Gem::Dependency
166
+ name: webmock
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '1.24'
172
+ type: :development
173
+ prerelease: false
174
+ version_requirements: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: '1.24'
179
+ - !ruby/object:Gem::Dependency
180
+ name: yard
181
+ requirement: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "~>"
184
+ - !ruby/object:Gem::Version
185
+ version: '0.8'
186
+ type: :development
187
+ prerelease: false
188
+ version_requirements: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: '0.8'
193
+ description: A minimal SWORD 2.0 connector providing those features needed for Stash
194
+ email:
195
+ - david.moles@ucop.edu
196
+ executables: []
197
+ extensions: []
198
+ extra_rdoc_files: []
199
+ files:
200
+ - ".gitignore"
201
+ - ".rubocop.yml"
202
+ - ".ruby-version"
203
+ - ".travis.yml"
204
+ - ".yardopts"
205
+ - Gemfile
206
+ - LICENSE.md
207
+ - README.md
208
+ - Rakefile
209
+ - examples/example.rb
210
+ - examples/uploads/example.zip
211
+ - examples/uploads/example/lorem-ipsum.txt
212
+ - examples/uploads/example/mrt-datacite.xml
213
+ - examples/uploads/example/mrt-dc.xml
214
+ - examples/uploads/example/stash-wrapper.xml
215
+ - lib/stash/sword.rb
216
+ - lib/stash/sword/client.rb
217
+ - lib/stash/sword/deposit_receipt.rb
218
+ - lib/stash/sword/header_utils.rb
219
+ - lib/stash/sword/http_helper.rb
220
+ - lib/stash/sword/iri.rb
221
+ - lib/stash/sword/log_utils.rb
222
+ - lib/stash/sword/module_info.rb
223
+ - lib/stash/sword/namespace.rb
224
+ - lib/stash/sword/sequence_io.rb
225
+ - notes/Dash_Submission_To_Merritt.txt
226
+ - notes/service-document.xml
227
+ - spec/.rubocop.yml
228
+ - spec/data/deposit_receipt_merritt.xml
229
+ - spec/data/deposit_receipt_spec.xml
230
+ - spec/rspec_custom_matchers.rb
231
+ - spec/spec_helper.rb
232
+ - spec/unit/stash/sword2/client_spec.rb
233
+ - spec/unit/stash/sword2/deposit_receipt_spec.rb
234
+ - spec/unit/stash/sword2/http_helper_get_spec.rb
235
+ - spec/unit/stash/sword2/http_helper_post_spec.rb
236
+ - spec/unit/stash/sword2/http_helper_put_spec.rb
237
+ - spec/unit/stash/sword2/log_spec.rb
238
+ - spec/unit/stash/sword2/namespaces_spec.rb
239
+ - spec/unit/stash/sword2/sequence_io_spec.rb
240
+ - stash-sword.gemspec
241
+ homepage: http://github.com/stash-sword
242
+ licenses:
243
+ - MIT
244
+ metadata: {}
245
+ post_install_message:
246
+ rdoc_options: []
247
+ require_paths:
248
+ - lib
249
+ required_ruby_version: !ruby/object:Gem::Requirement
250
+ requirements:
251
+ - - ">="
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
254
+ required_rubygems_version: !ruby/object:Gem::Requirement
255
+ requirements:
256
+ - - ">="
257
+ - !ruby/object:Gem::Version
258
+ version: '0'
259
+ requirements: []
260
+ rubyforge_project:
261
+ rubygems_version: 2.4.5.1
262
+ signing_key:
263
+ specification_version: 4
264
+ summary: Stash SWORD 2.0 connector
265
+ test_files:
266
+ - spec/.rubocop.yml
267
+ - spec/data/deposit_receipt_merritt.xml
268
+ - spec/data/deposit_receipt_spec.xml
269
+ - spec/rspec_custom_matchers.rb
270
+ - spec/spec_helper.rb
271
+ - spec/unit/stash/sword2/client_spec.rb
272
+ - spec/unit/stash/sword2/deposit_receipt_spec.rb
273
+ - spec/unit/stash/sword2/http_helper_get_spec.rb
274
+ - spec/unit/stash/sword2/http_helper_post_spec.rb
275
+ - spec/unit/stash/sword2/http_helper_put_spec.rb
276
+ - spec/unit/stash/sword2/log_spec.rb
277
+ - spec/unit/stash/sword2/namespaces_spec.rb
278
+ - spec/unit/stash/sword2/sequence_io_spec.rb
279
+ has_rdoc: