active-fedora 1.1.13 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/README.textile +8 -1
- data/Rakefile +4 -3
- data/VERSION +1 -1
- data/active-fedora.gemspec +17 -13
- data/lib/active_fedora.rb +2 -2
- data/lib/active_fedora/base.rb +295 -10
- data/lib/active_fedora/metadata_datastream.rb +10 -3
- data/lib/active_fedora/metadata_datastream_helper.rb +23 -7
- data/lib/active_fedora/model.rb +104 -2
- data/lib/active_fedora/nokogiri_datastream.rb +23 -18
- data/lib/active_fedora/qualified_dublin_core_datastream.rb +1 -0
- data/lib/active_fedora/rels_ext_datastream.rb +22 -1
- data/lib/active_fedora/semantic_node.rb +293 -8
- data/lib/active_fedora/solr_service.rb +21 -36
- data/lib/fedora/connection.rb +7 -3
- data/lib/hydra/sample_mods_datastream.rb +57 -94
- data/spec/integration/base_find_by_fields_spec.rb +215 -0
- data/spec/integration/base_spec.rb +756 -1
- data/spec/integration/metadata_datastream_helper_spec.rb +103 -0
- data/spec/integration/model_spec.rb +10 -9
- data/spec/integration/rels_ext_datastream_spec.rb +85 -0
- data/spec/integration/semantic_node_spec.rb +1 -2
- data/spec/integration/solr_service_spec.rb +36 -0
- data/spec/unit/base_file_management_spec.rb +0 -1
- data/spec/unit/base_named_datastream_spec.rb +580 -0
- data/spec/unit/base_spec.rb +98 -7
- data/spec/unit/nokogiri_datastream_spec.rb +29 -145
- data/spec/unit/semantic_node_spec.rb +479 -2
- metadata +39 -23
- data/README.rdoc +0 -17
- data/lib/active_fedora/solr_mapper.rb +0 -21
- data/spec/unit/solr_mapper_spec.rb +0 -31
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Zumwalt
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-09-15 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -102,32 +102,31 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
hash:
|
105
|
+
hash: 15
|
106
106
|
segments:
|
107
|
-
- 0
|
108
107
|
- 1
|
109
|
-
-
|
110
|
-
version:
|
108
|
+
- 0
|
109
|
+
version: "1.0"
|
111
110
|
type: :runtime
|
112
111
|
version_requirements: *id006
|
113
112
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
113
|
+
name: solrizer
|
115
114
|
prerelease: false
|
116
115
|
requirement: &id007 !ruby/object:Gem::Requirement
|
117
116
|
none: false
|
118
117
|
requirements:
|
119
118
|
- - ">="
|
120
119
|
- !ruby/object:Gem::Version
|
121
|
-
hash:
|
120
|
+
hash: 19
|
122
121
|
segments:
|
122
|
+
- 0
|
123
123
|
- 1
|
124
|
-
-
|
125
|
-
|
126
|
-
|
127
|
-
type: :development
|
124
|
+
- 4
|
125
|
+
version: 0.1.4
|
126
|
+
type: :runtime
|
128
127
|
version_requirements: *id007
|
129
128
|
- !ruby/object:Gem::Dependency
|
130
|
-
name:
|
129
|
+
name: rspec
|
131
130
|
prerelease: false
|
132
131
|
requirement: &id008 !ruby/object:Gem::Requirement
|
133
132
|
none: false
|
@@ -143,9 +142,25 @@ dependencies:
|
|
143
142
|
type: :development
|
144
143
|
version_requirements: *id008
|
145
144
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
145
|
+
name: mocha
|
147
146
|
prerelease: false
|
148
147
|
requirement: &id009 !ruby/object:Gem::Requirement
|
148
|
+
none: false
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
hash: 43
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
- 9
|
156
|
+
- 8
|
157
|
+
version: 0.9.8
|
158
|
+
type: :development
|
159
|
+
version_requirements: *id009
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
name: ruby-debug
|
162
|
+
prerelease: false
|
163
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
149
164
|
none: false
|
150
165
|
requirements:
|
151
166
|
- - ">="
|
@@ -155,7 +170,7 @@ dependencies:
|
|
155
170
|
- 0
|
156
171
|
version: "0"
|
157
172
|
type: :development
|
158
|
-
version_requirements: *
|
173
|
+
version_requirements: *id010
|
159
174
|
description: ActiveFedora provides for creating and managing objects in the Fedora Repository Architecture.
|
160
175
|
email: matt.zumwalt@yourmediashelf.com
|
161
176
|
executables: []
|
@@ -164,7 +179,6 @@ extensions: []
|
|
164
179
|
|
165
180
|
extra_rdoc_files:
|
166
181
|
- LICENSE
|
167
|
-
- README.rdoc
|
168
182
|
- README.textile
|
169
183
|
files:
|
170
184
|
- .document
|
@@ -324,7 +338,6 @@ files:
|
|
324
338
|
- License.txt
|
325
339
|
- Manifest.txt
|
326
340
|
- PostInstall.txt
|
327
|
-
- README.rdoc
|
328
341
|
- README.textile
|
329
342
|
- Rakefile
|
330
343
|
- VERSION
|
@@ -348,7 +361,6 @@ files:
|
|
348
361
|
- lib/active_fedora/relationship.rb
|
349
362
|
- lib/active_fedora/rels_ext_datastream.rb
|
350
363
|
- lib/active_fedora/semantic_node.rb
|
351
|
-
- lib/active_fedora/solr_mapper.rb
|
352
364
|
- lib/active_fedora/solr_service.rb
|
353
365
|
- lib/fedora/base.rb
|
354
366
|
- lib/fedora/connection.rb
|
@@ -376,6 +388,7 @@ files:
|
|
376
388
|
- spec/fixtures/test_12.foxml.xml
|
377
389
|
- spec/hydrangea_fixture_mods_article1.foxml.xml
|
378
390
|
- spec/integration/base_file_management_spec.rb
|
391
|
+
- spec/integration/base_find_by_fields_spec.rb
|
379
392
|
- spec/integration/base_loader_spec.rb
|
380
393
|
- spec/integration/base_spec.rb
|
381
394
|
- spec/integration/bug_spec.rb
|
@@ -383,6 +396,7 @@ files:
|
|
383
396
|
- spec/integration/datastreams_crud_spec.rb
|
384
397
|
- spec/integration/fedora_object_spec.rb
|
385
398
|
- spec/integration/full_featured_model_spec.rb
|
399
|
+
- spec/integration/metadata_datastream_helper_spec.rb
|
386
400
|
- spec/integration/model_spec.rb
|
387
401
|
- spec/integration/mods_article_integration_spec.rb
|
388
402
|
- spec/integration/rels_ext_datastream_spec.rb
|
@@ -405,6 +419,7 @@ files:
|
|
405
419
|
- spec/unit/base_datastream_management_spec.rb
|
406
420
|
- spec/unit/base_extra_spec.rb
|
407
421
|
- spec/unit/base_file_management_spec.rb
|
422
|
+
- spec/unit/base_named_datastream_spec.rb
|
408
423
|
- spec/unit/base_spec.rb
|
409
424
|
- spec/unit/connection_spec.rb
|
410
425
|
- spec/unit/content_model_spec.rb
|
@@ -423,7 +438,6 @@ files:
|
|
423
438
|
- spec/unit/rf_datastream_spec.rb
|
424
439
|
- spec/unit/semantic_node_spec.rb
|
425
440
|
- spec/unit/solr_config_options_spec.rb
|
426
|
-
- spec/unit/solr_mapper_spec.rb
|
427
441
|
- spec/unit/solr_service_spec.rb
|
428
442
|
- tasks/hoe.rake
|
429
443
|
- tasks/rspec.rake
|
@@ -463,6 +477,7 @@ specification_version: 3
|
|
463
477
|
summary: A convenience libary for manipulating MODS (Metadata Object Description Schema) documents.
|
464
478
|
test_files:
|
465
479
|
- spec/integration/base_file_management_spec.rb
|
480
|
+
- spec/integration/base_find_by_fields_spec.rb
|
466
481
|
- spec/integration/base_loader_spec.rb
|
467
482
|
- spec/integration/base_spec.rb
|
468
483
|
- spec/integration/bug_spec.rb
|
@@ -470,6 +485,7 @@ test_files:
|
|
470
485
|
- spec/integration/datastreams_crud_spec.rb
|
471
486
|
- spec/integration/fedora_object_spec.rb
|
472
487
|
- spec/integration/full_featured_model_spec.rb
|
488
|
+
- spec/integration/metadata_datastream_helper_spec.rb
|
473
489
|
- spec/integration/model_spec.rb
|
474
490
|
- spec/integration/mods_article_integration_spec.rb
|
475
491
|
- spec/integration/rels_ext_datastream_spec.rb
|
@@ -489,6 +505,7 @@ test_files:
|
|
489
505
|
- spec/unit/base_datastream_management_spec.rb
|
490
506
|
- spec/unit/base_extra_spec.rb
|
491
507
|
- spec/unit/base_file_management_spec.rb
|
508
|
+
- spec/unit/base_named_datastream_spec.rb
|
492
509
|
- spec/unit/base_spec.rb
|
493
510
|
- spec/unit/connection_spec.rb
|
494
511
|
- spec/unit/content_model_spec.rb
|
@@ -507,5 +524,4 @@ test_files:
|
|
507
524
|
- spec/unit/rf_datastream_spec.rb
|
508
525
|
- spec/unit/semantic_node_spec.rb
|
509
526
|
- spec/unit/solr_config_options_spec.rb
|
510
|
-
- spec/unit/solr_mapper_spec.rb
|
511
527
|
- spec/unit/solr_service_spec.rb
|
data/README.rdoc
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
= active_fedora
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 Matt Zumwalt. See LICENSE for details.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'active_fedora/solr_service'
|
2
|
-
|
3
|
-
module ActiveFedora
|
4
|
-
module SolrMapper
|
5
|
-
|
6
|
-
# Generates solr field names from settings in solr_mappings
|
7
|
-
def self.solr_name(field_name, field_type)
|
8
|
-
name = field_name.to_s + ActiveFedora::SolrService.mappings[field_type.to_s].to_s
|
9
|
-
if field_name.kind_of?(Symbol)
|
10
|
-
return name.to_sym
|
11
|
-
else
|
12
|
-
return name.to_s
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def solr_name(field_name, field_type)
|
17
|
-
ActiveFedora::SolrMapper.solr_name(field_name, field_type)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.join( File.dirname(__FILE__), "..", "spec_helper" )
|
2
|
-
|
3
|
-
require 'active_fedora/solr_service'
|
4
|
-
require 'active_fedora/solr_mapper'
|
5
|
-
|
6
|
-
include ActiveFedora::SolrMapper
|
7
|
-
|
8
|
-
describe ActiveFedora::SolrMapper do
|
9
|
-
|
10
|
-
after(:all) do
|
11
|
-
# Revert to default mappings after running tests
|
12
|
-
ActiveFedora::SolrService.load_mappings
|
13
|
-
end
|
14
|
-
|
15
|
-
describe ".solr_name" do
|
16
|
-
it "should generate solr field names from settings in solr_mappings" do
|
17
|
-
solr_name(:system_create, :date).should == :system_create_dt
|
18
|
-
end
|
19
|
-
it "should format the response based on the class of the input" do
|
20
|
-
solr_name(:system_create, :date).should == :system_create_dt
|
21
|
-
solr_name("system_create", :date).should == "system_create_dt"
|
22
|
-
end
|
23
|
-
it "should rely on whichever mappings have been loaded into the SolrService" do
|
24
|
-
solr_name(:system_create, :date).should == :system_create_dt
|
25
|
-
solr_name(:foo, :text).should == :foo_t
|
26
|
-
ActiveFedora::SolrService.load_mappings(File.join(File.dirname(__FILE__), "..", "..", "config", "solr_mappings_af_0.1.yml"))
|
27
|
-
solr_name(:system_create, :date).should == :system_create_date
|
28
|
-
solr_name(:foo, :text).should == :foo_field
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|