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 CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .rvmrc
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source :rubygems
2
2
  gemspec
3
- gem 'rspec'
4
- gem 'ruby-debug'
3
+ gem 'rake'
4
+ gem 'rspec'
@@ -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
@@ -1 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ require "rspec/core/rake_task"
4
+ desc "Run the specs"
5
+ RSpec::Core::RakeTask.new
6
+
7
+ task :default => :spec
8
+ task :test => :spec
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "grim"
3
+ require "grim/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "grim"
@@ -1,9 +1,7 @@
1
+ # encoding: UTF-8
1
2
  require 'safe_shell'
2
3
 
3
4
  module Grim
4
- # VERSION
5
- VERSION = "0.2.0"
6
-
7
5
  # Default resize output width, any positive integer
8
6
  WIDTH = 1024
9
7
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  module Grim
2
3
  class Page
3
4
 
@@ -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}", "./lib/pdf_info.ps")
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
@@ -0,0 +1,4 @@
1
+ # encoding: UTF-8
2
+ module Grim
3
+ VERSION = "0.2.1" unless defined?(::Grim::VERSION)
4
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'fileutils'
2
3
  require 'spec_helper'
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Grim::Pdf do
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Grim do
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  require 'rubygems'
2
3
  require 'bundler/setup'
3
4
 
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
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-06 00:00:00 -04:00
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
- requirement: &id001 !ruby/object:Gem::Requirement
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
- type: :runtime
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