repository-manager 0.1.19 → 0.1.21

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: 7f4887b6bdb653d978499c8da9c904af411cdcdf
4
- data.tar.gz: 30bcb1450fc36c85e7f45146ddd6d355bcc06032
3
+ metadata.gz: 039847f7aefc14428ba9580ac69fa2421aaf9c2f
4
+ data.tar.gz: 42f647e14302c8845cbb609db5f09259fdf9fbf9
5
5
  SHA512:
6
- metadata.gz: 4a4fad797cc95fd161805a8c226baa52d3a8f209871b3679b27aa68f32629cdc3bfb79d39dfed2797f03453ab604be590a527b45b527cdf6e11f16af6370ece3
7
- data.tar.gz: 01f74b128f2f88026bd078479a0a81268608b9c77ef3830797df2a433c3da52a98edb2df2c022ca8432b567853161abb876d40e3a1d1ee6a796583ee32a663f6
6
+ metadata.gz: 4d02cf94ea13082dd65ecdf3f682bbb46871a6404d651c3365ac152f5a01d2ef417951ee7e38175e38be922d074ffafed8831a33bfb58fd728c98b331382eb85
7
+ data.tar.gz: 73490b6e53f03bbd7951e776988bcff2a1c77b2da222737aebc3f8ddbd97d364695905e023d83fa6cc5c3cda947700f0b5421ec6ef70d3eabdd808dece77aaf7
@@ -16,7 +16,7 @@ class RepositoryManager::RepoFile < RepositoryManager::RepoItem
16
16
 
17
17
  # Downloading this file
18
18
  def download!(options = {})
19
- path = file.path
19
+ file.path
20
20
  end
21
21
 
22
22
  # Copy itself into the source_folder
@@ -121,6 +121,9 @@ class RepositoryManager::RepoFolder < RepositoryManager::RepoItem
121
121
  Zip::File.open(full_path, Zip::File::CREATE) { |zf|
122
122
  add_repo_item_to_zip(children, zf, object)
123
123
  }
124
+
125
+ File.chmod(0444, full_path)
126
+
124
127
  return full_path
125
128
  #else
126
129
  # # Nothing to download here
@@ -167,7 +170,7 @@ class RepositoryManager::RepoFolder < RepositoryManager::RepoItem
167
170
  # object is the object that want to download this file
168
171
  def get_default_download_path(object = nil)
169
172
  object ? add_to_path = object.get_default_download_path(''): add_to_path = ''
170
- "download/#{add_to_path}#{self.class.base_class.to_s.underscore}/#{self.id}/"
173
+ "#{Rails.root.join('download')}/#{add_to_path}#{self.class.base_class.to_s.underscore}/#{self.id}/"
171
174
  end
172
175
 
173
176
  def add_repo_item_to_zip(children, zf, object = nil, prefix = nil)
@@ -5,7 +5,7 @@ class RepositoryManager::RepoItem < ActiveRecord::Base
5
5
 
6
6
  before_save :put_sender
7
7
 
8
- has_ancestry
8
+ has_ancestry cache_depth: true
9
9
 
10
10
  # Associate with the User Class
11
11
  belongs_to :owner, :polymorphic => true
@@ -17,7 +17,7 @@ class RepoFileUploader < CarrierWave::Uploader::Base
17
17
  # Override the directory where uploaded files will be stored.
18
18
  # This is a sensible default for uploaders that are meant to be mounted:
19
19
  def store_dir
20
- "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
20
+ "#{Rails.root.join('uploads')}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
21
21
  end
22
22
 
23
23
  # Provide a default URL as a default if there hasn't been a file uploaded:
@@ -24,7 +24,7 @@ class CreateRepositoryManager < ActiveRecord::Migration
24
24
  t.references :owner, polymorphic: true#, index: true
25
25
  t.references :sender, polymorphic: true#, index: true
26
26
  t.string :ancestry
27
- #t.integer :ancestry_depth, :default => 0
27
+ t.integer :ancestry_depth, :default => 0
28
28
  t.string :name
29
29
  t.float :file_size
30
30
  t.string :content_type
@@ -463,7 +463,7 @@ module RepositoryManager
463
463
  end
464
464
 
465
465
  # Get the download path of the member
466
- def get_default_download_path(prefix = 'download/')
466
+ def get_default_download_path(prefix = "#{Rails.root.join('download')}/")
467
467
  "#{prefix}#{self.class.base_class.to_s.underscore}/#{self.id}/"
468
468
  end
469
469
 
@@ -1,3 +1,3 @@
1
1
  module RepositoryManager
2
- VERSION = '0.1.19'
2
+ VERSION = '0.1.21'
3
3
  end
@@ -24,7 +24,7 @@ class CreateRepositoryManager < ActiveRecord::Migration
24
24
  t.references :owner, polymorphic: true#, index: true
25
25
  t.references :sender, polymorphic: true#, index: true
26
26
  t.string :ancestry
27
- #t.integer :ancestry_depth, :default => 0
27
+ t.integer :ancestry_depth, :default => 0
28
28
  t.string :name
29
29
  t.float :file_size
30
30
  t.string :content_type
@@ -31,6 +31,7 @@ ActiveRecord::Schema.define(version: 20131018214212) do
31
31
  t.integer "sender_id"
32
32
  t.string "sender_type"
33
33
  t.string "ancestry"
34
+ t.integer "ancestry_depth", default: 0
34
35
  t.string "name"
35
36
  t.float "file_size"
36
37
  t.string "content_type"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repository-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.19
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Baumann