rubydora 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eb805d0cbe4b4b6f349d9442f434398e3e0a3a21
4
+ data.tar.gz: afc120790e2ede734a69255bccf9d4fedff4dae2
5
+ SHA512:
6
+ metadata.gz: 37630017fda75875cd34ed2f152693675c408af25aa237f9e38a169d067ca33956efd5cdc9eb76ddfb536f5d0eeb5edcb25b6c0d2e669730e48587df5a9b9f32
7
+ data.tar.gz: 3ea433dfa7e1d4b5fe0518dfa64f2dbe12b62a2fb4295112d7b14d2bff267067db3a2a3abdfcbd0dea8f483347efc4cb37fdf4282501f926553d4e6ff8794f4e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
@@ -181,7 +181,11 @@ module Rubydora
181
181
  return true if new? and !local_or_remote_content(false).blank? # new datastreams must have content
182
182
 
183
183
  if controlGroup == "X"
184
- return !EquivalentXml.equivalent?(Nokogiri::XML(content), Nokogiri::XML(datastream_content))
184
+ if self.eager_load_datastream_content
185
+ return !EquivalentXml.equivalent?(Nokogiri::XML(local_or_remote_content(false)), Nokogiri::XML(datastream_content))
186
+ else
187
+ return !EquivalentXml.equivalent?(Nokogiri::XML(local_or_remote_content(false)), Nokogiri::XML(@datastream_content))
188
+ end
185
189
  else
186
190
  if self.eager_load_datastream_content
187
191
  return local_or_remote_content(false) != datastream_content
@@ -208,49 +208,75 @@ describe Rubydora::Datastream do
208
208
  end
209
209
 
210
210
  describe "content changed behavior" do
211
- before(:each) do
212
- @datastream = Rubydora::Datastream.new @mock_object, 'dsid'
213
- @mock_repository.should_receive(:datastream).any_number_of_times.and_return <<-XML
214
- <datastreamProfile>
215
- <dsLocation>some:uri</dsLocation>
216
- <dsLabel>label</dsLabel>
217
- </datastreamProfile>
218
- XML
219
- end
211
+ describe "for a managed datastream" do
212
+ before(:each) do
213
+ @datastream = Rubydora::Datastream.new @mock_object, 'dsid'
214
+ @mock_repository.should_receive(:datastream).any_number_of_times.and_return <<-XML
215
+ <datastreamProfile>
216
+ <dsLocation>some:uri</dsLocation>
217
+ <dsLabel>label</dsLabel>
218
+ </datastreamProfile>
219
+ XML
220
+ end
220
221
 
221
- it "should not be changed after a read-only access" do
222
- @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
223
- @datastream.content
224
- @datastream.content_changed?.should == false
225
- end
226
- it "should not load content just to check and see if it was changed." do
227
- @mock_repository.should_not_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid'))
228
- @datastream.content_changed?.should == false
229
- end
230
- it "should be changed when the new content is different than the old content" do
231
- @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
232
- @datastream.content = "test"
233
- @datastream.content_changed?.should == true
234
- end
222
+ it "should not be changed after a read-only access" do
223
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
224
+ @datastream.content
225
+ @datastream.content_changed?.should == false
226
+ end
227
+ it "should not load content just to check and see if it was changed." do
228
+ @mock_repository.should_not_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid'))
229
+ @datastream.content_changed?.should == false
230
+ end
231
+ it "should be changed when the new content is different than the old content" do
232
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
233
+ @datastream.content = "test"
234
+ @datastream.content_changed?.should == true
235
+ end
235
236
 
236
- it "should not be changed when the new content is the same as the existing content (when eager-loading is enabled)" do
237
- @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
238
- @datastream.eager_load_datastream_content = true
239
- @datastream.content = "test"
240
- @datastream.content_changed?.should == false
241
- end
237
+ it "should not be changed when the new content is the same as the existing content (when eager-loading is enabled)" do
238
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
239
+ @datastream.eager_load_datastream_content = true
240
+ @datastream.content = "test"
241
+ @datastream.content_changed?.should == false
242
+ end
242
243
 
