grim 0.2.0 → 0.2.1
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.
- data/.gitignore +1 -0
- data/Gemfile +2 -2
- data/README.textile +19 -0
- data/Rakefile +7 -0
- data/grim.gemspec +1 -1
- data/lib/grim.rb +1 -3
- data/lib/grim/page.rb +1 -0
- data/lib/grim/pdf.rb +2 -2
- data/lib/grim/version.rb +4 -0
- data/spec/lib/grim/page_spec.rb +1 -0
- data/spec/lib/grim/pdf_spec.rb +1 -0
- data/spec/lib/grim_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- metadata +8 -7
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.textile
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
<pre>
|
|
2
|
+
,____
|
|
3
|
+
|---.\
|
|
4
|
+
___ | `
|
|
5
|
+
/ .-\ ./=)
|
|
6
|
+
| |"|_/\/|
|
|
7
|
+
; |-;| /_|
|
|
8
|
+
/ \_| |/ \ |
|
|
9
|
+
/ \/\( |
|
|
10
|
+
| / |` ) |
|
|
11
|
+
/ \ _/ |
|
|
12
|
+
/--._/ \ |
|
|
13
|
+
`/|) | /
|
|
14
|
+
/ | |
|
|
15
|
+
.' | |
|
|
16
|
+
/ \ |
|
|
17
|
+
(_.-.__.__./ /
|
|
18
|
+
</pre>
|
|
19
|
+
|
|
1
20
|
h1. Grim
|
|
2
21
|
|
|
3
22
|
Grim is a simple gem for extracting (reaping) a page from a pdf and converting it to an image as well as extract the text from the page as a string. It basically gives you an easy to use api to ghostscript, imagemagick, and pdftotext specific to this use case.
|
data/Rakefile
CHANGED
data/grim.gemspec
CHANGED
data/lib/grim.rb
CHANGED
data/lib/grim/page.rb
CHANGED
data/lib/grim/pdf.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
module Grim
|
|
2
3
|
class Pdf
|
|
3
4
|
include Enumerable
|
|
@@ -29,8 +30,7 @@ module Grim
|
|
|
29
30
|
#
|
|
30
31
|
def count
|
|
31
32
|
@count ||= begin
|
|
32
|
-
result = SafeShell.execute("gs", "-dNODISPLAY", "-q", "-sFile=#{@path}",
|
|
33
|
-
|
|
33
|
+
result = SafeShell.execute("gs", "-dNODISPLAY", "-q", "-sFile=#{@path}", File.expand_path('../../../lib/pdf_info.ps', __FILE__))
|
|
34
34
|
result.gsub(WarningRegex, '').to_i
|
|
35
35
|
end
|
|
36
36
|
end
|
data/lib/grim/version.rb
ADDED
data/spec/lib/grim/page_spec.rb
CHANGED
data/spec/lib/grim/pdf_spec.rb
CHANGED
data/spec/lib/grim_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grim
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 21
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 0.2.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.2.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jonathan Hoyt
|
|
@@ -15,13 +15,14 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-09-
|
|
18
|
+
date: 2011-09-08 00:00:00 -04:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: safe_shell
|
|
23
|
+
type: :runtime
|
|
23
24
|
prerelease: false
|
|
24
|
-
|
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
|
25
26
|
none: false
|
|
26
27
|
requirements:
|
|
27
28
|
- - ~>
|
|
@@ -32,8 +33,7 @@ dependencies:
|
|
|
32
33
|
- 0
|
|
33
34
|
- 0
|
|
34
35
|
version: 1.0.0
|
|
35
|
-
|
|
36
|
-
version_requirements: *id001
|
|
36
|
+
requirement: *id001
|
|
37
37
|
description: Grim is a simple gem for extracting a page from a pdf and converting it to an image as well as extract the text from the page as a string. It basically gives you an easy to use api to ghostscript, imagemagick, and pdftotext specific to this use case.
|
|
38
38
|
email:
|
|
39
39
|
- jonmagic@gmail.com
|
|
@@ -53,6 +53,7 @@ files:
|
|
|
53
53
|
- lib/grim.rb
|
|
54
54
|
- lib/grim/page.rb
|
|
55
55
|
- lib/grim/pdf.rb
|
|
56
|
+
- lib/grim/version.rb
|
|
56
57
|
- lib/pdf_info.ps
|
|
57
58
|
- spec/fixtures/smoker.pdf
|
|
58
59
|
- spec/lib/grim/page_spec.rb
|