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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 751b491d67c85fac067a83bfe2b97fa34935429a
4
- data.tar.gz: bcd1ec05e0f0091b871b99e6122b374592d4f305
3
+ metadata.gz: 6c4ef7f167cfc44823fd53dba90b9956601d9fab
4
+ data.tar.gz: 64a82aa622ea7d67e4e644dc94cf7e57b41969a3
5
5
  SHA512:
6
- metadata.gz: b2b80ef6ebb3352c98948f004b111c32017b2c19e6d3706b2565b495aaf42a3732090dfdfc4c169a03ab00e8f8918a6aabad3fc3165c7b8d7d2bc611200c9303
7
- data.tar.gz: 9f334ee44a22e140fc9721c29b6e883372f4642ecf1d710207203c9aafed5cdf543c161091b373938f02f78727077cffe21b836c04388d5b1d9370a407099203
6
+ metadata.gz: f2d3af62eec32fc0a9872a9af948c60cf37663bf7e28dd05247821934d097d22ea0046c8214e48af2e42f948c2605b40763d9036171db6b76a34cb3bab016738
7
+ data.tar.gz: a33389166077c900474b61be48edde2f42191ff1f2dc9f775b51e084492fae18e21481cc0b8e1ea27ef93414bf71bfb23eb59b2d20cb49eb61a6fa7b0ff1c8ec
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2 - 2015-07-31
4
+ - Add support to \input for tex.
5
+
3
6
  ## 0.1.1 - 2015-07-29
4
7
  - Add generating png file to static files of jekyll
5
8
 
@@ -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) || File.stat(@texpath).mtime > File.stat(pngpath).mtime
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
 
@@ -1,3 +1,3 @@
1
1
  module OctopressTex2img
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-30 00:00:00.000000000 Z
11
+ date: 2015-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler