hydra-core 9.0.0.rc2 → 9.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfd6ca42ed2dab7c3a851dcc1adfa878b8729a1b
4
- data.tar.gz: d6c0908393c4d24fc5ba3aefb45bb01432c5b7e7
3
+ metadata.gz: 1d78684487930080bec86b38178c7db06a8d5b27
4
+ data.tar.gz: f4ff2193e8a2c8bcef376e8c27e38d9d55ba2a4d
5
5
  SHA512:
6
- metadata.gz: cbfe289139025b4c65247d87dc7f634699404f80d48c7161d43445b5f6a8048efc05993f3ffce6146f3a00b2ebdcdc09a68a342fec60ab75e0505e376904c010
7
- data.tar.gz: 34e2407cc7a77d2bfcd658d846fad291a5193c495e328436a4eacb315320b139e7006395c91b78c79bb0863c52a5deb884f198f571e366acc69ac38039626a1b
6
+ metadata.gz: 919c39a8ce1ef2e19039f6a3d9510e20acf465b313f558814623f8fcb83c43ebf369c79891e52d3a0b9fdd4c357fb8986c4c0b770b2fd549f9e79cdf7621394f
7
+ data.tar.gz: 1ab0e63052e322ae86a20d8ad05584ceea032c5a41e3e42b79d7798a7325d10f16f392ac25f1313c9fb5fcc3641fe91975a0d50de65aa6c6d520024b5f19d7da
@@ -1,10 +1,10 @@
1
1
  # Include this module into any of your Controller classes to add Hydra functionality
2
2
  #
3
- # The primary function of this module is to mix in a number of other Hydra Modules, including
3
+ # The primary function of this module is to mix in a number of other Hydra Modules, including
4
4
  # Hydra::AccessControlsEnforcement
5
5
  #
6
- # @example
7
- # class CustomHydraController < ApplicationController
6
+ # @example
7
+ # class CustomHydraController < ApplicationController
8
8
  # include Hydra::Controller::ControllerBehavior
9
9
  # end
10
10
  #
@@ -14,27 +14,29 @@ module Hydra::Controller::ControllerBehavior
14
14
  included do
15
15
  # Other modules to auto-include
16
16
  include Hydra::AccessControlsEnforcement
17
-
17
+
18
18
  # Catch permission errors
19
- rescue_from CanCan::AccessDenied do |exception|
20
- if (exception.action == :edit)
21
- redirect_to({:action=>'show'}, :alert => exception.message)
22
- elsif current_user and current_user.persisted?
23
- redirect_to root_path, :alert => exception.message
24
- else
25
- session["user_return_to"] = request.url
26
- redirect_to new_user_session_path, :alert => exception.message
27
- end
28
- end
19
+ rescue_from CanCan::AccessDenied, with: :deny_access
29
20
  end
30
-
31
-
21
+
32
22
  # get the currently configured user identifier. Can be overridden to return whatever (ie. login, email, etc)
33
23
  # defaults to using whatever you have set as the Devise authentication_key
34
24
  def user_key
35
25
  current_user.user_key if current_user
36
26
  end
37
27
 
28
+ # Override this method if you wish to customize the way access is denied
29
+ def deny_access(exception)
30
+ if exception.action == :edit
31
+ redirect_to({ action: 'show' }, alert: exception.message)
32
+ elsif current_user and current_user.persisted?
33
+ redirect_to root_path, alert: exception.message
34
+ else
35
+ session['user_return_to'.freeze] = request.url
36
+ redirect_to new_user_session_path, alert: exception.message
37
+ end
38
+ end
39
+
38
40
  module ClassMethods
39
41
  # get the solr name for a field with this name and using the given solrizer descriptor
40
42
  def solr_name(name, *opts)
data/hydra-core.gemspec CHANGED
@@ -1,7 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  version = File.read(File.expand_path("../../HYDRA_VERSION", __FILE__)).strip
3
3
 
4
-
5
4
  Gem::Specification.new do |gem|
6
5
  gem.authors = ["Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield, Justin Coyne & many more. See https://github.com/projecthydra/hydra-head/contributors"]
7
6
  gem.email = ["hydra-tech@googlegroups.com"]
@@ -19,12 +18,11 @@ Gem::Specification.new do |gem|
19
18
 
20
19
  gem.required_ruby_version = '>= 1.9.3'
