mrt-ingest 0.0.3 → 0.0.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
  SHA256:
3
- metadata.gz: 7d30e43c2e0b21873ca263108300477a4a2926fe2ab7edb72d3327900253e1ac
4
- data.tar.gz: 73466ed8f6640a0756d13fcbe4c79f9a8f98f7db8518a2a9fa047bb77bc576ed
3
+ metadata.gz: b29f8fd2bc7331b638a034dc11c86726ebb3f1526a62cb2d8b71f471215110cb
4
+ data.tar.gz: f3797630caf8ebbda198e29590b85bdf4f01391b9d031472d5b3d950de9b836b
5
5
  SHA512:
6
- metadata.gz: 85ef3dfa325d3f0bbdc705faa630b1c0e0bacd9436586ff753c74bd9d18db254b8c86c9bb363804b0b9853c259e513eab81f66065b17194ef4f18be9aed55c93
7
- data.tar.gz: 6b0d2cf3d02703ccc7e715093dff00f8934a8499d519c8c0d64a039b0a57c230f284a8f57001cc06935715e1c9f1ea72a32b0b0034ab13b6efc1452dfcd2552f
6
+ metadata.gz: d1109ffa2df106b91e4fdef16a9b6fa2fa82305b34f56a5a189304c048490b8e56c868566f5fd2a7b64bdfdb243d65f54dd8625c059b5d1f743bd0f678af5f16
7
+ data.tar.gz: 9c669cbc0180ddeef7b71649cc349c804cf29dc351a140827db5a9d8a24f6a88b0889e978a7e9d48fb40522bd7c634c593e69d78d07e7692a0e2af043124525e
data/.gitignore ADDED
@@ -0,0 +1,208 @@
1
+ ###########################
2
+ #### Custom ignores #######
3
+
4
+ # Gemfile.lock should be checked in for apps, but not for libraries
5
+ Gemfile.lock
6
+
7
+ ###########################
8
+ #### Generated ignores ####
9
+
10
+ #### joe made this: http://goel.io/joe
11
+
12
+ #### ruby ####
13
+ *.gem
14
+ *.rbc
15
+ /.config
16
+ /coverage/
17
+ /InstalledFiles
18
+ /pkg/
19
+ /spec/reports/
20
+ /spec/examples.txt
21
+ /test/tmp/
22
+ /test/version_tmp/
23
+ /tmp/
24
+
25
+ # Used by dotenv library to load environment variables.
26
+ # .env
27
+
28
+ ## Specific to RubyMotion:
29
+ .dat*
30
+ .repl_history
31
+ build/
32
+ *.bridgesupport
33
+ build-iPhoneOS/
34
+ build-iPhoneSimulator/
35
+
36
+ ## Specific to RubyMotion (use of CocoaPods):
37
+ #
38
+ # We recommend against adding the Pods directory to your .gitignore. However
39
+ # you should judge for yourself, the pros and cons are mentioned at:
40
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
41
+ #
42
+ # vendor/Pods/
43
+
44
+ ## Documentation cache and generated files:
45
+ /.yardoc/
46
+ /_yardoc/
47
+ /doc/
48
+ /rdoc/
49
+
50
+ ## Environment normalization:
51
+ /.bundle/
52
+ /vendor/bundle
53
+ /lib/bundler/man/
54
+
55
+ # for a library or gem, you might want to ignore these files since the code is
56
+ # intended to run in multiple environments; otherwise, check them in:
57
+ # Gemfile.lock
58
+ # .ruby-version
59
+ # .ruby-gemset
60
+
61
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
62
+ .rvmrc
63
+
64
+
65
+ #### macos ####
66
+ # General
67
+ .DS_Store
68
+ .AppleDouble
69
+ .LSOverride
70
+
71
+ # Icon must end with two \r
72
+ Icon
73
+
74
+ # Thumbnails
75
+ ._*
76
+
77
+ # Files that might appear in the root of a volume
78
+ .DocumentRevisions-V100
79
+ .fseventsd
80
+ .Spotlight-V100
81
+ .TemporaryItems
82
+ .Trashes
83
+ .VolumeIcon.icns
84
+ .com.apple.timemachine.donotpresent
85
+
86
+ # Directories potentially created on remote AFP share
87
+ .AppleDB
88
+ .AppleDesktop
89
+ Network Trash Folder
90
+ Temporary Items
91
+ .apdisk
92
+
93
+
94
+ #### jetbrains ####
95
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
96
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
97
+
98
+ # User-specific stuff
99
+ .idea/**/workspace.xml
100
+ .idea/**/tasks.xml
101
+ .idea/**/usage.statistics.xml
102
+ .idea/**/dictionaries
103
+ .idea/**/shelf
104
+
105
+ # Generated files
106
+ .idea/**/contentModel.xml
107
+
108
+ # Sensitive or high-churn files
109
+ .idea/**/dataSources/
110
+ .idea/**/dataSources.ids
111
+ .idea/**/dataSources.local.xml
112
+ .idea/**/sqlDataSources.xml
113
+ .idea/**/dynamic.xml
114
+ .idea/**/uiDesigner.xml
115
+ .idea/**/dbnavigator.xml
116
+
117
+ # Gradle
118
+ .idea/**/gradle.xml
119
+ .idea/**/libraries
120
+
121
+ # Gradle and Maven with auto-import
122
+ # When using Gradle or Maven with auto-import, you should exclude module files,
123
+ # since they will be recreated, and may cause churn. Uncomment if using
124
+ # auto-import.
125
+ # .idea/modules.xml
126
+ # .idea/*.iml
127
+ # .idea/modules
128
+
129
+ # CMake
130
+ cmake-build-*/
131
+
132
+ # Mongo Explorer plugin
133
+ .idea/**/mongoSettings.xml
134
+
135
+ # File-based project format
136
+ *.iws
137
+
138
+ # IntelliJ
139
+ out/
140
+
141
+ # mpeltonen/sbt-idea plugin
142
+ .idea_modules/
143
+
144
+ # JIRA plugin
145
+ atlassian-ide-plugin.xml
146
+
147
+ # Cursive Clojure plugin
148
+ .idea/replstate.xml
149
+
150
+ # Crashlytics plugin (for Android Studio and IntelliJ)
151
+ com_crashlytics_export_strings.xml
152
+ crashlytics.properties
153
+ crashlytics-build.properties
154
+ fabric.properties
155
+
156
+ # Editor-based Rest Client
157
+ .idea/httpRequests
158
+
159
+ # Android studio 3.1+ serialized cache file
160
+ .idea/caches/build_file_checksums.ser
161
+
162
+
163
+ #### emacs ####
164
+ # -*- mode: gitignore; -*-
165
+ *~
166
+ \#*\#
167
+ /.emacs.desktop
168
+ /.emacs.desktop.lock
169
+ *.elc
170
+ auto-save-list
171
+ tramp
172
+ .\#*
173
+
174
+ # Org-mode
175
+ .org-id-locations
176
+ *_archive
177
+
178
+ # flymake-mode
179
+ *_flymake.*
180
+
181
+ # eshell files
182
+ /eshell/history
183
+ /eshell/lastdir
184
+
185
+ # elpa packages
186
+ /elpa/
187
+
188
+ # reftex files
189
+ *.rel
190
+
191
+ # AUCTeX auto folder
192
+ /auto/
193
+
194
+ # cask packages
195
+ .cask/
196
+ dist/
197
+
198
+ # Flycheck
199
+ flycheck_*.el
200
+
201
+ # server auth directory
202
+ /server/
203
+
204
+ # projectiles files
205
+ .projectile
206
+
207
+ # directory configuration
208
+ .dir-locals.el
data/.travis.yml ADDED
@@ -0,0 +1,2 @@
1
+ language: ruby
2
+
data/Gemfile CHANGED
@@ -3,9 +3,5 @@ source "http://rubygems.org"
3
3
  # Specify your gem's dependencies in mrt-ingest.gemspec
4
4
  gemspec
5
5
 
6
- group :test do
7
- gem "fakeweb"
8
- gem "mocha"
9
- gem "checkm", "0.0.6"
10
- gem "shoulda"
11
- end
6
+ # TODO: remove this (in favor of gemspec) once there's a 2.4-compatible release
7
+ gem 'fakeweb', git: 'https://github.com/chrisk/fakeweb.git', ref: '2b08c1f'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011, Regents of the University of California
1
+ Copyright (c) 2011-2018, Regents of the University of California
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
@@ -18,7 +18,7 @@ module Mrt
18
18
  @mime_type = options[:mime_type]
19
19
  @size = options[:size]
20
20
  # @prefetch = options[:prefetch] || false
21
- @prefetch = false
21
+ @prefetch = false # TODO: remove prefetch code
22
22
 
23
23
  case where
24
24
  when File, Tempfile
data/mrt-ingest.gemspec CHANGED
@@ -1,9 +1,8 @@
1
- # -*- encoding: utf-8 -*-
2
1
  $:.push File.expand_path("../lib", __FILE__)
3
2
 
4
3
  Gem::Specification.new do |s|
5
4
  s.name = "mrt-ingest"
6
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
7
6
  s.platform = Gem::Platform::RUBY
8
7
  s.authors = ["Mark Reyes", "David Moles"]
9
8
  s.email = ["mark.reyes@ucop.edu", "david.moles@ucop.edu"]
@@ -12,8 +11,17 @@ Gem::Specification.new do |s|
12
11
  s.description = %q{A client for the Merritt ingest system. More details available from https://github.com/CDLUC3/mrt-doc/wiki}
13
12
  s.license = "BSD-3-Clause"
14
13
 
15
- s.add_dependency "json", "~> 1.5", ">=1.5.0"
16
- s.add_dependency "rest-client", "~> 1.6", ">=1.6.0"
14
+ s.add_dependency "json", "~> 2.0"
15
+ s.add_dependency "rest-client", "~> 2.0"
16
+
17
+ s.add_development_dependency "bundler", '~> 1.16'
18
+ s.add_development_dependency "checkm", "0.0.6"
19
+ # TODO: put this back in once there's a 2.4-compatible release
20
+ # s.add_development_dependency "fakeweb"
21
+ s.add_development_dependency "mocha", '~> 1.7'
22
+ s.add_development_dependency "rake", '~> 12.0'
23
+ s.add_development_dependency "shoulda", '~> 3.6'
24
+ s.add_development_dependency "test-unit", '~> 3.2'
17
25
 
18
26
  s.files = `git ls-files -z`.split("\x0")
19
27
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
data/test/test_client.rb CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'rubygems'
5
5
 
6
+ require 'test/unit'
6
7
  require 'checkm'
7
8
  require 'fakeweb'
8
9
  require 'mocha'
data/test/test_iobject.rb CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'rubygems'
5
5
 
6
+ require 'test/unit'
6
7
  require 'checkm'
7
8
  require 'fakeweb'
8
9
  require 'mocha'
@@ -57,6 +58,18 @@ class TestIObject < Test::Unit::TestCase
57
58
  end
58
59
  end
59
60
 
61
+ context "an iobject with local ID" do
62
+ setup do
63
+ @local_id = '10.1098/rstl.1665.0007'
64
+ @iobject = Mrt::Ingest::IObject.new(local_identifier: @local_id)
65
+ end
66
+
67
+ should "include that local ID in the resuest" do
68
+ request = @iobject.mk_request("profile", "submitter")
69
+ assert_equal(@local_id, request.local_identifier)
70
+ end
71
+ end
72
+
60
73
  context "an iobject" do
61
74
  setup do
62
75
  @iobject = Mrt::Ingest::IObject.new
@@ -66,15 +79,16 @@ class TestIObject < Test::Unit::TestCase
66
79
  @iobject.add_component(URI.parse("http://example.org/file"))
67
80
  end
68
81
 
69
- should "be able to add a URI component with prefetching, served locally" do
70
- @iobject.add_component(URI.parse("http://example.org/"), :prefetch=>true)
71
- manifest = parse_object_manifest(@iobject)
72
- manifest.entries.each do |entry|
73
- # check that all files are served locally
74
- uri = URI.parse(entry.values[0])
75
- assert_equal(Socket.gethostname, uri.host)
76
- end
77
- end
82
+ # TODO: remove prefetch code
83
+ # should "be able to add a URI component with prefetching, served locally" do
84
+ # @iobject.add_component(URI.parse("http://example.org/"), :prefetch=>true)
85
+ # manifest = parse_object_manifest(@iobject)
86
+ # manifest.entries.each do |entry|
87
+ # # check that all files are served locally
88
+ # uri = URI.parse(entry.values[0])
89
+ # assert_equal(Socket.gethostname, uri.host)
90
+ # end
91
+ # end
78
92
 
79
93
  should "not be able to add a non-URI component" do
80
94
  assert_raise(Mrt::Ingest::IngestException) do
data/test/test_request.rb CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'rubygems'
5
5
 
6
+ require 'test/unit'
6
7
  require 'fakeweb'
7
8
  require 'mocha'
8
9
  require 'mrt/ingest'
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'rubygems'
5
5
 
6
+ require 'test/unit'
6
7
  require 'fakeweb'
7
8
  require 'mocha'
8
9
  require 'mrt/ingest'
@@ -12,38 +13,38 @@ class TestResponse < Test::Unit::TestCase
12
13
  RESPONSE_JSON = <<EOS
13
14
  {
14
15
 
15
- "batchState": {
16
- "batchID":"bid-8c0fa0c2-f3d7-4deb-bd49-f953f6752b59",
17
- "updateFlag":false,
18
- "targetQueue":"example.org:2181",
19
- "batchStatus":"QUEUED",
20
- "userAgent":"egh/Erik Hetzner",
21
- "submissionDate":"2011-08-31T15:40:26-07:00",
22
- "targetQueueNode":"/ingest.example.1",
23
- "batchProfile": {
24
- "owner":"ark:/99999/fk4tt4wsh",
25
- "creationDate":"2010-01-19T13:28:14-08:00",
26
- "targetStorage": {
27
- "storageLink":"http://example.org:35121",
28
- "nodeID":10
16
+ "bat:batchState": {
17
+ "bat:batchID":"bid-8c0fa0c2-f3d7-4deb-bd49-f953f6752b59",
18
+ "bat:updateFlag":false,
19
+ "bat:targetQueue":"example.org:2181",
20
+ "bat:batchStatus":"QUEUED",
21
+ "bat:userAgent":"egh/Erik Hetzner",
22
+ "bat:submissionDate":"2011-08-31T15:40:26-07:00",
23
+ "bat:targetQueueNode":"/ingest.example.1",
24
+ "bat:batchProfile": {
25
+ "bat:owner":"ark:/99999/fk4tt4wsh",
26
+ "bat:creationDate":"2010-01-19T13:28:14-08:00",
27
+ "bat:targetStorage": {
28
+ "bat:storageLink":"http://example.org:35121",
29
+ "bat:nodeID":10
29
30
  },
30
- "objectType":"MRT-curatorial",
31
- "modificationDate":"2010-01-26T23:28:14-08:00",
32
- "aggregateType":"",
33
- "objectMinterURL":"https://example.org/ezid/shoulder/ark:/99999/fk4",
34
- "collection": {
31
+ "bat:objectType":"MRT-curatorial",
32
+ "bat:modificationDate":"2010-01-26T23:28:14-08:00",
33
+ "bat:aggregateType":"",
34
+ "bat:objectMinterURL":"https://example.org/ezid/shoulder/ark:/99999/fk4",
35
+ "bat:collection": {
35
36
  },
36
- "profileID":"merritt_content",
37
- "profileDescription":"Merritt demo content",
38
- "fixityURL":"http://example.org:33143",
39
- "contactsEmail": {
40
- "notification": {
41
- "contactEmail":"erik.hetzner@example.org"
37
+ "bat:profileID":"merritt_content",
38
+ "bat:profileDescription":"Merritt demo content",
39
+ "bat:fixityURL":"http://example.org:33143",
40
+ "bat:contactsEmail": {
41
+ "bat:notification": {
42
+ "bat:contactEmail":"erik.hetzner@example.org"
42
43
  }
43
44
  },
44
- "identifierScheme":"ARK",
45
- "identifierNamespace":"99999",
46
- "objectRole":"MRT-content"
45
+ "bat:identifierScheme":"ARK",
46
+ "bat:identifierNamespace":"99999",
47
+ "bat:objectRole":"MRT-content"
47
48
  }
48
49
  }
49
50
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mrt-ingest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Reyes
@@ -17,40 +17,112 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.5'
21
- - - ">="
20
+ version: '2.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
22
26
  - !ruby/object:Gem::Version
23
- version: 1.5.0
27
+ version: '2.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rest-client
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.0'
24
35
  type: :runtime
25
36
  prerelease: false
26
37
  version_requirements: !ruby/object:Gem::Requirement
27
38
  requirements:
28
39
  - - "~>"
29
40
  - !ruby/object:Gem::Version
30
- version: '1.5'
31
- - - ">="
41
+ version: '2.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
32
47
  - !ruby/object:Gem::Version
33
- version: 1.5.0
48
+ version: '1.16'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.16'
34
56
  - !ruby/object:Gem::Dependency
35
- name: rest-client
57
+ name: checkm
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.0.6
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.0.6
70
+ - !ruby/object:Gem::Dependency
71
+ name: mocha
36
72
  requirement: !ruby/object:Gem::Requirement
37
73
  requirements:
38
74
  - - "~>"
39
75
  - !ruby/object:Gem::Version
40
- version: '1.6'
41
- - - ">="
76
+ version: '1.7'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
42
82
  - !ruby/object:Gem::Version
43
- version: 1.6.0
44
- type: :runtime
83
+ version: '1.7'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rake
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '12.0'
91
+ type: :development
45
92
  prerelease: false
46
93
  version_requirements: !ruby/object:Gem::Requirement
47
94
  requirements:
48
95
  - - "~>"
49
96
  - !ruby/object:Gem::Version
50
- version: '1.6'
51
- - - ">="
97
+ version: '12.0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: shoulda
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '3.6'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '3.6'
112
+ - !ruby/object:Gem::Dependency
113
+ name: test-unit
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '3.2'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
52
124
  - !ruby/object:Gem::Version
53
- version: 1.6.0
125
+ version: '3.2'
54
126
  description: A client for the Merritt ingest system. More details available from https://github.com/CDLUC3/mrt-doc/wiki
55
127
  email:
56
128
  - mark.reyes@ucop.edu
@@ -59,7 +131,9 @@ executables: []
59
131
  extensions: []
60
132
  extra_rdoc_files: []
61
133
  files:
134
+ - ".gitignore"
62
135
  - ".hgignore"
136
+ - ".travis.yml"
63
137
  - Gemfile
64
138
  - LICENSE
65
139
  - README