hydra-head 4.1.0 → 4.1.1

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.
data/hydra-head.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency 'hydra-mods', ">= 0.0.5"
23
23
  s.add_dependency 'deprecation', ">= 0.0.5"
24
24
  s.add_dependency 'jquery-rails'
25
- s.add_dependency 'hydra-access-controls', ">= 0.0.2"
25
+ s.add_dependency 'hydra-access-controls', ">= 0.0.5"
26
26
 
27
27
  s.add_development_dependency 'sqlite3'
28
28
  s.add_development_dependency 'yard'
@@ -1,4 +1,4 @@
1
1
  module HydraHead
2
- VERSION = "4.1.0"
2
+ VERSION = "4.1.1"
3
3
  end
4
4
 
data/lib/hydra.rb CHANGED
@@ -21,6 +21,7 @@ module Hydra
21
21
  autoload :SuperuserAttributes
22
22
  autoload :User
23
23
  autoload :UI
24
+ autoload :Solr
24
25
  autoload :Workflow
25
26
 
26
27
  autoload :FileAssetsHelper
@@ -29,6 +30,9 @@ module Hydra
29
30
  # This usually happens within a call to AccessControlsEnforcement#enforce_access_controls but can be
30
31
  # raised manually.
31
32
  class Hydra::AccessDenied < CanCan::AccessDenied; end
33
+
34
+ User.send(:include, Hydra::SuperuserAttributes) #Deprecated
35
+
32
36
  end
33
37
 
34
38
 
@@ -39,5 +43,6 @@ require 'hydra/model_methods'
39
43
  require 'hydra/models/file_asset'
40
44
  require 'mediashelf/active_fedora_helper' #deprecated
41
45
 
46
+
42
47
  SolrDocument.use_extension Hydra::ModelMixins::SolrDocumentExtension
43
48
 
data/lib/hydra/solr.rb ADDED
@@ -0,0 +1,9 @@
1
+ module Hydra
2
+ module Solr
3
+ module Document
4
+ def to_model
5
+ ActiveFedora::Base.load_instance_from_solr(id, self)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -47,8 +47,7 @@ namespace :hydra do
47
47
 
48
48
  desc "return development jetty to its pristine state, as pulled from git"
49
49
  task :reset => ['jetty:stop'] do
50
- system("cd jetty && git reset --hard HEAD && git clean -dfx & cd ..")
51
- sleep 2
50
+ system("cd jetty && git reset --hard HEAD && git clean -dfx && cd ..")
52
51
  end
53
52
  end
54
53
  end
@@ -27,7 +27,7 @@ gem 'jettywrapper'
27
27
  # For testing
28
28
  group :development, :test do
29
29
  gem 'rspec-rails'
30
- gem 'mocha'
30
+ gem 'mocha', "~> 0.11.4"
31
31
  gem 'cucumber-rails', :require => false
32
32
  gem 'capybara'
33
33
  gem 'factory_girl', '~> 2.6.0'
@@ -0,0 +1,17 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe SolrDocument do
4
+ describe "#to_model" do
5
+
6
+ before do
7
+ class SolrDocumentWithHydraOverride < SolrDocument
8
+ include Hydra::Solr::Document
9
+ end
10
+ end
11
+ # this isn't a great test, but...
12
+ it "should try to cast the SolrDocument to the Fedora object" do
13
+ ActiveFedora::Base.expects(:load_instance_from_solr).with('asdfg', kind_of(SolrDocument))
14
+ SolrDocumentWithHydraOverride.new(:id => 'asdfg').to_model
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-head
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-29 00:00:00.000000000 Z
13
+ date: 2012-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -179,7 +179,7 @@ dependencies:
179
179
  requirements:
180
180
  - - ! '>='
181
181
  - !ruby/object:Gem::Version
182
- version: 0.0.2
182
+ version: 0.0.5
183
183
  type: :runtime
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ dependencies:
187
187
  requirements:
188
188
  - - ! '>='
189
189
  - !ruby/object:Gem::Version
190
- version: 0.0.2
190
+ version: 0.0.5
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: sqlite3
193
193
  requirement: !ruby/object:Gem::Requirement
@@ -599,11 +599,11 @@ files:
599
599
  - lib/hydra/models/file_asset.rb
600
600
  - lib/hydra/repository_controller.rb
601
601
  - lib/hydra/rights_metadata.rb
602
+ - lib/hydra/solr.rb
602
603
  - lib/hydra/submission_workflow.rb
603
604
  - lib/hydra/superuser_attributes.rb
604
605
  - lib/hydra/ui.rb
605
606
  - lib/hydra/ui/controller.rb
606
- - lib/hydra/user.rb
607
607
  - lib/hydra/workflow.rb
608
608
  - lib/hydra/workflow/controller.rb
609
609
  - lib/mediashelf/active_fedora_helper.rb
@@ -728,6 +728,7 @@ files:
728
728
  - test_support/spec/models/generic_content_spec.rb
729
729
  - test_support/spec/models/generic_image_spec.rb
730
730
  - test_support/spec/models/mods_asset_spec.rb
731
+ - test_support/spec/models/solr_document_spec.rb
731
732
  - test_support/spec/models/user_spec.rb
732
733
  - test_support/spec/rcov.opts
733
734
  - test_support/spec/spec.opts
data/lib/hydra/user.rb DELETED
@@ -1,35 +0,0 @@
1
- # Injects behaviors into User model so that it will work with Hydra Access Controls
2
- # By default, this module assumes you are using the User model created by Blacklight, which uses Devise.
3
- # To integrate your own User implementation into Hydra, override this Module or define your own User model in app/models/user.rb within your Hydra head.
4
- require 'deprecation'
5
- module Hydra::User
6
- extend Deprecation
7
-
8
- def self.included(klass)
9
- # Other modules to auto-include
10
- klass.send(:include, Hydra::SuperuserAttributes)
11
- end
12
-
13
- # This method should display the unique identifier for this user as defined by devise.
14
- # The unique identifier is what access controls will be enforced against.
15
- def user_key
16
- send(Devise.authentication_keys.first)
17
- end
18
-
19
-
20
- # This method should display the unique identifier for this user
21
- # the unique identifier is what access controls will be enforced against.
22
- def unique_id
23
- return to_s
24
- end
25
- deprecation_deprecate :unique_id
26
-
27
-
28
-
29
- # For backwards compatibility with the Rails2 User models in Hydra/Blacklight
30
- def login
31
- return unique_id
32
- end
33
- deprecation_deprecate :login
34
-
35
- end