mutool 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/lib/mutool/version.rb +1 -1
- data/lib/mutool.rb +14 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58df61e7c3260c94063b6caef9d0c5c642cb2ba58e3b5fb5d89f17405d1f7b68
|
4
|
+
data.tar.gz: 87144bc9def89aa263a066be49b18aa03e65e64d8efd9369aa4d60e57555f1f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 567f38539714e7eef702cb521a1a394c721737ca5e060cd3c4fe7f5911dfeae1d33f16a633b644513e599e85654d179679447922d1e0d56fdbbf57c24fe51099
|
7
|
+
data.tar.gz: ed669c4197980dcee0a84d496199cedf43a290a0f071e01d9243daaf3e4d38e498eacb4856b9a76319e8c55a938c2f2df34c4c03b893caa4e05ba2000c9e0874
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/lib/mutool/version.rb
CHANGED
data/lib/mutool.rb
CHANGED
@@ -2,13 +2,24 @@ require 'mutool/version'
|
|
2
2
|
|
3
3
|
class Mutool
|
4
4
|
class << Mutool
|
5
|
-
def flags(ops)
|
6
|
-
ops.map { |key, value| ["-#{key}",
|
5
|
+
def flags(ops = {})
|
6
|
+
ops.map { |key, value| ["-#{key}", value] }
|
7
7
|
end
|
8
8
|
|
9
9
|
# Reference: https://mupdf.com/docs/manual-mutool-convert.html
|
10
10
|
def convert(input, pages='1-N', ops)
|
11
|
-
|
11
|
+
run(['mutool', 'convert', flags(ops), input, pages].flatten)
|
12
|
+
end
|
13
|
+
|
14
|
+
# https://mupdf.com/docs/manual-mutool-clean.html
|
15
|
+
def clean(input, output, pages='1-N', ops)
|
16
|
+
run(['mutool', 'clean', flags(ops), input, output, pages].flatten)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def run(command = [])
|
22
|
+
system(*command, out: File::NULL, err: File::NULL)
|
12
23
|
$?
|
13
24
|
end
|
14
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mutool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marlon Henry Schweigert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.7.
|
96
|
+
rubygems_version: 2.7.8
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Basic integration between mutool and ruby over system calls
|