pandocomatic 0.1.3.4 → 0.1.4

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: b2870448d809455eefa1d25449086fec598feba9
4
- data.tar.gz: 1426f7743f87c5f90bcdd2a7cb3a9c12d2a9408b
3
+ metadata.gz: 1c585af496fd406f9a6d07f0088e9ab24589a8cd
4
+ data.tar.gz: 4e89c75226e00ba213350f63a476d488e94f91ac
5
5
  SHA512:
6
- metadata.gz: 3d987b4794271af38009d33e2628315a467d108725f2d73de27c05af3571b983555f643882bb9ab4cbb76a4c8d252d647c8b8bd0cfd66cb15769560e887fb613
7
- data.tar.gz: c4f890dc1dd1cd672a52aef5f083fa6769c9938dbaad8797868f7ccf424b46415b2c6652bda5b6eb30e2a3f77d1d0093a48d4fa358063a5ded583ade7d6e4017
6
+ metadata.gz: 1696165561067ea38a3ba24d422d9f89dc939e3cee096aad3d82d198a59d354861e2758b8d57b25ca001db4ee22d9a346a87b6e8b2bf606990e157a7baaaf7aa
7
+ data.tar.gz: e923e7613d30a233d6c2859454f820d6ad1b64d1f69c122b714accfc65760e0fc0d2f35c440549dc2262ff6c0ef30899fb01abbc70d5dad540d0eef7c6a36fa1
@@ -54,6 +54,7 @@ module Pandocomatic
54
54
  # General options
55
55
  opt :dry_run, 'Do a dry run', :short => '-y'
56
56
  opt :quiet, 'Run quietly', :short => '-q'
57
+ opt :debug, 'Debug mode, shows pandoc invocations', :short => '-b'
57
58
  opt :modified_only, 'Modified files only', :short => '-m'
58
59
 
59
60
  # Configuration of the converter
@@ -27,6 +27,7 @@ module Pandocomatic
27
27
  @@total = 0
28
28
  @@dry_run = false
29
29
  @@quiet = false
30
+ @@debug = false
30
31
  @@src_root = "."
31
32
  @@modified_only = false
32
33
 
@@ -36,10 +37,11 @@ module Pandocomatic
36
37
  @index = @@total
37
38
  end
38
39
 
39
- def self.reset(src_root = ".", dry_run = false, quiet = false, modified_only)
40
+ def self.reset(src_root = ".", dry_run = false, quiet = false, debug = false, modified_only)
40
41
  @@src_root = src_root
41
42
  @@dry_run = dry_run
42
43
  @@quiet = quiet
44
+ @@debug = debug
43
45
  @@modified_only = modified_only
44
46
  @@total = 0
45
47
  end
@@ -56,6 +58,10 @@ module Pandocomatic
56
58
  @@quiet
57
59
  end
58
60
 
61
+ def debug?()
62
+ @@debug
63
+ end
64
+
59
65
  def modified_only?()
60
66
  @@modified_only
61
67
  end
@@ -153,6 +153,7 @@ module Pandocomatic
153
153
  converter.send "output", @dst if OUTPUT_FORMATS.include? options["to"]
154
154
 
155
155
  begin
156
+ puts converter.to_command if debug?
156
157
  converter << input
157
158
  rescue Paru::Error => e
158
159
  raise PandocError.new(:error_running_pandoc, e, input_document)
@@ -26,12 +26,12 @@ module Pandocomatic
26
26
  created_at = File.stat(path).ctime
27
27
  modified_at = File.stat(path).mtime
28
28
  output = input
29
- output << "\n---\n"
29
+ output << "\n\n---\n"
30
30
  output << "fileinfo:\n"
31
31
  output << " path: '#{path}'\n"
32
32
  output << " created: #{created_at.strftime '%Y-%m-%d'}\n"
33
33
  output << " modified: #{modified_at.strftime '%Y-%m-%d'}\n"
34
- output << "..."
34
+ output << "...\n\n"
35
35
  end
36
36
  end
37
37
  end
@@ -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, 3]
47
+ VERSION = [0, 1, 4]
48
48
  CONFIG_FILE = 'pandocomatic.yaml'
49
49
 
50
50
  def self.run(args)
@@ -74,9 +74,10 @@ module Pandocomatic
74
74
  src_root = File.absolute_path input
75
75
  dry_run = if options[:dry_run_given] then options[:dry_run] else false end
76
76
  quiet = if options[:quiet_given] then options[:quiet] else false end
77
+ debug = if options[:debug_given] and not quiet then options[:debug] else false end
77
78
  modified_only = if options[:modified_only_given] then options[:modified_only_given] else false end
78
79
 
79
- Command.reset(src_root, dry_run, quiet, modified_only)
80
+ Command.reset(src_root, dry_run, quiet, debug, modified_only)
80
81
 
81
82
  # Pandocomatic has two modes: converting a directory tree or
82
83
  # converting a single file. The mode is selected by the input.
@@ -82,6 +82,10 @@ OPTIONS
82
82
 
83
83
  -q, --quiet Run pandocomatic quietly. Default is FALSE.
84
84
 
85
+ -b, --debug Run pandocomatic in debug mode: show the pandoc invocations
86
+ before each conversion. Default is FALSE. Only works
87
+ when not quiet.
88
+
85
89
  -y, --dry-run Configure pandocomatic to run the conversion process, but do
86
90
  not actually run it. Default is FALSE.
87
91
 
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.3.4
4
+ version: 0.1.4
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-03-04 00:00:00.000000000 Z
11
+ date: 2017-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru