sufia-models 3.5.0 → 3.6.0

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: f7000540d10c6082fbe78b05a2043eb11f555635
4
- data.tar.gz: 60e2c7dc3e31acd37648c671f5df9835f151b913
3
+ metadata.gz: 473c65f0756556119b1e9710330f297de48b7515
4
+ data.tar.gz: 12f4b8a3380a9f839afab703e225e0fafbc6fad1
5
5
  SHA512:
6
- metadata.gz: 61cb90f5d5c5cbf94aca85a2e23a69f20b03b33105808febb2492c4cc55779c49177abbbcfcbdf65b276617281ccf86eadcb2b55674e2c94130cf4364225c2ed
7
- data.tar.gz: d0226b74b4c91b7ee635afdf6f37baacd31e8025b53e079a1c123cfa97f1fbd2dfc7851c585f82053e498ab12857600041047d5fce3bbe7541ae69424e762caf
6
+ metadata.gz: 3b5892c1e42e9fefa5f9b64a75cae761c37ff06fba9a8a92b198f20c06982f79943af6f6020a76946b82f81c78f71fc479111da93aa24a850ae71adeb5fc163f
7
+ data.tar.gz: 534a0750f304ec5600b9eafabfec6fe527241b7e1780d6fe32b01299d186d9d5fce0941ef5aa64986f626318ab998d803d9833e47b47efbe6d07c24f1a2fb17b
@@ -66,11 +66,11 @@ module Sufia::User
66
66
 
67
67
  # The basic groups method, override or will fallback to Sufia::Ldap::User
68
68
  def groups
69
- return self.group_list ? self.group_list.split(";?;") : []
69
+ @groups ||= self.group_list ? self.group_list.split(";?;") : []
70
70
  end
71
71
 
72
72
  def ability
73
- @ability ||= Ability.new(self)
73
+ @ability ||= ::Ability.new(self)
74
74
  end
75
75
 
76
76
  module ClassMethods
@@ -45,7 +45,8 @@ This generator makes the following changes to your application:
45
45
  "create_version_committers.rb",
46
46
  "add_groups_to_users.rb",
47
47
  "create_local_authorities.rb",
48
- "create_trophies.rb"
48
+ "create_trophies.rb",
49
+ 'add_linkedin_to_users.rb'
49
50
  ].each do |file|
50
51
  better_migration_template file
51
52
  end
@@ -0,0 +1,5 @@
1
+ class AddLinkedinToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :linkedin_handle, :string
4
+ end
5
+ end
@@ -32,7 +32,6 @@ module Sufia::GenericFile
32
32
  end
33
33
 
34
34
  generic_file.record_version_committer(user)
35
- Sufia.queue.push(UnzipJob.new(generic_file.pid)) if generic_file.content.mimeType == 'application/zip'
36
35
  if Sufia.config.respond_to?(:after_create_content)
37
36
  Sufia.config.after_create_content.call(generic_file, user)
38
37
  end
@@ -1,5 +1,5 @@
1
1
  module Sufia
2
2
  module Models
3
- VERSION = "3.5.0"
3
+ VERSION = "3.6.0"
4
4
  end
5
5
  end
data/sufia-models.gemspec CHANGED
@@ -1,10 +1,9 @@
1
1
  # coding: utf-8
2
2
  version = File.read(File.expand_path("../../SUFIA_VERSION", __FILE__)).strip
3
3
 
4
-
5
4
  Gem::Specification.new do |spec|
6
5
  spec.name = "sufia-models"
7
- spec.version = version
6
+ spec.version = version
8
7
  spec.authors = [
9
8
  "Jeremy Friesen",
10
9
  ]
@@ -27,11 +26,11 @@ Gem::Specification.new do |spec|
27
26
  spec.add_development_dependency "bundler", "~> 1.3"
28
27
  spec.add_development_dependency "rake"
29
28
 
30
- spec.add_dependency 'rails', '>= 3.2.13', '< 5.0'
29
+ spec.add_dependency 'rails', '> 4.0.0', '< 5.0'
31
30
  spec.add_dependency 'activeresource' # No longer a dependency of rails 4.0
32
31
 
33
32
  # spec.add_dependency "hydra", "6.1.0.rc2"
34
- # Since hydra 6.1 isn't out yet, we'll just build it so that it's compatible
33
+ # Since hydra 6.1 isn't out yet, we'll just build it so that it's compatible
35
34
  # without an explicit dependency
36
35
  spec.add_dependency "active-fedora", "~> 6.7.0"
37
36
  spec.add_dependency "blacklight", "~> 4.5.0"
