pandocomatic 0.1.4.18 → 0.1.4.19

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
  SHA1:
3
- metadata.gz: 168ad85a67400c51df6abc8d7d96dc87191592f4
4
- data.tar.gz: 8c092032d858ea267dc547cb728ac33886722c6a
3
+ metadata.gz: 54c948376695229144be170c711bc475b0bffa5c
4
+ data.tar.gz: 4541871677bad952bd4c44b7aed1461cc981ccb6
5
5
  SHA512:
6
- metadata.gz: 89455ed3265e4a986bdc20ce49f5fc880e0f6d74e5b5b5c9bec5718f6fb3df08a5c74d04feb3f659cb734bcb9f4981fb9c7196276d97e794c0dc75aec791f151
7
- data.tar.gz: a43671773818e2b9d3c4ef45c955706b43b414ee27fb7951f212569560105801dcb565bdff0ed9ccd7cfa95605b71216e9c89dd6542f67d28120d5af55f0948e
6
+ metadata.gz: 61a2ccb51775f8c610c4abeab3c9f410567561ea4e684bddac519cdd2520eeabcd65126cc4272c93c56eef604aad82d52a8b15ff3dbc9cebdb52d501e25dbda3
7
+ data.tar.gz: e115b839f4fbc09d3e4a747f47acba53ce6873106bd9fe7364ea04aca791b1583ba0712e3fb07e9d6813da65ce80f4e37d22ab8043a6107a818b991fa5b48f2c
@@ -62,6 +62,7 @@ module Pandocomatic
62
62
  # this file
63
63
  def initialize(config, src, dst, template_name = nil)
64
64
  super()
65
+
65
66
  @config = config
66
67
  @src = src
67
68
  @dst = dst
@@ -104,6 +105,8 @@ module Pandocomatic
104
105
 
105
106
  pandoc_options = Configuration.extend_value(pandoc_options, template['pandoc'])
106
107
  end
108
+
109
+ template = Configuration.extend_value(metadata.pandocomatic, template) if metadata.has_pandocomatic?
107
110
 
108
111
  # Run setup scripts
109
112
  setup template
@@ -48,6 +48,7 @@ module Pandocomatic
48
48
  @src = src
49
49
 
50
50
  metadata = PandocMetadata.load_file @src
51
+
51
52
  metadata.templates.each do |template_name|
52
53
  raise ConfigurationError.new(:no_such_template, nil, template_name) unless template_name.empty? or config.has_template? template_name
53
54
 
@@ -259,8 +259,9 @@ module Pandocomatic
259
259
  def update_path(path, src_dir, check_executable = false)
260
260
  updated_path = path
261
261
  if path.start_with? './'
262
- # refers to a local dir
263
- updated_path = File.join src_dir, path
262
+ # refers to a local dir; strip the './' before appending it to
263
+ # the source directory as to prevent /some/path/./to/path
264
+ updated_path = File.join src_dir, path[2..-1]
264
265
  else
265
266
  if path.start_with? '/'
266
267
  updated_path = path
@@ -18,6 +18,7 @@
18
18
  #++
19
19
  module Pandocomatic
20
20
  require 'open3'
21
+ require_relative 'error/processor_error.rb'
21
22
 
22
23
  # Generic class for processors used to preprocess, postproces, setup, and
23
24
  # cleanup with external scripts or programs during the conversion process.
@@ -34,7 +35,14 @@ module Pandocomatic
34
35
  #
35
36
  # @return [String] output of script.
36
37
  def self.run script, input
37
- output, _ = Open3.capture2(script, :stdin_data => input)
38
+ output, error, status = Open3.capture3(script, :stdin_data => input)
39
+
40
+ warn error unless error.empty?
41
+
42
+ if status.exitstatus > 0
43
+ raise ProcessorError.new(:error_processing_script, StandardError.new(error), [script, input])
44
+ end
45
+
38
46
  output
39
47
  end
40
48
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandocomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.18
4
+ version: 0.1.4.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huub de Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-17 00:00:00.000000000 Z
11
+ date: 2017-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 0.2.5
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.2.5.7
22
+ version: 0.2.5.9
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 0.2.5
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.5.7
32
+ version: 0.2.5.9
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: trollop
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - pandoc, a universal document converer <http://pandoc.org>
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.11
157
+ rubygems_version: 2.5.2
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Automating the use of pandoc