erbtex 0.4.3 → 0.4.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
  SHA256:
3
- metadata.gz: da849bbae335cabdeb22f9817d5408660b1d37ed1036eba721ce8bdace2668f2
4
- data.tar.gz: 4e933a21dfa948f00151d1cd695f425dfb17aec6f1ac1d940dd68d32799229d6
3
+ metadata.gz: 5312a62db545e823d88b6f83fda0924a7b37e03aba65d5592b8da33045f9ba7e
4
+ data.tar.gz: b35033aa29360af46c7bb55c6cf730fa57654ccb9eb88566e6a0909c0d0f48a2
5
5
  SHA512:
6
- metadata.gz: b1cf7577a154c728e92b44d555e464b62ff714ddcccad23744f1d5dc0b53ddcbc88d43e31698aecc2a1b4494bcf0660e1677c42c70998bcc76da743a5aa893c5
7
- data.tar.gz: '051332985184a47f5515dda043d598bf835488d0d812dd753e9ec05cdaafdeebf51279bfdc1fb7307b97ac8155d3007f8572340175ec1148bc80a13d2fee557c'
6
+ metadata.gz: dffa4203b424040ad13bb2bc5d123aae704d526d2a41b10390ad0d2c6c2ba171bcb87b06dbc16adda3361364aef3409029ff460a3c4eee75b3a15f32063ddc94
7
+ data.tar.gz: 6b5b3e7d105b7de8ad70a87206923e2272296c3907e62b4a30057dabcf503e02bac022863908d651ff462c7ea6e001338f2cf69996a5684e4bb69e391ec20b19
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- erbtex (0.4.3)
4
+ erbtex (0.4.4)
5
5
  erubis
6
6
  fat_core
7
7
 
@@ -57,7 +57,9 @@ module ErbTeX
57
57
  def self.run_tex(cmd, in_dir = nil)
58
58
  # If the input file is located in another directory (in_dir), add that
59
59
  # directory to TEXINPUTS if its not already there so that the input file
60
- # can \include or \input files using relative file names.
60
+ # can \include or \input files using relative file names. Place it after
61
+ # the current directory '.' so that an plain file name is still
62
+ # interpreted relative to the current working directory.
61
63
  new_env = {}
62
64
  if in_dir
63
65
  in_dir = File.absolute_path(File.expand_path(in_dir))
@@ -65,17 +67,19 @@ module ErbTeX
65
67
  unless ENV['TEXINPUTS'].split(File::PATH_SEPARATOR)
66
68
  .reject { |p| p.strip.empty? }
67
69
  .any? { |p| in_dir == File.absolute_path(File.expand_path(p)) }
68
- new_env['TEXINPUTS'] = "#{in_dir}:#{ENV['TEXINPUTS']}"
70
+ new_env['TEXINPUTS'] = ".:#{in_dir}:#{ENV['TEXINPUTS']}"
69
71
  end
70
72
  end
71
73
  # Call cmd with the environment augmented by possibly expanded TEXINPUTS
72
74
  # environment variable.
75
+ warn "TEXINPUTS set to: #{new_env['TEXINPUTS']}"
73
76
  unless system(new_env, cmd)
74
77
  warn "Call to '#{cmd}' failed."
75
78
  exit $CHILD_STATUS
76
79
  end
77
80
  # Run a second time unless its latexmk
78
81
  unless cmd =~ /\A *latexmk/
82
+ warn "TEXINPUTS set to: #{new_env['TEXINPUTS']}"
79
83
  unless system(new_env, cmd)
80
84
  warn "Call to '#{cmd}' failed."
81
85
  exit $CHILD_STATUS
@@ -89,6 +93,8 @@ module ErbTeX
89
93
  # the input file can be found if they are in the in_dir. Return the name of
90
94
  # the output file.
91
95
  def self.erb_to_tex(in_file, in_dir = nil)
96
+ warn '================================================================'
97
+ warn 'Erubis phase of processing ...'
92
98
  # Add input to ruby LOAD_PATH, $:,if its not already there.
93
99
  if File.exist?(in_dir)
94
100
  in_dir = File.absolute_path(File.expand_path(in_dir))
@@ -99,6 +105,7 @@ module ErbTeX
99
105
  end
100
106
 
101
107
  # Read the input
108
+ warn " Erubis reading from #{in_file}..."
102
109
  in_contents = nil
103
110
  File.open(in_file) do |f|
104
111
  in_contents = f.read
@@ -108,10 +115,13 @@ module ErbTeX
108
115
  pat = ENV['ERBTEX_PATTERN'] || '{: :}'
109
116
 
110
117
  out_file = ErbTeX.out_file_name(in_file)
118
+ warn " Erubis writing to #{out_file}..."
111
119
  File.open(out_file, 'w') do |f|
112
120
  er = ::Erubis::Eruby.new(in_contents, pattern: pat)
113
121
  f.write(er.result)
114
122
  end
123
+ warn 'done'
124
+ warn '================================================================'
115
125
  out_file
116
126
  rescue SystemCallError => e
117
127
  warn "Error: #{e}"
@@ -1,3 +1,3 @@
1
1
  module ErbTeX
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erbtex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty