paperclip-document 0.0.1 → 0.0.2

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: c2461acd828b0cf325460c5bcb8645d910bdb987
4
- data.tar.gz: 2471f4c3b01c65cc62265f44f17e6e872442d8d9
3
+ metadata.gz: e34d0f58cb3b703bf031a5bd79ea8e44ec7c1a54
4
+ data.tar.gz: 71f1f58a05a92bb9b9356e7ccd9ffc5756749ed3
5
5
  SHA512:
6
- metadata.gz: ac39f1658c38850862a9d69595dc21e67bd195c081ebb68817b3240e4b2625947261eb44eaf8bfcbc884e20a3460adeb1f41ce0d989bd72aa53085aaaae955ee
7
- data.tar.gz: 7a840089e0e23bba7e1ffda17fe704c699bcb6b2d22aadc07cc1a78659a107d278059c53d3511106fec2e4a1ed2dc97ac85237ce0804e5f72b41b13d215e52dc
6
+ metadata.gz: b025b1102d126c9de8996907fcff766727a37f9883c1517faad68ca95fb4ebc5fe5017995ee354934d182028bb942d11a9a40dc3da741d044104a05372ad7f72
7
+ data.tar.gz: 9461dd9fc91488397191adf30611e28a7d3d442f60b328d064a884aa040cadbcc5d9ba6f8279ed7b740ea2fb9fe836dd2e3eb6ff0e1dbde6e41fc16788ef24a9
data/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Paperclip::Document
2
2
 
3
- TODO: Write a gem description
3
+ [![Gem Version](https://badge.fury.io/rb/paperclip-document.png)](http://badge.fury.io/rb/paperclip-document)
4
+ [![Dependency Status](https://gemnasium.com/burisu/paperclip-document.png)](https://gemnasium.com/burisu/paperclip-document)
5
+ [![Quality metrics](https://codeclimate.com/github/burisu/paperclip-document.png)](https://codeclimate.com/github/burisu/paperclip-document)
6
+ [![Continuous Integration](https://api.travis-ci.org/burisu/paperclip-document.png?branch=master)](https://travis-ci.org/burisu/paperclip-document)
7
+ [![Code coverage](https://coveralls.io/repos/burisu/paperclip-document/badge.png?branch=master)](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
- TODO: Write usage instructions here
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 = !!(options.has_key?(:clean) ? options[:clean] : true)
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 = {:output => destination_path, :clean => @clean}
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
 
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Document
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
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.1
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: 2013-12-12 00:00:00.000000000 Z
11
+ date: 2014-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paperclip