paperclip-document 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/lib/paperclip/document/processors/reader.rb +2 -2
- data/lib/paperclip/document/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e34d0f58cb3b703bf031a5bd79ea8e44ec7c1a54
|
4
|
+
data.tar.gz: 71f1f58a05a92bb9b9356e7ccd9ffc5756749ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b025b1102d126c9de8996907fcff766727a37f9883c1517faad68ca95fb4ebc5fe5017995ee354934d182028bb942d11a9a40dc3da741d044104a05372ad7f72
|
7
|
+
data.tar.gz: 9461dd9fc91488397191adf30611e28a7d3d442f60b328d064a884aa040cadbcc5d9ba6f8279ed7b740ea2fb9fe836dd2e3eb6ff0e1dbde6e41fc16788ef24a9
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Paperclip::Document
|
2
2
|
|
3
|
-
|
3
|
+
[](http://badge.fury.io/rb/paperclip-document)
|
4
|
+
[](https://gemnasium.com/burisu/paperclip-document)
|
5
|
+
[](https://codeclimate.com/github/burisu/paperclip-document)
|
6
|
+
[](https://travis-ci.org/burisu/paperclip-document)
|
7
|
+
[](https://coveralls.io/r/burisu/paperclip-document)
|
8
|
+
|
9
|
+
Document processors for paperclip.
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -18,7 +24,16 @@ Or install it yourself as:
|
|
18
24
|
|
19
25
|
## Usage
|
20
26
|
|
21
|
-
|
27
|
+
Use processors like the example:
|
28
|
+
|
29
|
+
has_attached_file :file, {
|
30
|
+
styles: {
|
31
|
+
default: {format: :pdf, processors: [:reader, :counter, :freezer], clean: true},
|
32
|
+
thumbnail: {format: :jpg, processors: [:sketcher]}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
Due to docsplit dependency (0.7.2), text cleaning is only effective on Ruby < 2.0 for now.
|
22
37
|
|
23
38
|
## Contributing
|
24
39
|
|
@@ -15,13 +15,13 @@ module Paperclip
|
|
15
15
|
unless @text_column
|
16
16
|
raise Paperclip::Error, "No content text column given"
|
17
17
|
end
|
18
|
-
@clean =
|
18
|
+
@clean = (RUBY_VERSION >= "2.0" ? false : options.has_key?(:clean) ? !!options[:clean] : true)
|
19
19
|
end
|
20
20
|
|
21
21
|
# Extract the text of all the document
|
22
22
|
def make
|
23
23
|
destination_path = tmp_dir.to_s
|
24
|
-
options = {:
|
24
|
+
options = {output: destination_path, clean: @clean}
|
25
25
|
options[:language] = (language.is_a?(Proc) ? language.call(attachment.instance) : language)
|
26
26
|
Docsplit.extract_text(file_path.to_s, options)
|
27
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-document
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brice Texier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paperclip
|