rails_kindeditor 0.3.17 → 0.3.18

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: 3643ee800f464c968f45239fa565fe6740acd75d
4
- data.tar.gz: cbea227339ccb636aa82c0f4712c59d77d4a497d
3
+ metadata.gz: b3dc74f16ab4f4f760f3a76336079ebfe81442ed
4
+ data.tar.gz: bbdafec8a442c643d7f4c21dda19a4f3a1bb01d7
5
5
  SHA512:
6
- metadata.gz: 40fc9bc931c1f8c4b5d9109786d207c4eb87593ae5dba999066ebdc8683cfdb8994aaf94512e700f2d761e7b9f7f1152ae7081c202c890abadae9dc5fe0ff0df
7
- data.tar.gz: cddc998e2bcd5fd298bc923099bfbd60a8504654b1d5bea641720df823bed5ae452c37dcf15639b95b4eab959a747102fa8a109558a67cafeb13501e16a96c8c
6
+ metadata.gz: efa75924a62806a2e10ea7f9b4c2276fc86636c570bf4cc6e5d4de01fce21b12f6f34fd80dae073b61d3717105b8a30d5b007eab778731f653e52acbf9d34d69
7
+ data.tar.gz: 990a07e11462e58dbbff0e5c1f9ca06659a96c70a944386cf76fc7eff7702338600871cfff0bdfde3c17a0d86e8f0c92bd177b40bcb2e5f1f9eb3437dffac6f7
data/README.md CHANGED
@@ -10,7 +10,7 @@ rails_kindeditor will helps your rails app integrate with kindeditor, includes i
10
10
  ### Add this to your Gemfile
11
11
 
12
12
  ```ruby
13
- gem 'rails_kindeditor', '~> 0.3.17'
13
+ gem 'rails_kindeditor', '~> 0.3.18'
14
14
  ```
15
15
 
16
16
  ### Run "bundle" command.
@@ -25,6 +25,15 @@ rails_kindeditor will helps your rails app integrate with kindeditor, includes i
25
25
  rails generate rails_kindeditor:install
26
26
  ```
27
27
 
28
+ ### Rails4 in production mode
29
+
30
+ In Rails 4.0, precompiling assets no longer automatically copies non-JS/CSS assets from vendor/assets and lib/assets. see https://github.com/rails/rails/pull/7968
31
+ In Rails 4.0's production mode, please run 'rake kindeditor:assets', this method just copy kindeditor into public folder.
32
+
33
+ ```bash
34
+ rake kindeditor:assets
35
+ ```
36
+
28
37
  ### Usage:
29
38
 
30
39
  ```ruby
@@ -163,7 +172,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
163
172
  ### 将下面代码加入Gemfile:
164
173
 
165
174
  ```ruby
166
- gem 'rails_kindeditor', '~> 0.3.17'
175
+ gem 'rails_kindeditor', '~> 0.3.18'
167
176
  ```
168
177
 
169
178
  ### 运行"bundle"命令:
@@ -178,6 +187,15 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
178
187
  rails generate rails_kindeditor:install
179
188
  ```
180
189
 
190
+ ### Rails4 in production mode
191
+
192
+ 从Rails 4.0开始, precompiling assets不再自动从vendor/assets和lib/assets拷贝非JS/CSS文件. 参见 https://github.com/rails/rails/pull/7968
193
+ 如果要使用Rails 4.0的生产模式,请运行'rake kindeditor:assets', 此方法可将kindeditor自动拷贝到你的public/assets目录.
194
+
195
+ ```bash
196
+ rake kindeditor:assets
197
+ ```
198
+
181
199
  ### 使用方法:
182
200
 
183
201
  ```ruby
@@ -4,10 +4,6 @@ class Kindeditor::AssetsController < ApplicationController
4
4
  skip_before_filter :verify_authenticity_token
5
5
  def create
6
6
  @imgFile, @dir = params[:imgFile], params[:dir]
7
- if !RailsKindeditor.image_resize_to_limit.nil? && @dir == 'image'
8
- Kindeditor::AssetUploader.send(:include, CarrierWave::MiniMagick)
9
- Kindeditor::AssetUploader.send(:process, :resize_to_limit => RailsKindeditor.resize_to_limit)
10
- end
11
7
  unless @imgFile.nil?
12
8
  if Kindeditor::AssetUploader.save_upload_info? # save upload info into database
13
9
  begin
@@ -21,5 +21,14 @@ module RailsKindeditor
21
21
  end
22
22
  end
23
23
 
24
+ initializer "rails_kindeditor.image_process" do
25
+ unless RailsKindeditor.image_resize_to_limit.nil?
26
+ Kindeditor::ImageUploader.class_eval do
27
+ include CarrierWave::MiniMagick
28
+ process :resize_to_limit => RailsKindeditor.resize_to_limit
29
+ end
30
+ end
31
+ end
32
+
24
33
  end
25
34
  end
@@ -1,4 +1,4 @@
1
1
  module RailsKindeditor
2
- VERSION = "0.3.17"
2
+ VERSION = "0.3.18"
3
3
  end
4
4
 
@@ -0,0 +1,9 @@
1
+ namespace :kindeditor do
2
+ desc "copy kindeditor into public folder"
3
+ task :assets do
4
+ puts "copying kindeditor into public/assets folder ..."
5
+ dest_path = "#{Rails.root}/public/assets"
6
+ FileUtils.mkdir_p dest_path
7
+ FileUtils.cp_r "#{RailsKindeditor.root_path}/vendor/assets/javascripts/kindeditor/", dest_path
8
+ end
9
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_kindeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Macrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-05 00:00:00.000000000 Z
11
+ date: 2013-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -80,6 +80,7 @@ files:
80
80
  - lib/rails_kindeditor/helper.rb
81
81
  - lib/rails_kindeditor/simple_form.rb
82
82
  - lib/rails_kindeditor/version.rb
83
+ - lib/tasks/assets.rake
83
84
  - rails_kindeditor.gemspec
84
85
  - screenshots/rails_kindeditor.png
85
86
  - screenshots/simple_mode.png