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 +4 -4
- data/app/models/repository_manager/repo_file.rb +1 -1
- data/app/models/repository_manager/repo_folder.rb +4 -1
- data/app/models/repository_manager/repo_item.rb +1 -1
- data/app/uploaders/repo_file_uploader.rb +1 -1
- data/db/migrate/20131018214212_create_repository_manager.rb +1 -1
- data/lib/repository_manager/has_repository.rb +1 -1
- data/lib/repository_manager/version.rb +1 -1
- data/spec/dummy/db/migrate/20131018214212_create_repository_manager.rb +1 -1
- data/spec/dummy/db/schema.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 039847f7aefc14428ba9580ac69fa2421aaf9c2f
|
4
|
+
data.tar.gz: 42f647e14302c8845cbb609db5f09259fdf9fbf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d02cf94ea13082dd65ecdf3f682bbb46871a6404d651c3365ac152f5a01d2ef417951ee7e38175e38be922d074ffafed8831a33bfb58fd728c98b331382eb85
|
7
|
+
data.tar.gz: 73490b6e53f03bbd7951e776988bcff2a1c77b2da222737aebc3f8ddbd97d364695905e023d83fa6cc5c3cda947700f0b5421ec6ef70d3eabdd808dece77aaf7
|
@@ -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)
|
@@ -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
|
-
|
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
|
|
@@ -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
|
-
|
27
|
+
t.integer :ancestry_depth, :default => 0
|
28
28
|
t.string :name
|
29
29
|
t.float :file_size
|
30
30
|
t.string :content_type
|
data/spec/dummy/db/schema.rb
CHANGED