243
- it "should be changed when the new content is the same as the existing content (without eager loading, the default)" do
244
- @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
245
- @datastream.content = "test"
246
- @datastream.content_changed?.should == true
244
+ it "should be changed when the new content is the same as the existing content (without eager loading, the default)" do
245
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
246
+ @datastream.content = "test"
247
+ @datastream.content_changed?.should == true
248
+ end
249
+
250
+ it "should not be changed when the new content is the same as the existing content (and we have accessed #content previously)" do
251
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
252
+ @datastream.content
253
+ @datastream.content = "test"
254
+ @datastream.content_changed?.should == false
255
+ end
247
256
  end
248
257
 
249
- it "should not be changed when the new content is the same as the existing content (and we have accessed #content previously)" do
250
- @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
251
- @datastream.content
252
- @datastream.content = "test"
253
- @datastream.content_changed?.should == false
258
+ describe "for an inline datastream" do
259
+ before(:each) do
260
+ @mock_repository.should_receive(:datastream).any_number_of_times.and_return <<-XML
261
+ <datastreamProfile>
262
+ <dsLocation>some:uri</dsLocation>
263
+ <dsLabel>label</dsLabel>
264
+ </datastreamProfile>
265
+ XML
266
+ @datastream = Rubydora::Datastream.new @mock_object, 'dsid', :controlGroup => 'X'
267
+ end
268
+ it "should not be changed when the new content is the same as the existing content (when eager-loading is enabled)" do
269
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('<xml>test</xml>')
270
+ @datastream.eager_load_datastream_content = true
271
+ @datastream.content = "<xml>test</xml>"
272
+ @datastream.content_changed?.should == false
273
+ end
274
+
275
+ it "should be changed when the new content is the same as the existing content (without eager loading, the default)" do
276
+ @mock_repository.stub(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('<xml>test</xml>')
277
+ @datastream.content = "<xml>test</xml>"
278
+ @datastream.content_changed?.should == true
279
+ end
254
280
  end
255
281
  end
256
282
 
metadata CHANGED
@@ -1,254 +1,223 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydora
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
5
- prerelease:
4
+ version: 1.4.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Chris Beer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-12 00:00:00.000000000 Z
11
+ date: 2013-03-06 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: fastercsv
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ">="
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ">="
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rest-client
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ">="
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ">="
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: nokogiri
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ">="
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ">="
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: equivalent-xml
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ">="
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ">="
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: mime-types
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ">="
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ">="
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: activesupport
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ">="
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ">="
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: activemodel
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ">="
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ">="
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: hooks
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ">="
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :runtime
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ">="
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: deprecation
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ">="
129
+ - - '>='
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :runtime
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ">="
136
+ - - '>='
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  - !ruby/object:Gem::Dependency
159
140
  name: rake
160
141
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
142
  requirements:
163
- - - ">="
143
+ - - '>='
164
144
  - !ruby/object:Gem::Version
165
145
  version: '0'
166
146
  type: :development
167
147
  prerelease: false
168
148
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
149
  requirements:
171
- - - ">="
150
+ - - '>='
172
151
  - !ruby/object:Gem::Version
173
152
  version: '0'
174
153
  - !ruby/object:Gem::Dependency
175
154
  name: shoulda
176
155
  requirement: !ruby/object:Gem::Requirement
177
- none: false
178
156
  requirements:
179
- - - ">="
157
+ - - '>='
180
158
  - !ruby/object:Gem::Version
181
159
  version: '0'
182
160
  type: :development
183
161
  prerelease: false
184
162
  version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
163
  requirements:
187
- - - ">="
164
+ - - '>='
188
165
  - !ruby/object:Gem::Version
189
166
  version: '0'
190
167
  - !ruby/object:Gem::Dependency
191
168
  name: bundler
192
169
  requirement: !ruby/object:Gem::Requirement
193
- none: false
194
170
  requirements:
195
- - - ">="
171
+ - - '>='
196
172
  - !ruby/object:Gem::Version
197
173
  version: 1.0.14
198
174
  type: :development
199
175
  prerelease: false
200
176
  version_requirements: !ruby/object:Gem::Requirement
201
- none: false
202
177
  requirements:
203
- - - ">="
178
+ - - '>='
204
179
  - !ruby/object:Gem::Version
205
180
  version: 1.0.14
206
181
  - !ruby/object:Gem::Dependency
207
182
  name: rspec
208
183
  requirement: !ruby/object:Gem::Requirement
209
- none: false
210
184
  requirements:
211
- - - ">="
185
+ - - '>='
212
186
  - !ruby/object:Gem::Version
213
187
  version: '0'
214
188
  type: :development
215
189
  prerelease: false
216
190
  version_requirements: !ruby/object:Gem::Requirement
217
- none: false
218
191
  requirements:
219
- - - ">="
192
+ - - '>='
220
193
  - !ruby/object:Gem::Version
221
194
  version: '0'
222
195
  - !ruby/object:Gem::Dependency
223
196
  name: yard
224
197
  requirement: !ruby/object:Gem::Requirement
225
- none: false
226
198
  requirements:
227
- - - ">="
199
+ - - '>='
228
200
  - !ruby/object:Gem::Version
229
201
  version: '0'
230
202
  type: :development
231
203
  prerelease: false
232
204
  version_requirements: !ruby/object:Gem::Requirement
233
- none: false
234
205
  requirements:
235
- - - ">="
206
+ - - '>='
236
207
  - !ruby/object:Gem::Version
237
208
  version: '0'
238
209
  - !ruby/object:Gem::Dependency
239
210
  name: jettywrapper
240
211
  requirement: !ruby/object:Gem::Requirement
241
- none: false
242
212
  requirements:
243
- - - ">="
213
+ - - '>='
244
214
  - !ruby/object:Gem::Version
245
215
  version: '0'
246
216
  type: :development
247
217
  prerelease: false
248
218
  version_requirements: !ruby/object:Gem::Requirement
249
- none: false
250
219
  requirements:
251
- - - ">="
220
+ - - '>='
252
221
  - !ruby/object:Gem::Version
253
222
  version: '0'
254
223
  description: Fedora Commons REST API ruby library
@@ -258,8 +227,8 @@ executables: []
258
227
  extensions: []
259
228
  extra_rdoc_files: []
260
229
  files:
261
- - ".gitignore"
262
- - ".gitmodules"
230
+ - .gitignore
231
+ - .gitmodules
263
232
  - Gemfile
264
233
  - History.textile
265
234
  - LICENSE.txt
@@ -290,33 +259,26 @@ files:
290
259
  - spec/spec_helper.rb
291
260
  homepage: http://github.com/cbeer/rubydora
292
261
  licenses: []
262
+ metadata: {}
293
263
  post_install_message:
294
264
  rdoc_options: []
295
265
  require_paths:
296
266
  - lib
297
267
  required_ruby_version: !ruby/object:Gem::Requirement
298
- none: false
299
268
  requirements:
300
- - - ">="
269
+ - - '>='
301
270
  - !ruby/object:Gem::Version
302
271
  version: '0'
303
- segments:
304
- - 0
305
- hash: -4150652175357095183
306
272
  required_rubygems_version: !ruby/object:Gem::Requirement
307
- none: false
308
273
  requirements:
309
- - - ">="
274
+ - - '>='
310
275
  - !ruby/object:Gem::Version
311
276
  version: '0'
312
- segments:
313
- - 0
314
- hash: -4150652175357095183
315
277
  requirements: []
316
278
  rubyforge_project:
317
- rubygems_version: 1.8.25
279
+ rubygems_version: 2.0.0
318
280
  signing_key:
319
- specification_version: 3
281
+ specification_version: 4
320
282
  summary: Fedora Commons REST API ruby library
321
283
  test_files:
322
284
  - spec/lib/datastream_spec.rb