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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfd84489d78b187c6758652d6f447fcea64a1812c02785f7fa8f8882b50910e1
4
- data.tar.gz: b461beeaaeec1d552b1a04ec586c2e1e7e408dcc536df30b398af86d3f365d67
3
+ metadata.gz: 58df61e7c3260c94063b6caef9d0c5c642cb2ba58e3b5fb5d89f17405d1f7b68
4
+ data.tar.gz: 87144bc9def89aa263a066be49b18aa03e65e64d8efd9369aa4d60e57555f1f9
5
5
  SHA512:
6
- metadata.gz: eafd2689969e77dd76a8c4841027d583b59e064d8868cc69f1dbc3408a227c56c40b6897594d522b2d158f86a33d811ecc4f14d44d52cf7c1007835c3ded2254
7
- data.tar.gz: 192e751c470b8144b1a7aa5fbe191a02ff5551c56d7ed0363cf137f49e277520e04d33373e37fca613832ca336db266adef3b3363ca17100762e579c56e3888b
6
+ metadata.gz: 567f38539714e7eef702cb521a1a394c721737ca5e060cd3c4fe7f5911dfeae1d33f16a633b644513e599e85654d179679447922d1e0d56fdbbf57c24fe51099
7
+ data.tar.gz: ed669c4197980dcee0a84d496199cedf43a290a0f071e01d9243daaf3e4d38e498eacb4856b9a76319e8c55a938c2f2df34c4c03b893caa4e05ba2000c9e0874
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  *.png
13
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mutool (0.1.0)
4
+ mutool (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  rspec (~> 3.0)
33
33
 
34
34
  BUNDLED WITH
35
- 1.16.2
35
+ 1.17.1
@@ -1,3 +1,3 @@
1
1
  class Mutool
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'.freeze
3
3
  end
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}", "'#{value}'"].join(' ') }.join(' ')
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
- system "mutool convert #{flags(ops)} #{input} #{pages}", out: File::NULL, err: File::NULL
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.0
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-30 00:00:00.000000000 Z
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.3
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