blog_logic 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.6
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
- "ckeditor_assets/attachments/#{model.id}"
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
- "ckeditor_assets/pictures/#{model.id}"
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "blog_logic"
8
- s.version = "1.4.6"
8
+ s.version = "1.4.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bantik"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blog_logic
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 6
10
- version: 1.4.6
9
+ - 7
10
+ version: 1.4.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bantik