@@ -44,7 +43,6 @@ Gem::Specification.new do |spec|
44
43
  spec.add_dependency 'mailboxer', '~> 0.11.0'
45
44
  spec.add_dependency 'acts_as_follower', '>= 0.1.1', '< 0.3'
46
45
  spec.add_dependency 'paperclip', '~> 3.4.0'
47
- spec.add_dependency 'zipruby', '0.3.6'
48
46
  spec.add_dependency 'hydra-derivatives', '~> 0.0.5'
49
47
  spec.add_dependency 'activerecord-import'
50
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sufia-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,9 +42,9 @@ dependencies:
42
42
  name: rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - '>'
46
46
  - !ruby/object:Gem::Version
47
- version: 3.2.13
47
+ version: 4.0.0
48
48
  - - <
49
49
  - !ruby/object:Gem::Version
50
50
  version: '5.0'
@@ -52,9 +52,9 @@ dependencies:
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '>='
55
+ - - '>'
56
56
  - !ruby/object:Gem::Version
57
- version: 3.2.13
57
+ version: 4.0.0
58
58
  - - <
59
59
  - !ruby/object:Gem::Version
60
60
  version: '5.0'
@@ -218,20 +218,6 @@ dependencies:
218
218
  - - ~>
219
219
  - !ruby/object:Gem::Version
220
220
  version: 3.4.0
221
- - !ruby/object:Gem::Dependency
222
- name: zipruby
223
- requirement: !ruby/object:Gem::Requirement
224
- requirements:
225
- - - '='
226
- - !ruby/object:Gem::Version
227
- version: 0.3.6
228
- type: :runtime
229
- prerelease: false
230
- version_requirements: !ruby/object:Gem::Requirement
231
- requirements:
232
- - - '='
233
- - !ruby/object:Gem::Version
234
- version: 0.3.6
235
221
  - !ruby/object:Gem::Dependency
236
222
  name: hydra-derivatives
237
223
  requirement: !ruby/object:Gem::Requirement
@@ -306,6 +292,7 @@ files:
306
292
  - lib/generators/sufia/models/templates/migrations/add_avatars_to_users.rb
307
293
  - lib/generators/sufia/models/templates/migrations/add_groups_to_users.rb
308
294
  - lib/generators/sufia/models/templates/migrations/add_ldap_attrs_to_user.rb
295
+ - lib/generators/sufia/models/templates/migrations/add_linkedin_to_users.rb
309
296
  - lib/generators/sufia/models/templates/migrations/add_social_to_users.rb
310
297
  - lib/generators/sufia/models/templates/migrations/create_checksum_audit_logs.rb
311
298
  - lib/generators/sufia/models/templates/migrations/create_local_authorities.rb
@@ -344,7 +331,6 @@ files:
344
331
  - lib/sufia/models/jobs/resolrize_job.rb
345
332
  - lib/sufia/models/jobs/transcode_audio_job.rb
346
333
  - lib/sufia/models/jobs/transcode_video_job.rb
347
- - lib/sufia/models/jobs/unzip_job.rb
348
334
  - lib/sufia/models/model_methods.rb
349
335
  - lib/sufia/models/noid.rb
350
336
  - lib/sufia/models/resque.rb
@@ -375,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
375
361
  version: '0'
376
362
  requirements: []
377
363
  rubyforge_project:
378
- rubygems_version: 2.0.14
364
+ rubygems_version: 2.1.11
379
365
  signing_key:
380
366
  specification_version: 4
381
367
  summary: Models and services for sufia
@@ -1,38 +0,0 @@
1
- class UnzipJob < ActiveFedoraPidBasedJob
2
- def queue_name
3
- :unzip
4
- end
5
-
6
- def run
7
- Zip::Archive.open_buffer(object.content.content) do |archive|
8
- archive.each do |f|
9
- if f.directory?
10
- create_directory(f)
11
- else
12
- create_file(f)
13
- end
14
- end
15
- end
16
- end
17
-
18
- protected
19
-
20
- # Creates a GenericFile object based on +file+
21
- # @param file [Zip::File]
22
- def create_file(file)
23
- @generic_file = GenericFile.new
24
- @generic_file.batch_id = object.batch.pid
25
- @generic_file.add_file(file.read, 'content', file.name)
26
- @generic_file.apply_depositor_metadata(object.edit_users.first)
27
- @generic_file.date_uploaded = Time.now.ctime
28
- @generic_file.date_modified = Time.now.ctime
29
- @generic_file.save
30
- end
31
-
32
- # Creates representation of directory corresponding to +file+
33
- # Default behavior: _do nothing_
34
- # @param file [Zip::File]
35
- def create_directory(file)
36
- end
37
-
38
- end