21
20
 
22
-
23
- gem.add_dependency "rails", '>= 3.2.3', '< 5'
21
+ gem.add_dependency "rails", '>= 3.2.3', '< 5'
24
22
  gem.add_dependency 'block_helpers'
25
23
  gem.add_dependency 'hydra-access-controls', version
26
- gem.add_dependency 'jettywrapper', ">=1.4.1"
27
-
24
+ gem.add_dependency 'jettywrapper', '>= 2.0.0'
25
+
28
26
  gem.add_development_dependency 'sqlite3'
29
27
  gem.add_development_dependency 'yard'
30
28
  gem.add_development_dependency 'rspec-rails'
@@ -69,8 +69,8 @@ module Hydra
69
69
  file_path = "app/models/#{model_name.underscore}.rb"
70
70
  if File.exists?(file_path)
71
71
  inject_into_class file_path, model_name.classify do
72
- "# Connects this user object to Hydra behaviors. " +
73
- "\n include Hydra::User\n"
72
+ " # Connects this user object to Hydra behaviors.\n" +
73
+ " include Hydra::User\n\n"
74
74
  end
75
75
  else
76
76
  puts " \e[31mFailure\e[0m Hydra requires a user object in order to apply access controls. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g hydra:head client"
@@ -1,3 +1,3 @@
1
1
  module HydraHead
2
- VERSION = "9.0.0.rc2"
2
+ VERSION = "9.0.0.rc3"
3
3
  end
@@ -7,47 +7,20 @@ end
7
7
 
8
8
  namespace :hydra do
9
9
  namespace :jetty do
10
- desc "Copies the default Solr & Fedora configs into the bundled Hydra Testing Server"
10
+ desc "Copies the default Solr config into the bundled Hydra Testing Server"
11
11
  task :config do
12
- Rake::Task["hydra:jetty:config_fedora"].invoke
13
12
  Rake::Task["hydra:jetty:config_solr"].invoke
14
13
  end
15
-
14
+
16
15
  desc "Copies the contents of solr_conf into the Solr development-core and test-core of Testing Server"
17
16
  task :config_solr do
18
- FileList['solr_conf/conf/*'].each do |f|
17
+ FileList['solr_conf/conf/*'].each do |f|
19
18
  cp("#{f}", 'jetty/solr/development-core/conf/', :verbose => true)
20
19
  cp("#{f}", 'jetty/solr/test-core/conf/', :verbose => true)
21
20
  end
22
21
  end
23
22
 
24
- desc "Copies a custom fedora config for the bundled Hydra Testing Server"
25
- task :config_fedora do
26
- # load a custom fedora.fcfg -
27
- if defined?(Rails.root)
28
- app_root = Rails.root
29
- else
30
- app_root = File.join(File.dirname(__FILE__),"..")
31
- end
32
-
33
- fcfg = File.join(app_root,"fedora_conf","conf","development","fedora.fcfg")
34
- if File.exists?(fcfg)
35
- puts "copying over development/fedora.fcfg"
36
- cp("#{fcfg}", 'jetty/fedora/default/server/config/', :verbose => true)
37
- else
38
- puts "#{fcfg} file not found -- skipping fedora config"
39
- end
40
- fcfg = File.join(app_root,"fedora_conf","conf","test","fedora.fcfg")
41
- if File.exists?(fcfg)
42
- puts "copying over test/fedora.fcfg"
43
- cp("#{fcfg}", 'jetty/fedora/test/server/config/', :verbose => true)
44
- else
45
- puts "#{fcfg} file not found -- skipping fedora config"
46
- end
47
- end
48
-
49
23
  desc "Copies the default SOLR config files and starts up the fedora instance."
50
24
  task :load => [:config, 'jetty:start']
51
-
52
25
  end
53
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0.rc2
4
+ version: 9.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield,
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-07 00:00:00.000000000 Z
12
+ date: 2015-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -51,28 +51,28 @@ dependencies:
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 9.0.0.rc2
54
+ version: 9.0.0.rc3
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 9.0.0.rc2
61
+ version: 9.0.0.rc3
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: jettywrapper
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.4.1
68
+ version: 2.0.0
69
69
  type: :runtime
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.4.1
75
+ version: 2.0.0
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: sqlite3
78
78
  requirement: !ruby/object:Gem::Requirement