sufia 3.1.3 → 3.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1aa23489833763f7e8ffcd0c510ba8a2218af2b
4
- data.tar.gz: 0a9ce2418842b3fefd0112df841e17ae937a3a81
3
+ metadata.gz: ffa4a49e5c8afcbf9f0ef5a16f0ed722505de7c0
4
+ data.tar.gz: 255f5e0b340379b077a64e2cee5b1db7d9dfa362
5
5
  SHA512:
6
- metadata.gz: 62ee1f3d317dffbb1818da196511edc65279a594d98f1353facf6840c1bc9cbe4e123b33d45dbbe04a66a152dcc6a3dd4cebcd6fee0eb136fe3f39ad2895f260
7
- data.tar.gz: f94eb66b9f1db63ee57140bf3d535bde13ea41433667711a3e62a764472acc0c085af4ddacfd2d6df1d7aa303f2d3975f1c95ca561e224be867997750a0ffb73
6
+ metadata.gz: 46d39fa82b03a024b14b1481c02cd631eb5948e476ea533bc43fcc8b8a52d97f83f6cf1cd1833f8f16960ac7993785653294c08c8e8cd037dd19dcc83de5bf27
7
+ data.tar.gz: 5e2acc470ce6e34839fa45707a2c9174fd34eaa42d64c025c5a8d19dc395023b7f6e925e26b75efae2cc96f1321ab637fd87ac9cb9d97c7e5fc84f326ccaa69c
data/History.md CHANGED
@@ -1,4 +1,16 @@
1
1
  # History of Sufia releases
2
+
3
+ ## 3.2.1
4
+ * Updating gemspec to not limit on sufia-models [Jeremy Friesen]
5
+
6
+ ## 3.2.0 - YANKED
7
+ * Including on sufia-models subdir in gemspec [Jeremy Friesen]
8
+ * Restoring the exception catching for migrations [Jeremy Friesen]
9
+ * Publicizing #visibility_changed? [Jeremy Friesen]
10
+ * Indicating attr_accessible is deprecated [Jeremy Friesen]
11
+ * Removing ActiveModel::Dirty [Jeremy Friesen]
12
+ * Upgrading ActiveFedora to latest 6.5 version [Adam Wead]
13
+
2
14
  ## 3.1.3
3
15
  * Removed old PSU licence [Justin Coyne]
4
16
 
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.2.1
@@ -1,3 +1,3 @@
1
1
  module Sufia
2
- VERSION = "3.1.3"
2
+ VERSION = "3.2.1"
3
3
  end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Sufia::GenericFile::Visibility do
4
+ module VisibilityOverride
5
+ extend ActiveSupport::Concern
6
+ include Sufia::GenericFile::Permissions
7
+ def visibility; super; end
8
+ def visibility=(value); super(value); end
9
+ end
10
+ class MockParent < ActiveFedora::Base
11
+ include VisibilityOverride
12
+ end
13
+
14
+ it 'allows for overrides of visibility' do
15
+ expect{
16
+ MockParent.new(visibility: Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE)
17
+ }.to_not raise_error
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  class ChecksumAuditLog < ActiveRecord::Base
2
- attr_accessible :pass, :pid, :dsid, :version, :created_at if Rails::VERSION::MAJOR == 3
2
+ deprecated_attr_accessible :pass, :pid, :dsid, :version, :created_at
3
3
 
4
4
  def ChecksumAuditLog.get_audit_log(version)
