pandocomatic 0.1.4.6 → 0.1.4.7

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
  SHA1:
3
- metadata.gz: 8a5ab58626f22e068eaa1b2ad2c9904e69f41b78
4
- data.tar.gz: fcc50399cb0024fbd5fb6e437777aed22599bbde
3
+ metadata.gz: c9dde99bc773690e6b0ebb3bbdbbd84e828cb1d3
4
+ data.tar.gz: 4b03ed3fb5fa5d90bb6956d583ae9e54fef498e6
5
5
  SHA512:
6
- metadata.gz: 79991c554619c581bf28452d51ae9c9378a160d2dacc19b4c75d3fd9edb65bc69541f4611912a310a49723cda154ff5844bf238e8cde8e7fd1a51288652a3089
7
- data.tar.gz: 12bf9cc502ffb08be72e32f8fa811d0e99d4ba35922aeaf66e16581e7dcc0bb948410b82e8783d6384a0ce30d1c2caac8298ec20ee8a206b09596d78edbb7a2d
6
+ metadata.gz: f9e21f62f03a0528d9a93481959b9172184aca2198ef3779d7f80e9b1e827ae4b8691fe1f5c35acf3b684d944eddbbd53cb7c9f040fae4a2319fefcad191c269
7
+ data.tar.gz: 647a7a4977665fdae9e4e763303479388608d5721695ca6bec339888b0de151c7077ca11435bc8af4f079844e272084e1c31a80f6f5a65eec563deebe64f2db2
@@ -101,6 +101,9 @@ module Pandocomatic
101
101
  end
102
102
  end
103
103
 
104
+ # Run setup scripts
105
+ setup template
106
+
104
107
  # Read in the file to convert
105
108
  input = File.read @src
106
109
 
@@ -132,6 +135,9 @@ module Pandocomatic
132
135
  rescue StandardError => e
133
136
  raise IOError.new(:error_writing_file, e, @dst)
134
137
  end
138
+
139
+ # run cleanup scripts
140
+ cleanup template
135
141
  end
136
142
 
137
143
  # TODO: update this list
@@ -202,6 +208,14 @@ module Pandocomatic
202
208
  process input, 'postprocessors', config
203
209
  end
204
210
 
211
+ def setup(config = {})
212
+ process "", 'setup', config
213
+ end
214
+
215
+ def cleanup(config = {})
216
+ process "", 'cleanup', config
217
+ end
218
+
205
219
  # Run the input string through a list of filters called processors. There
206
220
  # are to types: preprocessors and postprocessors
207
221
  def process(input, type, config = {})
@@ -98,10 +98,12 @@ module Pandocomatic
98
98
  settings['templates'].each do |name, template|
99
99
  full_template = {
100
100
  'glob' => [],
101
+ 'setup' => [],
101
102
  'preprocessors' => [],
102
103
  'metadata' => {},
103
104
  'pandoc' => {},
104
- 'postprocessors' => []
105
+ 'postprocessors' => [],
106
+ 'cleanup' => []
105
107
  }
106
108
 
107
109
  reset_template name, full_template.merge(template)
@@ -114,7 +116,7 @@ module Pandocomatic
114
116
  end
115
117
 
116
118
  def marshal_load(array)
117
- @data_dir, @settings, @templates, @convert_patterns = array
119
+ @data_dir, @settings, @templates, @convert_patterns = array
118
120
  end
119
121
 
120
122
  def to_s()
@@ -229,10 +231,10 @@ module Pandocomatic
229
231
 
230
232
  def reset_template(name, template)
231
233
  if @templates.has_key? name then
232
- fields = ['glob', 'preprocessors', 'pandoc', 'postprocessors']
234
+ fields = ['glob', 'cleanup', 'setup', 'preprocessors', 'pandoc', 'postprocessors']
233
235
  fields.each do |field|
234
236
  case field
235
- when 'preprocessors', 'postprocessors', 'glob'
237
+ when 'cleanup', 'setup', 'preprocessors', 'postprocessors', 'glob'
236
238
  if @templates[name][field] then
237
239
  if template[field] then
238
240
  @templates[name][field].concat(template[field]).uniq!
@@ -44,7 +44,7 @@ module Pandocomatic
44
44
  require_relative './command/convert_file_multiple_command.rb'
45
45
 
46
46
  class Pandocomatic
47
- VERSION = [0, 1, 4, 6]
47
+ VERSION = [0, 1, 4, 7]
48
48
  CONFIG_FILE = 'pandocomatic.yaml'
49
49
 
50
50
  def self.run(args)
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.6
4
+ version: 0.1.4.7
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-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - pandoc, a universal document converer <http://pandoc.org>
155
155
  rubyforge_project:
156
- rubygems_version: 2.5.2
156
+ rubygems_version: 2.6.11
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: Automating the use of pandoc