pdf_colored_pages 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 +19 -3
- data/lib/pdf_colored_pages/version.rb +1 -1
- data/lib/pdf_colored_pages.rb +2 -2
- data/pdf_colored_pages.gemspec +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: d970871feee27629868eeba259fbf35754d73d76
|
|
4
|
+
data.tar.gz: 2412be1378cd4b1bf07dc6ef2a464aea234645c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55ec9488034137b21368ea79391a56b8a537ee159c132da3bd18de88fc19b268688dafea2cdec53362b5967580f3529e391853be649092c504bfbc4ffc75b1eb
|
|
7
|
+
data.tar.gz: 0e5e477471f9b0ab362e398bb30f901be9ab14db23ad6259e3b5e6311aae9cd6231f91dcdd4df4f4ea155fb2300e2a5aabc1cc6ef41e423e15bd6fe3c3c49c8e
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PdfColoredPages
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ruby Gem to check which pages of a pdf contain color and output those.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -20,11 +20,27 @@ Or install it yourself as:
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
As Array:
|
|
24
|
+
```ruby
|
|
25
|
+
PdfColoredPages.as_array(/path/to/pdf.pdf)
|
|
26
|
+
# returns [1,3,4]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
As Range String:
|
|
30
|
+
```ruby
|
|
31
|
+
PdfColoredPages.as_range_string(/path/to/pdf.pdf)
|
|
32
|
+
# returns: 1,3-4
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Just Check:
|
|
36
|
+
```ruby
|
|
37
|
+
PdfColoredPages.colored_pages?(/path/to/pdf.pdf)
|
|
38
|
+
# returns: true or false
|
|
39
|
+
```
|
|
24
40
|
|
|
25
41
|
## Contributing
|
|
26
42
|
|
|
27
|
-
1. Fork it ( https://github.com/
|
|
43
|
+
1. Fork it ( https://github.com/RedRoosterMobile/pdf-colored-pages/fork )
|
|
28
44
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
29
45
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
30
46
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/pdf_colored_pages.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'pdf_colored_pages/version'
|
|
2
2
|
|
|
3
3
|
module PdfColoredPages
|
|
4
4
|
def self.as_range_string (pdf_file)
|
|
@@ -18,7 +18,7 @@ module PdfColoredPages
|
|
|
18
18
|
|
|
19
19
|
def self.get_ghostscript_output(pdf_file)
|
|
20
20
|
unless File.exist? pdf_file
|
|
21
|
-
#
|
|
21
|
+
raise "File '#{pdf_file}' not found"
|
|
22
22
|
end
|
|
23
23
|
gs_output = `gs -o - -sDEVICE=inkcov #{pdf_file}`
|
|
24
24
|
GhostScriptParser.new gs_output
|
data/pdf_colored_pages.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
19
|
spec.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
-
spec.required_ruby_version = '>=
|
|
21
|
+
spec.required_ruby_version = '>= 1.9.3'
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
|
23
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
24
24
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pdf_colored_pages
|
|
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
|
- Thomas Ranker
|
|
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
65
65
|
requirements:
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
68
|
+
version: 1.9.3
|
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
requirements:
|
|
71
71
|
- - ">="
|