5
5
  ChecksumAuditLog.find_or_create_by_pid_and_dsid_and_version(:pid => version.pid,
@@ -1,5 +1,5 @@
1
1
  class DomainTerm < ActiveRecord::Base
2
- attr_accessible :model, :term if Rails::VERSION::MAJOR == 3
2
+ deprecated_attr_accessible :model, :term
3
3
 
4
4
  # TODO we should add an index on this join table and remove the uniq query
5
5
  has_and_belongs_to_many :local_authorities, :uniq=> true
@@ -2,7 +2,7 @@ require 'rdf'
2
2
  require 'rdf/rdfxml'
3
3
 
4
4
  class LocalAuthority < ActiveRecord::Base
5
- attr_accessible :name if Rails::VERSION::MAJOR == 3
5
+ deprecated_attr_accessible :name
6
6
  # TODO we should add an index on this join table and remove the uniq query
7
7
  has_and_belongs_to_many :domain_terms, :uniq=> true
8
8
  has_many :local_authority_entries
@@ -1,4 +1,4 @@
1
1
  class LocalAuthorityEntry < ActiveRecord::Base
2
2
  belongs_to :local_authority
3
- attr_accessible :local_authority, :label, :uri if Rails::VERSION::MAJOR == 3
3
+ deprecated_attr_accessible :local_authority, :label, :uri
4
4
  end
@@ -1,6 +1,6 @@
1
1
  class SingleUseLink < ActiveRecord::Base
2
2
 
3
- attr_accessible :downloadKey, :expires, :itemId, :path if Rails::VERSION::MAJOR == 3
3
+ deprecated_attr_accessible :downloadKey, :expires, :itemId, :path
4
4
 
5
5
 
6
6
  def self.create_show(item_id)
@@ -1,5 +1,5 @@
1
1
  class Trophy < ActiveRecord::Base
2
- attr_accessible :generic_file_id, :user_id if Rails::VERSION::MAJOR == 3
2
+ deprecated_attr_accessible :generic_file_id, :user_id
3
3
 
4
4
  validate :count_within_limit, :on => :create
5
5
 
@@ -1,3 +1,3 @@
1
1
  class VersionCommitter < ActiveRecord::Base
2
- attr_accessible :obj_id, :datastream_id, :version_id, :committer_login if Rails::VERSION::MAJOR == 3
2
+ deprecated_attr_accessible :obj_id, :datastream_id, :version_id, :committer_login
3
3
  end
@@ -92,7 +92,11 @@ This generator makes the following changes to your application:
92
92
  private
93
93
 
94
94
  def better_migration_template(file)
95
- migration_template "migrations/#{file}", "db/migrate/#{file}"
95
+ begin
96
+ migration_template "migrations/#{file}", "db/migrate/#{file}"
97
+ rescue Rails::Generators::Error => e
98
+ say_status("warning", e.message, :yellow)
99
+ end
96
100
  end
97
101
 
98
102
  end
@@ -0,0 +1,16 @@
1
+ module ActiveRecord
2
+ module DeprecatedAttrAccessible
3
+ extend ActiveSupport::Concern
4
+ module ClassMethods
5
+ def deprecated_attr_accessible(*args)
6
+ if Rails::VERSION::MAJOR < 4 || defined?(ProtectedAttributes)
7
+ ActiveSupport::Deprecation.warn("deprecated_attr_accessible is, wait for it, deprecated. It will be removed when Sufia stops support Rails 3.")
8
+ attr_accessible(*args)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
14
+ ActiveRecord::Base.class_eval do
15
+ include ActiveRecord::DeprecatedAttrAccessible
16
+ end
@@ -37,6 +37,7 @@ module Sufia
37
37
  initializer "patches" do
38
38
  require 'sufia/models/active_fedora/redis'
39
39
  require 'sufia/models/active_record/redis'
40
+ require 'sufia/models/active_record/deprecated_attr_accessible'
40
41
  require 'sufia/models/active_support/core_ext/marshal' unless Rails::VERSION::MAJOR == 4
41
42
  end
42
43
 
@@ -3,13 +3,8 @@ module Sufia
3
3
  module Visibility
4
4
  extend ActiveSupport::Concern
5
5
  extend Deprecation
6
- include ActiveModel::Dirty
7
6
 
8
- included do
9
- define_attribute_methods :visibility
10
- end
11
-
12
- def visibility= (value)
7
+ def visibility=(value)
13
8
  return if value.nil?
14
9
  # only set explicit permissions
15
10
  case value
@@ -17,7 +12,7 @@ module Sufia
17
12
  public_visibility!
18
13
  when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
19
14
  registered_visibility!
20
- when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
15
+ when Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
21
16
  private_visibility!
22
17
  else
23
18
  raise ArgumentError, "Invalid visibility: #{value.inspect}"
@@ -39,25 +34,32 @@ module Sufia
39
34
  self.visibility= visibility
40
35
  end
41
36
 
42
- private
43
- def public_visibility!
44
- visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
45
- self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "read")
46
- end
37
+ def visibility_changed?
38
+ @visibility_will_change
39
+ end
47
40
 
48
- def registered_visibility!
49
- visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
50
- self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "read")
51
- self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
52
- end
41
+ private
42
+ def visibility_will_change!
43
+ @visibility_will_change = true
44
+ end
45
+
46
+ def public_visibility!
47
+ visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC
48
+ self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "read")
49
+ end
50
+
51
+ def registered_visibility!
52
+ visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
53
+ self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "read")
54
+ self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
55
+ end
56
+
57
+ def private_visibility!
58
+ visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
59
+ self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "none")
60
+ self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
61
+ end
53
62
 
54
- def private_visibility!
55
- visibility_will_change! unless visibility == Sufia::Models::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE
56
- self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_AUTHENTICATED}, "none")
57
- self.datastreams["rightsMetadata"].permissions({:group=>Sufia::Models::AccessRight::PERMISSION_TEXT_VALUE_PUBLIC}, "none")
58
- end
59
63
  end
