rubydora 1.3.0 → 1.4.0
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 +21 -0
- data/spec/lib/datastream_spec.rb +30 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/rubydora/datastream.rb
CHANGED
@@ -369,6 +369,27 @@ module Rubydora
|
|
369
369
|
URI.parse(val) unless val.nil?
|
370
370
|
end
|
371
371
|
|
372
|
+
# @return [boolean] is this an external datastream?
|
373
|
+
def external?
|
374
|
+
controlGroup == 'E'
|
375
|
+
end
|
376
|
+
|
377
|
+
# @return [boolean] is this a redirect datastream?
|
378
|
+
def redirect?
|
379
|
+
controlGroup == 'R'
|
380
|
+
end
|
381
|
+
|
382
|
+
# @return [boolean] is this a managed datastream?
|
383
|
+
def managed?
|
384
|
+
controlGroup == 'M'
|
385
|
+
end
|
386
|
+
|
387
|
+
# @return [boolean] is this an inline datastream?
|
388
|
+
def inline?
|
389
|
+
controlGroup == 'X'
|
390
|
+
end
|
391
|
+
|
392
|
+
|
372
393
|
private
|
373
394
|
|
374
395
|
# Rack::Test::UploadedFile is often set via content=, however it's not an IO, though it wraps an io object.
|
data/spec/lib/datastream_spec.rb
CHANGED
@@ -42,6 +42,36 @@ describe Rubydora::Datastream do
|
|
42
42
|
@datastream.dsState.should == 'A'
|
43
43
|
end
|
44
44
|
|
45
|
+
describe "external?" do
|
46
|
+
it "should test against controlGroup" do
|
47
|
+
@datastream.should_not be_external
|
48
|
+
@datastream.controlGroup = "E"
|
49
|
+
@datastream.should be_external
|
50
|
+
end
|
51
|
+
end
|
52
|
+
describe "redirect?" do
|
53
|
+
it "should test against controlGroup" do
|
54
|
+
@datastream.should_not be_redirect
|
55
|
+
@datastream.controlGroup = "R"
|
56
|
+
@datastream.should be_redirect
|
57
|
+
end
|
58
|
+
end
|
59
|
+
describe "managed?" do
|
60
|
+
it "should test against controlGroup" do
|
61
|
+
# Managed is default
|
62
|
+
@datastream.should be_managed
|
63
|
+
@datastream.controlGroup = "X"
|
64
|
+
@datastream.should_not be_managed
|
65
|
+
end
|
66
|
+
end
|
67
|
+
describe "inline?" do
|
68
|
+
it "should test against controlGroup" do
|
69
|
+
@datastream.should_not be_inline
|
70
|
+
@datastream.controlGroup = "X"
|
71
|
+
@datastream.should be_inline
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
45
75
|
it "should allow versionable to be set to false" do
|
46
76
|
@datastream.versionable = false
|
47
77
|
@datastream.versionable.should be_false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fastercsv
|
@@ -302,7 +302,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
segments:
|
304
304
|
- 0
|
305
|
-
hash: -
|
305
|
+
hash: -4150652175357095183
|
306
306
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
307
|
none: false
|
308
308
|
requirements:
|
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
311
|
version: '0'
|
312
312
|
segments:
|
313
313
|
- 0
|
314
|
-
hash: -
|
314
|
+
hash: -4150652175357095183
|
315
315
|
requirements: []
|
316
316
|
rubyforge_project:
|
317
317
|
rubygems_version: 1.8.25
|