blog_logic 1.4.6 → 1.4.7
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.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.7
|
@@ -1,45 +1,10 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
class BlogImageUploader < CarrierWave::Uploader::Base
|
4
|
-
|
5
|
-
# Include RMagick or ImageScience support:
|
6
2
|
include CarrierWave::RMagick
|
7
|
-
# include CarrierWave::ImageScience
|
8
3
|
|
9
|
-
# Override the directory where uploaded files will be stored.
|
10
|
-
# This is a sensible default for uploaders that are meant to be mounted:
|
11
4
|
def store_dir
|
12
5
|
"#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
13
6
|
end
|
14
7
|
|
15
|
-
# Provide a default URL as a default if there hasn't been a file uploaded:
|
16
|
-
# def default_url
|
17
|
-
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
18
|
-
# end
|
19
|
-
|
20
|
-
# Process files as they are uploaded:
|
21
|
-
# process :scale => [200, 300]
|
22
|
-
#
|
23
|
-
# def scale(width, height)
|
24
|
-
# # do something
|
25
|
-
# end
|
26
|
-
|
27
|
-
# Create different versions of your uploaded files:
|
28
|
-
# version :thumb do
|
29
|
-
# process :scale => [50, 50]
|
30
|
-
# end
|
31
8
|
version :content
|
32
9
|
version :thumb
|
33
|
-
|
34
|
-
# Add a white list of extensions which are allowed to be uploaded.
|
35
|
-
# For images you might use something like this:
|
36
|
-
# def extension_white_list
|
37
|
-
# %w(jpg jpeg gif png)
|
38
|
-
# end
|
39
|
-
|
40
|
-
# Override the filename of the uploaded files:
|
41
|
-
# def filename
|
42
|
-
# "something.jpg" if original_filename
|
43
|
-
# end
|
44
|
-
|
45
|
-
end
|
10
|
+
end
|
@@ -1,42 +1,11 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base
|
3
2
|
include Ckeditor::Backend::CarrierWave
|
4
|
-
|
5
|
-
# Include RMagick or ImageScience support:
|
6
|
-
# include CarrierWave::RMagick
|
7
|
-
# include CarrierWave::MiniMagick
|
8
|
-
# include CarrierWave::ImageScience
|
9
3
|
|
10
|
-
# Choose what kind of storage to use for this uploader:
|
11
|
-
storage :file
|
12
|
-
|
13
|
-
# Override the directory where uploaded files will be stored.
|
14
|
-
# This is a sensible default for uploaders that are meant to be mounted:
|
15
4
|
def store_dir
|
16
|
-
"
|
5
|
+
Rails.env.test? ? "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" : "#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
17
6
|
end
|
18
7
|
|
19
|
-
# Provide a default URL as a default if there hasn't been a file uploaded:
|
20
|
-
# def default_url
|
21
|
-
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
22
|
-
# end
|
23
|
-
|
24
|
-
# Process files as they are uploaded:
|
25
|
-
# process :scale => [200, 300]
|
26
|
-
#
|
27
|
-
# def scale(width, height)
|
28
|
-
# # do something
|
29
|
-
# end
|
30
|
-
|
31
|
-
# Add a white list of extensions which are allowed to be uploaded.
|
32
|
-
# For images you might use something like this:
|
33
8
|
def extension_white_list
|
34
9
|
Ckeditor.attachment_file_types
|
35
10
|
end
|
36
|
-
|
37
|
-
# Override the filename of the uploaded files:
|
38
|
-
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
39
|
-
# def filename
|
40
|
-
# "something.jpg" if original_filename
|
41
|
-
# end
|
42
|
-
end
|
11
|
+
end
|
@@ -1,36 +1,13 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
class CkeditorPictureUploader < CarrierWave::Uploader::Base
|
3
2
|
include Ckeditor::Backend::CarrierWave
|
4
|
-
|
5
|
-
# Include RMagick or ImageScience support:
|
6
|
-
# include CarrierWave::RMagick
|
7
3
|
include CarrierWave::MiniMagick
|
8
|
-
# include CarrierWave::ImageScience
|
9
|
-
|
10
|
-
# Choose what kind of storage to use for this uploader:
|
11
|
-
storage :file
|
12
4
|
|
13
|
-
# Override the directory where uploaded files will be stored.
|
14
|
-
# This is a sensible default for uploaders that are meant to be mounted:
|
15
5
|
def store_dir
|
16
|
-
"
|
6
|
+
Rails.env.test? ? "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" : "#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
17
7
|
end
|
18
8
|
|
19
|
-
# Provide a default URL as a default if there hasn't been a file uploaded:
|
20
|
-
# def default_url
|
21
|
-
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
22
|
-
# end
|
23
|
-
|
24
|
-
# Process files as they are uploaded:
|
25
|
-
# process :scale => [200, 300]
|
26
|
-
#
|
27
|
-
# def scale(width, height)
|
28
|
-
# # do something
|
29
|
-
# end
|
30
|
-
|
31
9
|
process :read_dimensions
|
32
10
|
|
33
|
-
# Create different versions of your uploaded files:
|
34
11
|
version :thumb do
|
35
12
|
process :resize_to_fill => [118, 100]
|
36
13
|
end
|
@@ -39,15 +16,7 @@ class CkeditorPictureUploader < CarrierWave::Uploader::Base
|
|
39
16
|
process :resize_to_limit => [800, 800]
|
40
17
|
end
|
41
18
|
|
42
|
-
# Add a white list of extensions which are allowed to be uploaded.
|
43
|
-
# For images you might use something like this:
|
44
19
|
def extension_white_list
|
45
20
|
Ckeditor.image_file_types
|
46
21
|
end
|
47
|
-
|
48
|
-
# Override the filename of the uploaded files:
|
49
|
-
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
50
|
-
# def filename
|
51
|
-
# "something.jpg" if original_filename
|
52
|
-
# end
|
53
|
-
end
|
22
|
+
end
|
data/blog_logic.gemspec
CHANGED
metadata
CHANGED