redactor-rails-paperclip 0.4.1 → 0.4.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,12 +8,16 @@ This gem bundles Redactor version 8.2.2 which is the most recent version as of J
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'redactor-rails', github: 'sergio1990/redactor-rails', branch: :paperclip
11
+ gem 'redactor-rails-paperclip'
12
12
 
13
13
  And then execute:
14
14
 
15
15
  $ bundle install
16
16
 
17
+ Add to application.rb:
18
+
19
+ require 'redactor-rails'
20
+
17
21
  ### Now generate models for store uploading files
18
22
 
19
23
  #### ActiveRecord + carrierwave
@@ -40,6 +40,10 @@ module Redactor
40
40
  end
41
41
  end
42
42
 
43
+ def create_initializer
44
+ template "#{orm_dir}/redactor_rails_paperclip.rb", File.join('config/initializers', "redactor_rails_paperclip.rb")
45
+ end
46
+
43
47
  protected
44
48
 
45
49
  def redactor_dir
@@ -50,6 +54,10 @@ module Redactor
50
54
  @generator_dir ||= [orm, backend].join('/')
51
55
  end
52
56
 
57
+ def orm_dir
58
+ @orm_dir ||= [orm].join('/')
59
+ end
60
+
53
61
  def uploaders_dir
54
62
  @uploaders_dir ||= ['base', 'carrierwave'].join('/')
55
63
  end
@@ -0,0 +1,18 @@
1
+ # Use this hook to configure ckeditor
2
+ if Object.const_defined?("RedactorRails")
3
+ RedactorRails.setup do |config|
4
+ # ==> ORM configuration
5
+ # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
6
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
7
+ # available as additional gems.
8
+ require "redactor-rails/orm/active_record"
9
+
10
+ # Allowed image file types for upload.
11
+ # Set to nil or [] (empty array) for all file types
12
+ # config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]
13
+
14
+ # Allowed attachment file types for upload.
15
+ # Set to nil or [] (empty array) for all file types
16
+ # config.attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "swf"]
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # Use this hook to configure ckeditor
2
+ if Object.const_defined?("RedactorRails")
3
+ RedactorRails.setup do |config|
4
+ # ==> ORM configuration
5
+ # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and
6
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
7
+ # available as additional gems.
8
+ require "redactor-rails/orm/mongoid"
9
+
10
+ # Allowed image file types for upload.
11
+ # Set to nil or [] (empty array) for all file types
12
+ # config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"]
13
+
14
+ # Allowed attachment file types for upload.
15
+ # Set to nil or [] (empty array) for all file types
16
+ # config.attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "swf"]
17
+ end
18
+ end
@@ -31,4 +31,8 @@ module RedactorRails
31
31
  @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
32
32
  end
33
33
 
34
+ def self.setup
35
+ yield self
36
+ end
37
+
34
38
  end
@@ -1,3 +1,3 @@
1
1
  module RedactorRails
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redactor-rails-paperclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-06-27 00:00:00.000000000 Z
13
+ date: 2013-06-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mime-types
@@ -72,12 +72,14 @@ files:
72
72
  - lib/generators/redactor/templates/active_record/paperclip/redactor/asset.rb
73
73
  - lib/generators/redactor/templates/active_record/paperclip/redactor/document.rb
74
74
  - lib/generators/redactor/templates/active_record/paperclip/redactor/picture.rb
75
+ - lib/generators/redactor/templates/active_record/redactor_rails_paperclip.rb
75
76
  - lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_document_uploader.rb
76
77
  - lib/generators/redactor/templates/base/carrierwave/uploaders/redactor_rails_picture_uploader.rb
77
78
  - lib/generators/redactor/templates/config.js
78
79
  - lib/generators/redactor/templates/mongoid/carrierwave/redactor/asset.rb
79
80
  - lib/generators/redactor/templates/mongoid/carrierwave/redactor/document.rb
80
81
  - lib/generators/redactor/templates/mongoid/carrierwave/redactor/picture.rb
82
+ - lib/generators/redactor/templates/mongoid/redactor_rails_paperclip.rb
81
83
  - lib/redactor-rails.rb
82
84
  - lib/redactor-rails/backend/carrierwave.rb
83
85
  - lib/redactor-rails/backend/paperclip.rb