rubydora 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rubydora/datastream.rb +1 -1
- data/spec/datastream_spec.rb +17 -0
- data/spec/digital_object_spec.rb +10 -0
- metadata +172 -122
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/rubydora/datastream.rb
CHANGED
@@ -156,7 +156,7 @@ module Rubydora
|
|
156
156
|
def to_api_params
|
157
157
|
h = default_api_params
|
158
158
|
DS_ATTRIBUTES.each do |attribute, profile_name|
|
159
|
-
h[attribute] = instance_variable_get("@#{attribute.to_s}")
|
159
|
+
h[attribute] = instance_variable_get("@#{attribute.to_s}") unless instance_variable_get("@#{attribute.to_s}").nil?
|
160
160
|
end
|
161
161
|
|
162
162
|
h
|
data/spec/datastream_spec.rb
CHANGED
@@ -117,5 +117,22 @@ describe Rubydora::Datastream do
|
|
117
117
|
|
118
118
|
end
|
119
119
|
|
120
|
+
describe "to_api_params" do
|
121
|
+
before(:each) do
|
122
|
+
@mock_object = mock(Rubydora::DigitalObject)
|
123
|
+
@mock_object.should_receive(:repository).any_number_of_times.and_return(@mock_repository)
|
124
|
+
@mock_object.should_receive(:pid).any_number_of_times.and_return 'pid'
|
125
|
+
@datastream = Rubydora::Datastream.new @mock_object, 'dsid'
|
126
|
+
end
|
127
|
+
it "should compile parameters to hash" do
|
128
|
+
@datastream.send(:to_api_params).should == {:checksumType=>"DISABLED", :versionable=>true,
|
129
|
+
:controlGroup=>"M", :dsState=>"A"}
|
130
|
+
end
|
131
|
+
it "should not send parameters that are set to nil" do
|
132
|
+
@datastream.dsLabel = nil
|
133
|
+
@datastream.send(:to_api_params).should == {:checksumType=>"DISABLED", :versionable=>true,
|
134
|
+
:controlGroup=>"M", :dsState=>"A"}
|
135
|
+
end
|
136
|
+
end
|
120
137
|
end
|
121
138
|
|
data/spec/digital_object_spec.rb
CHANGED
@@ -293,4 +293,14 @@ describe Rubydora::DigitalObject do
|
|
293
293
|
@object.parts.delete(@mock_object)
|
294
294
|
end
|
295
295
|
end
|
296
|
+
|
297
|
+
describe "to_api_params" do
|
298
|
+
before(:each) do
|
299
|
+
@mock_repository = mock(Rubydora::Repository)
|
300
|
+
@object = Rubydora::DigitalObject.new 'pid', @mock_repository
|
301
|
+
end
|
302
|
+
it "should compile parameters to hash" do
|
303
|
+
@object.send(:to_api_params).should == {}
|
304
|
+
end
|
305
|
+
end
|
296
306
|
end
|
metadata
CHANGED
@@ -1,155 +1,201 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydora
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Chris Beer
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-10-29 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: fastercsv
|
16
|
-
requirement: &2185502160 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: rest-client
|
27
|
-
requirement: &2185501640 !ruby/object:Gem::Requirement
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
28
26
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
34
|
+
requirement: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rest-client
|
33
37
|
type: :runtime
|
34
38
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: nokogiri
|
38
|
-
requirement: &2185501120 !ruby/object:Gem::Requirement
|
39
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
requirement: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: nokogiri
|
44
51
|
type: :runtime
|
45
52
|
prerelease: false
|
46
|
-
version_requirements:
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: mime-types
|
49
|
-
requirement: &2185500140 !ruby/object:Gem::Requirement
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
54
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
requirement: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: mime-types
|
55
65
|
type: :runtime
|
56
66
|
prerelease: false
|
57
|
-
version_requirements:
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: activesupport
|
60
|
-
requirement: &2185499680 !ruby/object:Gem::Requirement
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
61
68
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
requirement: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: activesupport
|
66
79
|
type: :runtime
|
67
80
|
prerelease: false
|
68
|
-
version_requirements:
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: activemodel
|
71
|
-
requirement: &2185499200 !ruby/object:Gem::Requirement
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
72
82
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
requirement: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: activemodel
|
77
93
|
type: :runtime
|
78
94
|
prerelease: false
|
79
|
-
version_requirements:
|
80
|
-
- !ruby/object:Gem::Dependency
|
81
|
-
name: savon
|
82
|
-
requirement: &2185498720 !ruby/object:Gem::Requirement
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
83
96
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
requirement: *id006
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: savon
|
88
107
|
type: :runtime
|
89
108
|
prerelease: false
|
90
|
-
version_requirements:
|
91
|
-
- !ruby/object:Gem::Dependency
|
92
|
-
name: rake
|
93
|
-
requirement: &2185498020 !ruby/object:Gem::Requirement
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
94
110
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
requirement: *id007
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
name: rake
|
99
121
|
type: :development
|
100
122
|
prerelease: false
|
101
|
-
version_requirements:
|
102
|
-
- !ruby/object:Gem::Dependency
|
103
|
-
name: shoulda
|
104
|
-
requirement: &2185497540 !ruby/object:Gem::Requirement
|
123
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
105
124
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
132
|
+
requirement: *id008
|
133
|
+
- !ruby/object:Gem::Dependency
|
134
|
+
name: shoulda
|
110
135
|
type: :development
|
111
136
|
prerelease: false
|
112
|
-
version_requirements:
|
113
|
-
- !ruby/object:Gem::Dependency
|
114
|
-
name: bundler
|
115
|
-
requirement: &2185497080 !ruby/object:Gem::Requirement
|
137
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
116
138
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
hash: 3
|
143
|
+
segments:
|
144
|
+
- 0
|
145
|
+
version: "0"
|
146
|
+
requirement: *id009
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: bundler
|
121
149
|
type: :development
|
122
150
|
prerelease: false
|
123
|
-
version_requirements:
|
124
|
-
- !ruby/object:Gem::Dependency
|
125
|
-
name: rspec
|
126
|
-
requirement: &2185496620 !ruby/object:Gem::Requirement
|
151
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
127
152
|
none: false
|
128
|
-
requirements:
|
129
|
-
- -
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
hash: 3
|
157
|
+
segments:
|
158
|
+
- 0
|
159
|
+
version: "0"
|
160
|
+
requirement: *id010
|
161
|
+
- !ruby/object:Gem::Dependency
|
162
|
+
name: rspec
|
132
163
|
type: :development
|
133
164
|
prerelease: false
|
134
|
-
version_requirements:
|
135
|
-
- !ruby/object:Gem::Dependency
|
136
|
-
name: yard
|
137
|
-
requirement: &2185496160 !ruby/object:Gem::Requirement
|
165
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
138
166
|
none: false
|
139
|
-
requirements:
|
140
|
-
- -
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 3
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
174
|
+
requirement: *id011
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: yard
|
143
177
|
type: :development
|
144
178
|
prerelease: false
|
145
|
-
version_requirements:
|
146
|
-
|
147
|
-
|
179
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
180
|
+
none: false
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
hash: 3
|
185
|
+
segments:
|
186
|
+
- 0
|
187
|
+
version: "0"
|
188
|
+
requirement: *id012
|
189
|
+
description: "Fedora Commons REST API ruby library : REQUIRES FCREPO 3.4+"
|
190
|
+
email:
|
148
191
|
- chris@cbeer.info
|
149
192
|
executables: []
|
193
|
+
|
150
194
|
extensions: []
|
195
|
+
|
151
196
|
extra_rdoc_files: []
|
152
|
-
|
197
|
+
|
198
|
+
files:
|
153
199
|
- .gitignore
|
154
200
|
- Gemfile
|
155
201
|
- LICENSE.txt
|
@@ -185,37 +231,41 @@ files:
|
|
185
231
|
- spec/rest_api_client_spec.rb
|
186
232
|
- spec/soap_spec.rb
|
187
233
|
- spec/spec_helper.rb
|
234
|
+
has_rdoc: true
|
188
235
|
homepage: http://github.com/cbeer/rubydora
|
189
236
|
licenses: []
|
237
|
+
|
190
238
|
post_install_message:
|
191
239
|
rdoc_options: []
|
192
|
-
|
240
|
+
|
241
|
+
require_paths:
|
193
242
|
- lib
|
194
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
243
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
195
244
|
none: false
|
196
|
-
requirements:
|
197
|
-
- -
|
198
|
-
- !ruby/object:Gem::Version
|
199
|
-
|
200
|
-
segments:
|
245
|
+
requirements:
|
246
|
+
- - ">="
|
247
|
+
- !ruby/object:Gem::Version
|
248
|
+
hash: 3
|
249
|
+
segments:
|
201
250
|
- 0
|
202
|
-
|
203
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
|
+
version: "0"
|
252
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
253
|
none: false
|
205
|
-
requirements:
|
206
|
-
- -
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
|
209
|
-
segments:
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
hash: 3
|
258
|
+
segments:
|
210
259
|
- 0
|
211
|
-
|
260
|
+
version: "0"
|
212
261
|
requirements: []
|
262
|
+
|
213
263
|
rubyforge_project:
|
214
|
-
rubygems_version: 1.
|
264
|
+
rubygems_version: 1.6.2
|
215
265
|
signing_key:
|
216
266
|
specification_version: 3
|
217
267
|
summary: Fedora Commons REST API ruby library
|
218
|
-
test_files:
|
268
|
+
test_files:
|
219
269
|
- spec/datastream_spec.rb
|
220
270
|
- spec/digital_object_spec.rb
|
221
271
|
- spec/ext_model_loader_spec.rb
|