pandocomatic 0.0.6 → 0.0.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: 8f309756a052d15289809ed50817aab915542e43
4
- data.tar.gz: ccdebf26491d9731513ff08523bd96884745c1a3
3
+ metadata.gz: bc3b0f46b5d3816c21b8094da1fb7eddecda65db
4
+ data.tar.gz: 5c318325fc7518da70779be34c7d8c42fcf2e68c
5
5
  SHA512:
6
- metadata.gz: 960aeb18970b6f4b0bd1aae7507a2dbe0ce4a3edb93332b8f194654ddf781ffe2dd21d3f6323e83dd88feb4c601094bd246326418133b25085a52f27f785de91
7
- data.tar.gz: 1c0e60f1571f89322890fc6aef04105f9f8760b019d0e352868b55c51035fc93c910829ede0a18919c16acce1f8862ee5ccc3dbbe6c83c3f220d835f68457d3c
6
+ metadata.gz: 92021af87c7f9811cd9c38cf3c53a78a7c6adb2c20fc4fd61d2b0e6544f07040ed50fca3566e0b0ca23bfb0a5e20006bbf8af4efd212fb5ec8ccf3d4445b8990
7
+ data.tar.gz: b4c29729de6543873bb40eb84e93f943ca9c3c54e6afe1da31a424b704633eeb9884eabbc1a2d90a05738d0d3b8e93139410f243ac0cfacaa6f292766e0f5fd2
@@ -153,14 +153,29 @@ module Pandocomatic
153
153
 
154
154
  def reset_template name, template
155
155
  if @templates.has_key? name then
156
- @templates[name].merge!(template) do |setting, oldval, newval|
157
- case setting
156
+ fields = ['glob', 'preprocessors', 'pandoc', 'postprocessors']
157
+ fields.each do |field|
158
+ case field
158
159
  when 'preprocessors', 'postprocessors', 'glob'
159
- oldval.concat(newval).uniq
160
+ if @templates[name][field] then
161
+ if template[field] then
162
+ @templates[name][field].concat(template[field]).uniq!
163
+ end
164
+ else
165
+ if template[field] then
166
+ @templates[name][field] = template[field]
167
+ end
168
+ end
160
169
  when 'pandoc'
161
- oldval.merge newval
162
- else
163
- newval
170
+ if @templates[name][field] then
171
+ if template[field] then
172
+ @templates[name][field].merge! template[field]
173
+ end
174
+ else
175
+ if template[field] then
176
+ @templates[name][field] = template[field]
177
+ end
178
+ end
164
179
  end
165
180
  end
166
181
  else
@@ -8,8 +8,8 @@ module Pandocomatic
8
8
  class DirConverter
9
9
 
10
10
  def initialize src, dst, config
11
- @src_root = File.absolute_path src
12
- @dst_root = File.absolute_path dst
11
+ @src_root = src
12
+ @dst_root = dst
13
13
  @config = config
14
14
  end
15
15
 
@@ -101,7 +101,7 @@ module Pandocomatic
101
101
  if src_target.start_with? '.' then
102
102
  full_src_target = File.expand_path src_target, File.dirname(src)
103
103
  dst_target = src_target
104
- if full_src_target.start_with? @src_root
104
+ if full_src_target.start_with? File.absolute_path(@src_root)
105
105
  File.symlink dst_target, dst unless File.exist? dst
106
106
  else
107
107
  warn "Skipping link #{src} because it points to outside the source tree"
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.0.6
4
+ version: 0.0.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: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paru