active-fedora 6.4.0.rc4 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6a491ed123f54d269d0768d80a8cb526c1d4b0b
4
- data.tar.gz: 1ba1f6930603d6095d178d9762e6c4f465788fce
3
+ metadata.gz: 3ed505bd4c93e672099b6338c7835745b8b3c0da
4
+ data.tar.gz: 1a3ecd688f69dc30eadfad3712e173793a9971a7
5
5
  SHA512:
6
- metadata.gz: e93d7508557149bdf107c7bb44b32751e4508506fd562d19d4cff9f74a148e771dc6cbc018e05fa8e603139d7f065046c324fe03ad9c5c7bde924e1b648daf68
7
- data.tar.gz: 89d830d304a2ff251d8c4a0f3f2d37b3f370342a99c9432b05861028bb0e1c30420fba0c93184769d053be695a53cd6fa1fad4f5edfc86925de15b271d665fe4
6
+ metadata.gz: 1379046abbce3ef04db6542c3ff0905899acd5395771700d23ce04ba1157a68874930c3d5c7fd4ac3ba7523db1362c127cb9734287bdff3922b69540c2437337
7
+ data.tar.gz: a667ef87332c2d4656624cdf8cab47f3a27fdde1838023d85f5765d5b9c412656b82d94c10e2a6d7ca055bc13d9f831b09dc13c0f80fe472364d0f01c0967573
@@ -1,4 +1,11 @@
1
- 6.4.0 (unreleased)
1
+ 6.4.0 (2013-07-01)
2
+
3
+ Removing experimental designation, tidying-up the code [Adam Wead]
4
+
5
+ Providing a YAMLAdaptor for Psych dependency [Jeremy Friesen]
6
+
7
+ Increase startup wait to 90 seconds [Justin Coyne]
8
+
2
9
  Bump dependency to om 3.0.0 [Justin Coyne]
3
10
 
4
11
  Updating "active_fedora:model" rails generator [Jeremy Friesen]
@@ -1,5 +1,5 @@
1
1
  default:
2
- startup_wait: 60
2
+ startup_wait: 90
3
3
  jetty_port: 8983
4
4
  java_opts:
5
5
  - "-Xmx256m"
@@ -18,8 +18,6 @@ module ActiveFedora
18
18
 
19
19
  module ClassMethods
20
20
 
21
- # ** EXPERIMENTAL **
22
- #
23
21
  # Allows for a datastream to be treated like any other attribute of a model class
24
22
  # while enforcing mimeType and/or datastream type (ie. external, managed, etc.) if defined.
25
23
  # ====Examples
@@ -67,8 +65,6 @@ module ActiveFedora
67
65
  create_named_datastream_update_methods(args[:name])
68
66
  end
69
67
 
70
- # ** EXPERIMENTAL **
71
- #
72
68
  # Creates the following helper methods for a datastream name
73
69
  # [datastream_name]_append - Add a named datastream
74
70
  #
@@ -91,8 +87,6 @@ module ActiveFedora
91
87
  end
92
88
  end
93
89
 
94
- # ** EXPERIMENTAL **
95
- #
96
90
  # Creates the following helper methods for a datastream name
97
91
  # [datastream_name] - Returns array of named datastreams
98
92
  # [datastream_name]_ids - Returns array of named datastream dsids
@@ -130,8 +124,6 @@ module ActiveFedora
130
124
 
131
125
  end
132
126
 
133
- # ** EXPERIMENTAL **
134
- #
135
127
  # Accessor for class variable for hash that stores arguments passed to has_datastream calls within an
136
128
  # ActiveFedora::Base child class.
137
129
  #
@@ -147,15 +139,11 @@ module ActiveFedora
147
139
  self.class_named_datastreams_desc ||= {}
148
140
  end
149
141
 
150
- # ** EXPERIMENTAL **
151
- #
152
142
  # Returns array of datastream names defined for this object
153
143
  def datastream_names
154
144
  named_datastreams_desc.keys
155
145
  end
156
146
 
157
- # ** EXPERIMENTAL **
158
- #
159
147
  # Calls add_named_datastream while assuming it will be managed content and sets :blob and :controlGroup values accordingly
160
148
  # ====Parameters
161
149
  # name: Datastream name
@@ -166,8 +154,6 @@ module ActiveFedora
166
154
  add_named_datastream(name,opts)
167
155
  end
168
156
 
169
- # ** EXPERIMENTAL **
170
- #
171
157
  # This object is used by [datastream_name]_append helper to add a named datastream
172
158
  # but can also be called directly.
173
159
  # ====Parameters
@@ -236,8 +222,6 @@ module ActiveFedora
236
222
  add_datastream(ds,opts)
237
223
  end
238
224
 
239
- # ** EXPERIMENTAL **
240
- #
241
225
  # Update an existing named datastream. It has same parameters as add_named_datastream
242
226
  # except the :dsid key is now required.
243
227
  #
@@ -251,26 +235,20 @@ module ActiveFedora
251
235
  add_named_datastream(name,opts)
252
236
  end
253
237
 
254
- # ** EXPERIMENTAL **
255
- #
256
238
  # Throws an assertion failure unless the object 'o' is kind_of? class 't'
257
239
  # ====Parameters
258
240
  # n: Name of object
259
241
  # o: The object to test
260
242
  # t: The class type to check is kind_of?
261
- def assert_kind_of(n, o,t)
243
+ def assert_kind_of(n,o,t)
262
244
  raise "Assertion failure: #{n}: #{o} is not of type #{t}" unless o.kind_of?(t)
263
245
  end
264
246
 
265
- # ** EXPERIMENTAL **
266
- #
267
247
  # Returns true if the name is a defined named datastream
268
248
  def is_named_datastream?(name)
269
249
  named_datastreams_desc.has_key?(name)
270
250
  end
271
251
 
272
- # ** EXPERIMENTAL **
273
- #
274
252
  # Returns hash of datastream names defined by has_datastream calls mapped to
275
253
  # array of datastream objects that have been added
276
254
  # ====Example
@@ -288,8 +266,6 @@ module ActiveFedora
288
266
  return ds_values
289
267
  end
290
268
 
291
- # ** EXPERIMENTAL **
292
- #
293
269
  # Returns hash of datastream names mapped to an array
294
270
  # of dsid's for named datastream objects
295
271
  # === Example
@@ -308,8 +284,6 @@ module ActiveFedora
308
284
  return dsids
309
285
  end
310
286
 
311
- # ** EXPERIMENTAL **
312
- #
313
287
  # Returns the hash that stores arguments passed to has_datastream calls within an
314
288
  # ActiveFedora::Base child class.
315
289
  #
@@ -1,5 +1,5 @@
1
1
  require 'erb'
2
- require 'psych'
2
+ require 'active_fedora/yaml_adaptor'
3
3
 
4
4
  module ActiveFedora
5
5
  class FileConfigurator
@@ -110,7 +110,7 @@ module ActiveFedora
110
110
  end
111
111
 
112
112
  begin
113
- fedora_yml = Psych.load(config_erb)
113
+ fedora_yml = YAMLAdaptor.load(config_erb)
114
114
  rescue StandardError => e
115
115
  raise("fedora.yml was found, but could not be parsed.\n")
116
116
  end
@@ -133,7 +133,7 @@ module ActiveFedora
133
133
  end
134
134
 
135
135
  begin
136
- solr_yml = Psych.load(config_erb)
136
+ solr_yml = YAMLAdaptor.load(config_erb)
137
137
  rescue StandardError => e
138
138
  raise("solr.yml was found, but could not be parsed.\n")
139
139
  end
@@ -209,7 +209,7 @@ module ActiveFedora
209
209
 
210
210
  def predicate_config
211
211
  @predicate_config_path ||= build_predicate_config_path(File.dirname(self.path))
212
- Psych.load(File.open(@predicate_config_path)) if File.exist?(@predicate_config_path)
212
+ YAMLAdaptor.load(File.open(@predicate_config_path)) if File.exist?(@predicate_config_path)
213
213
  end
214
214
 
215
215
  protected
@@ -227,7 +227,7 @@ module ActiveFedora
227
227
  end
228
228
 
229
229
  def valid_predicate_mapping?(testfile)
230
- mapping = Psych.load(File.open(testfile))
230
+ mapping = YAMLAdaptor.load(File.open(testfile))
231
231
  return false unless mapping.has_key?(:default_namespace) && mapping[:default_namespace].is_a?(String)
232
232
  return false unless mapping.has_key?(:predicate_mapping) && mapping[:predicate_mapping].is_a?(Hash)
233
233
  true
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "6.4.0.rc4"
2
+ VERSION = "6.4.0"
3
3
  end
@@ -0,0 +1,12 @@
1
+ begin
2
+ require 'psych'
3
+ YAMLAdaptor = Psych
4
+ rescue LoadError
5
+ $stderr.puts "*"*80
6
+ $stderr.puts "WARNING: Unable to load Psych, falling back to YAML for parser."
7
+ $stderr.puts " YAML will be removed in ActiveFedora 7.0.0."
8
+ $stderr.puts " YAMLAdaptor will be removed in ActiveFedora 7.0.0, and replaced with Psych"
9
+ $stderr.puts "*"*80
10
+ require 'yaml'
11
+ YAMLAdaptor = YAML
12
+ end
@@ -3,7 +3,7 @@
3
3
  require 'active_fedora/base'
4
4
  class <%= class_name %> < ActiveFedora::Base
5
5
  <% if options['descMetadata'] %>
6
- has_metadata name: "descMetadata", type: <% options['descMetadata'] %>
6
+ has_metadata name: "descMetadata", type: <%= options['descMetadata'] %>
7
7
  <% else %>
8
8
  # Uncomment the following lines to add a #descMetadata method that is a
9
9
  # datastream. You will need to specify the :type:, which may involve
@@ -2,7 +2,7 @@ def mock_yaml(hash, path)
2
2
  mock_file = mock(path.split("/")[-1])
3
3
  File.stub(:exist?).with(path).and_return(true)
4
4
  File.stub(:open).with(path).and_return(mock_file)
5
- YAML.stub(:load).and_return(hash)
5
+ YAMLAdaptor.stub(:load).and_return(hash)
6
6
  end
7
7
 
8
8
  def default_predicate_mapping_file
@@ -48,7 +48,6 @@ describe ActiveFedora::DatastreamCollections do
48
48
  describe '#add_named_file_datastream' do
49
49
  it 'should add a file datastream with the given name to the object in fedora' do
50
50
  @test_object2 = MockAFBaseDatastream.new
51
- # @test_object2.new_object = true
52
51
  f = File.open(File.join( File.dirname(__FILE__), "../fixtures/minivan.jpg"), 'rb')
53
52
  f.stub(:content_type).and_return("image/jpeg")
54
53
  @test_object2.add_named_file_datastream("thumbnail",f)
@@ -62,11 +61,6 @@ describe ActiveFedora::DatastreamCollections do
62
61
  t2_thumb1.pid.should == @test_object2.pid
63
62
  t2_thumb1.dsLabel.should == "minivan.jpg"
64
63
  t2_thumb1.controlGroup.should == "M"
65
-
66
- # .attributes.should == {"label"=>ds.label,"dsid"=>ds.dsid,
67
- # "mimeType"=>ds.attributes[:mimeType],
68
- # :controlGroup=>ds.attributes[:controlGroup],
69
- # :pid=>ds.pid, :dsID=>ds.dsid, :dsLabel=>ds.attributes[:dsLabel]}
70
64
  end
71
65
  end
72
66
 
@@ -130,6 +124,4 @@ describe ActiveFedora::DatastreamCollections do
130
124
  end
131
125
  end
132
126
 
133
-
134
-
135
- end
127
+ end
@@ -38,7 +38,7 @@ describe ActiveFedora::FileConfigurator do
38
38
  end
39
39
 
40
40
  it "should initialize from code" do
41
- YAML.should_receive(:load).never
41
+ YAMLAdaptor.should_receive(:load).never
42
42
  File.should_receive(:exists?).never
43
43
  File.should_receive(:read).never
44
44
  File.should_receive(:open).never
@@ -2,13 +2,13 @@ require 'spec_helper'
2
2
 
3
3
  describe ActiveFedora::Config do
4
4
  describe "with a single fedora instance" do
5
- conf = Psych.load(File.read('spec/fixtures/rails_root/config/fedora.yml'))['test']
5
+ conf = YAMLAdaptor.load(File.read('spec/fixtures/rails_root/config/fedora.yml'))['test']
6
6
  subject { ActiveFedora::Config.new(conf) }
7
7
  its(:credentials) { should == {:url => 'http://testhost.com:8983/fedora', :user=> 'fedoraAdmin', :password=> 'fedoraAdmin'}}
8
8
  it { should_not be_sharded }
9
9
  end
10
10
  describe "with several fedora shards" do
11
- conf = Psych.load(File.read('spec/fixtures/sharded_fedora.yml'))['test']
11
+ conf = YAMLAdaptor.load(File.read('spec/fixtures/sharded_fedora.yml'))['test']
12
12
  subject { ActiveFedora::Config.new(conf) }
13
13
  its(:credentials) { should == [{:url => 'http://127.0.0.1:8983/fedora1', :user=> 'fedoraAdmin', :password=> 'fedoraAdmin'},
14
14
  {:url => 'http://127.0.0.1:8983/fedora2', :user=> 'fedoraAdmin', :password=> 'fedoraAdmin'},
@@ -323,7 +323,7 @@ describe ActiveFedora::FileConfigurator do
323
323
  subject.instance_variable_set :@config_loaded, nil
324
324
  end
325
325
  it "should return the default mapping if it has not been initialized" do
326
- subject.predicate_config().should == YAML.load(File.read(default_predicate_mapping_file))
326
+ subject.predicate_config().should == YAMLAdaptor.load(File.read(default_predicate_mapping_file))
327
327
  end
328
328
  end
329
329
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.4.0.rc4
4
+ version: 6.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-26 00:00:00.000000000 Z
13
+ date: 2013-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr
@@ -369,6 +369,7 @@ files:
369
369
  - lib/active_fedora/unsaved_digital_object.rb
370
370
  - lib/active_fedora/validations.rb
371
371
  - lib/active_fedora/version.rb
372
+ - lib/active_fedora/yaml_adaptor.rb
372
373
  - lib/generators/active_fedora/config/USAGE
373
374
  - lib/generators/active_fedora/config/config_generator.rb
374
375
  - lib/generators/active_fedora/config/fedora/fedora_generator.rb
@@ -546,9 +547,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
546
547
  version: 1.9.3
547
548
  required_rubygems_version: !ruby/object:Gem::Requirement
548
549
  requirements:
549
- - - '>'
550
+ - - '>='
550
551
  - !ruby/object:Gem::Version
551
- version: 1.3.1
552
+ version: '0'
552
553
  requirements: []
553
554
  rubyforge_project:
554
555
  rubygems_version: 2.0.3