octopress-tex2img 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/octopress-tex2img/tags.rb +16 -1
- data/lib/octopress-tex2img/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c4ef7f167cfc44823fd53dba90b9956601d9fab
|
4
|
+
data.tar.gz: 64a82aa622ea7d67e4e644dc94cf7e57b41969a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d3af62eec32fc0a9872a9af948c60cf37663bf7e28dd05247821934d097d22ea0046c8214e48af2e42f948c2605b40763d9036171db6b76a34cb3bab016738
|
7
|
+
data.tar.gz: a33389166077c900474b61be48edde2f42191ff1f2dc9f775b51e084492fae18e21481cc0b8e1ea27ef93414bf71bfb23eb59b2d20cb49eb61a6fa7b0ff1c8ec
|
data/CHANGELOG.md
CHANGED
@@ -22,7 +22,7 @@ module OctopressTex2img
|
|
22
22
|
raise ArgumentError.new("texfile[#{@texpath}] does not exist!")
|
23
23
|
end
|
24
24
|
|
25
|
-
if !File.exists?(pngpath) ||
|
25
|
+
if !File.exists?(pngpath) || timestamp(@texpath) > File.stat(pngpath).mtime
|
26
26
|
puts "Generating #{pngpath} from #{@texpath}"
|
27
27
|
texdir = File.dirname(@texpath)
|
28
28
|
pngdir = File.dirname(pngpath)
|
@@ -43,6 +43,21 @@ module OctopressTex2img
|
|
43
43
|
end
|
44
44
|
@imgtag.render(context)
|
45
45
|
end
|
46
|
+
|
47
|
+
def timestamp(texpath)
|
48
|
+
ts = File.stat(texpath).mtime
|
49
|
+
File.open(texpath, 'r') do |ff|
|
50
|
+
while ll = ff.gets
|
51
|
+
if /\\input{(?<inputfile>.*)}/ =~ ll
|
52
|
+
tn = File.stat(File.join(File.dirname(texpath), inputfile)).mtime
|
53
|
+
if tn > ts
|
54
|
+
ts = tn
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
ts
|
60
|
+
end
|
46
61
|
end
|
47
62
|
end
|
48
63
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-tex2img
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wang Jian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|