rutex 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6d9ad1f69edde8c28d542ba55de95e2be88ffbaf5e1717f746e1d314240f699
4
- data.tar.gz: 0cd2208be0f433f60c3cda616efcb74ef2bcef49d2493c0b168dababe2b723ef
3
+ metadata.gz: 0a109437a1fab0035da570f512d6280fab45ed5da7ff418c0362672c1fed7c8d
4
+ data.tar.gz: 531719ff61028adc2afde56dbeff66a7ec94310a72fb742cc312b87522471023
5
5
  SHA512:
6
- metadata.gz: 1a110f37ff7a2d12a4bc2b235ffc43454ea23f9c2c67500f8ac70650eceb07208545496fd7e3b09d176e8fd48aed88c4cf49cd018adeb8793e2022f87aa1f1c7
7
- data.tar.gz: d9cdb67d19c0d41547ea8ff3a6fdbd17add61bc38151103c79826395e6cd8da1a0ffff7bf5a84c72e473dc473df6f7328ad8a2f5bd01baddd45411a5c9cd039b
6
+ metadata.gz: '01063887af0845f41b5b2467465924cc690b826950f4f3940d205b996b0670d05112f8ec6040ad7d26d45627542492bd96216c8e7dc8faaddbd7805a37fe6ae1'
7
+ data.tar.gz: dc16f7aa28e8b802bdb06cecef112a32abf91c43a078722f3938491849172345d8d28f68ebaff46ded8dace212361e3a0852310ae350eb7518992e539a3f625a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rutex (0.1.2)
4
+ rutex (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,5 @@
1
1
  require 'rutex/version'
2
2
  require 'tempfile'
3
- require 'byebug'
4
3
 
5
4
  class RutexError < StandardError; end
6
5
  class PdfError < RutexError; end
@@ -9,7 +8,6 @@ class ConvertError < RutexError; end
9
8
  module Rutex
10
9
  extend self
11
10
 
12
-
13
11
  def entry(args)
14
12
  @args=args
15
13
 
@@ -17,8 +15,6 @@ module Rutex
17
15
  help
18
16
  end
19
17
 
20
- #byebug
21
-
22
18
  parse_options
23
19
 
24
20
  @color||='black'
@@ -82,6 +78,12 @@ module Rutex
82
78
  path=tmp.path
83
79
  dir=path.sub(%r(.*\K/.*),'')
84
80
  tmp.close
81
+
82
+ unless has_pdflatex
83
+ "Cannot proceed: RuTeX depends on pdflatex"
84
+ exit
85
+ end
86
+
85
87
  %x(pdflatex --halt-on-error --output-directory=#{dir} #{path})
86
88
  raise PdfError unless $?.exitstatus==0
87
89
  path
@@ -98,6 +100,10 @@ module Rutex
98
100
  exit
99
101
  end
100
102
 
103
+ def has_pdflatex
104
+ system('type','-p', 'pdflatex', out: File::NULL, err: File::NULL)
105
+ end
106
+
101
107
  def color
102
108
  @color
103
109
  end
@@ -1,3 +1,3 @@
1
1
  module Rutex
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rutex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergioro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-10 00:00:00.000000000 Z
11
+ date: 2020-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug