hydra-file-access 5.0.0.pre4 → 5.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency "rails", '~>3.2.3'
22
22
  gem.add_dependency "blacklight", '~>3.4'
23
23
  gem.add_dependency "devise"
24
- gem.add_dependency "active-fedora", '~>4.1'
24
+ gem.add_dependency "active-fedora"
25
25
  gem.add_dependency 'RedCloth', '=4.2.9'
26
26
  gem.add_dependency 'block_helpers'
27
27
  gem.add_dependency 'sanitize'
@@ -1,7 +1,5 @@
1
1
  # @deprecated Create Model-specific Controllers instead ie. ArticlesController, ETDController, etc.
2
- # Also see Hydra::Controller::AssetsControllerBehavior for more info.
3
- # will move to lib/hydra/controller / assets_controller_behavior.rb in release 5.x
4
- require 'om'
2
+ require 'deprecation'
5
3
 
6
4
  module Hydra::Controller::AssetsControllerBehavior
7
5
  extend ActiveSupport::Concern
@@ -10,8 +8,10 @@ module Hydra::Controller::AssetsControllerBehavior
10
8
  include Hydra::Controller::RepositoryControllerBehavior
11
9
  include Hydra::AssetsControllerHelper
12
10
  include Blacklight::Catalog
11
+ extend Deprecation
13
12
 
14
13
  included do
14
+ Deprecation.warn Hydra::Controller::AssetsControllerBehavior, "Hydra::Controller::AssetsControllerBehavior will be removed in hydra-head 6.0"
15
15
  helper :hydra
16
16
  before_filter :search_session, :history_session
17
17
  before_filter :load_document, :only => :update # allows other filters to operate on the document before the update method is called
@@ -1,8 +1,15 @@
1
- # will move to lib/hydra/controller / file_assets_controller_behavior.rb in release 5.x
1
+ # @deprecated
2
+ # Include this module in a controller to generically interact with any FileAsset in generic ways
3
+ # created with the assumption that you are using the genric AssetsControllerBehavior (also @deprecated)
4
+ require 'deprecation'
5
+
2
6
  module Hydra::Controller::FileAssetsBehavior
3
7
  extend ActiveSupport::Concern
8
+ extend Deprecation
4
9
 
5
10
  included do
11
+ Deprecation.warn Hydra::Controller::FileAssetsBehavior, "Hydra::Controller::FileAssetsBehavior will be removed in hydra-head 6.0"
12
+
6
13
  include Hydra::AccessControlsEnforcement
7
14
  include Hydra::AssetsControllerHelper
8
15
  include Hydra::Controller::UploadBehavior
@@ -56,7 +56,7 @@ module Hydra::SubmissionWorkflow
56
56
  return_params.delete(:wf_step)
57
57
  return catalog_path(id, return_params)
58
58
  end
59
- return edit_catalog_path(id,return_params)
59
+ return catalog_path(id,return_params)
60
60
  end
61
61
 
62
62
  # Convenience method to return the partial for any given step by name.
@@ -20,7 +20,7 @@ describe Hydra::FileAssetsController do
20
20
  describe "index" do
21
21
 
22
22
  it "should find all file assets in the repo if no container_id is provided" do
23
- ActiveFedora::SolrService.should_receive(:query).with("has_model_s:info\\:fedora/afmodel\\:FileAsset", {:sort=>["system_create_dt asc"]}).and_return("solr result")
23
+ ActiveFedora::SolrService.should_receive(:query).with("has_model_s:info\\:fedora\\/afmodel\\:FileAsset", {:sort=>["system_create_dt asc"]}).and_return("solr result")
24
24
  controller.stub(:load_permissions_from_solr)
25
25
  ActiveFedora::Base.should_receive(:new).never
26
26
  xhr :get, :index
@@ -51,7 +51,6 @@ describe Hydra::FileAssetsController do
51
51
  it "should redirect back if current_user does not have read or edit permissions" do
52
52
  mock_user = double("User")
53
53
  mock_user.stub(:email).and_return("fake_user@example.com")
54
- mock_user.stub(:is_being_superuser?).and_return(false)
55
54
  mock_user.stub(:persisted?).and_return(true)
56
55
  mock_user.stub(:new_record?).and_return(false)
57
56
  controller.stub(:current_user).and_return(mock_user)
@@ -62,7 +61,6 @@ describe Hydra::FileAssetsController do
62
61
  it "should redirect to the login page if the user is not logged in" do
63
62
  mock_user = double("User")
64
63
  mock_user.stub(:email).and_return("fake_user@example.com")
65
- mock_user.stub(:is_being_superuser?).and_return(false)
66
64
  mock_user.stub(:persisted?).and_return(false)
67
65
  mock_user.stub(:new_record?).and_return(true)
68
66
  controller.stub(:current_user).and_return(mock_user)
@@ -97,7 +95,7 @@ describe Hydra::FileAssetsController do
97
95
  it "should redirect back to edit view if no Filedata is provided but container_id is provided" do
98
96
  controller.should_receive(:model_config).at_least(:once).and_return(controller.workflow_config[:mods_assets])
99
97
  xhr :post, :create, :container_id=>"_PID_", :wf_step=>"files"
100
- response.should redirect_to edit_catalog_path("_PID_", :wf_step=>"permissions")
98
+ response.should redirect_to catalog_path("_PID_", :wf_step=>"permissions")
101
99
  request.flash[:notice].should == "You must specify a file to upload."
102
100
  end
103
101
  it "should display a message that you need to select a file to upload if no Filedata is provided" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-file-access
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.pre4
4
+ version: 5.0.0.pre6
5
5
  prerelease: 6
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-10-06 00:00:00.000000000 Z
13
+ date: 2012-10-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -65,17 +65,17 @@ dependencies:
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
- - - ~>
68
+ - - ! '>='
69
69
  - !ruby/object:Gem::Version
70
- version: '4.1'
70
+ version: '0'
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
- - - ~>
76
+ - - ! '>='
77
77
  - !ruby/object:Gem::Version
78
- version: '4.1'
78
+ version: '0'
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: RedCloth
81
81
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +163,7 @@ dependencies:
163
163
  requirements:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
- version: 5.0.0.pre4
166
+ version: 5.0.0.pre6
167
167
  type: :runtime
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
@@ -171,7 +171,7 @@ dependencies:
171
171
  requirements:
172
172
  - - '='
173
173
  - !ruby/object:Gem::Version
174
- version: 5.0.0.pre4
174
+ version: 5.0.0.pre6
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: sqlite3
177
177
  requirement: !ruby/object:Gem::Requirement