60
64
  end
61
65
  end
62
-
63
-
@@ -19,7 +19,7 @@ module Sufia::User
19
19
  acts_as_followable
20
20
 
21
21
  # Setup accessible (or protected) attributes for your model
22
- attr_accessible *permitted_attributes if Rails::VERSION::MAJOR == 3
22
+ deprecated_attr_accessible *permitted_attributes
23
23
 
24
24
  # Add user avatar (via paperclip library)
25
25
  has_attached_file :avatar, :styles => { medium: "300x300>", thumb: "100x100>" }, :default_url => '/assets/missing_:style.png'
@@ -1,5 +1,5 @@
1
1
  module Sufia
2
2
  module Models
3
- VERSION = "3.1.3"
3
+ VERSION = "3.2.1"
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
  # This is a temporary homepage until we've had a chance to review the
18
18
  # process
19
- spec.homepage = "https://github.com/jeremyf/sufia"
19
+ spec.homepage = "https://github.com/projecthydra/sufia"
20
20
  spec.license = "Apache"
21
21
 
22
22
  spec.files = `git ls-files`.split($/)
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.add_dependency 'rails', '>= 3.2.13', '< 5.0'
31
31
  spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
32
32
  spec.add_dependency "hydra-head", "~> 6.3.0"
33
- spec.add_dependency 'active-fedora', "~> 6.4.0"
33
+ spec.add_dependency 'active-fedora', "~> 6.5.0"
34
34
 
35
35
  spec.add_dependency 'nest', '~> 1.1.1'
36
36
  spec.add_dependency 'resque', '~> 1.23.0'#, :require => 'resque/server'
@@ -32,6 +32,7 @@ tag = "v#{version}"
32
32
  File.open(file, 'w') { |f| f.write ruby }
33
33
  end
34
34
  end
35
+ task :pkg
35
36
  task gem => %w(update_version_rb pkg) do
36
37
  cmd = ""
37
38
  cmd << "cd #{framework} && " unless framework == "sufia"
@@ -47,7 +48,7 @@ tag = "v#{version}"
47
48
  task :prep_release => [:ensure_clean_state, :build]
48
49
 
49
50
  task :push => :build do
50
- sh "gem push #{gem}"
51
+ # sh "gem push #{gem}"
51
52
  end
52
53
  end
53
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sufia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-28 00:00:00.000000000 Z
11
+ date: 2013-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sufia-models
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.3
19
+ version: 3.2.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.3
26
+ version: 3.2.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: blacklight
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -591,6 +591,7 @@ files:
591
591
  - spec/models/file_content_datastream_spec.rb
592
592
  - spec/models/fits_datastream_spec.rb
593
593
  - spec/models/generic_file/actions_spec.rb
594
+ - spec/models/generic_file/visibility_spec.rb
594
595
  - spec/models/generic_file/web_form_spec.rb
595
596
  - spec/models/generic_file_spec.rb
596
597
  - spec/models/local_authority_spec.rb
@@ -659,6 +660,7 @@ files:
659
660
  - sufia-models/lib/generators/sufia/models/templates/migrations/create_version_committers.rb
660
661
  - sufia-models/lib/sufia/models.rb
661
662
  - sufia-models/lib/sufia/models/active_fedora/redis.rb
663
+ - sufia-models/lib/sufia/models/active_record/deprecated_attr_accessible.rb
662
664
  - sufia-models/lib/sufia/models/active_record/redis.rb
663
665
  - sufia-models/lib/sufia/models/active_support/core_ext/marshal.rb
664
666
  - sufia-models/lib/sufia/models/engine.rb
@@ -752,7 +754,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
752
754
  version: '0'
753
755
  requirements: []
754
756
  rubyforge_project:
755
- rubygems_version: 2.0.5
757
+ rubygems_version: 2.0.3
756
758
  signing_key:
757
759
  specification_version: 4
758
760
  summary: Sufia was extracted from ScholarSphere developed by Penn State University
@@ -843,6 +845,7 @@ test_files:
843
845
  - spec/models/file_content_datastream_spec.rb
844
846
  - spec/models/fits_datastream_spec.rb
845
847
  - spec/models/generic_file/actions_spec.rb
848
+ - spec/models/generic_file/visibility_spec.rb
846
849
  - spec/models/generic_file/web_form_spec.rb
847
850
  - spec/models/generic_file_spec.rb
848
851
  - spec/models/local_authority_spec.rb
@@ -863,4 +866,3 @@ test_files:
863
866
  - spec/support/lib/generators/test_app_generator.rb
864
867
  - spec/support/uploaded_file_monkeypatch.rb
865
868
  - spec/views/batch_edits/check_all_spec.rb
866
- has_rdoc: