tex2png 0.0.1 → 0.0.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: 8e22eb7193e7e4e5abb25267b76ae4d75a5be7dc
4
- data.tar.gz: 57c91a516b2352498c38eea0a0ac4c7f85bda1c9
3
+ metadata.gz: 407c4f2d114704b4a96d3bb0de1ae4010f19e904
4
+ data.tar.gz: 49ac3b5216421f61953b27b7d40092713c748aaf
5
5
  SHA512:
6
- metadata.gz: 84ada4a9c6cdf76a15856ac96def76db5b9864f8f2b2ea89bc73eb4323b2ef0f578eebd58d6b243465306a8585fbf1b3ca2575caf0a83d52a3dcfde04b7d32a3
7
- data.tar.gz: e89b73fde05d4ad9af0a3ab84781711773bf16b08f97aaf894109e0f22a92b9247ac2f2597cdea23bf8f47fe358184b6865e7dc28923e2830445291974614734
6
+ metadata.gz: 3d5dadf80697a21140ba24066395ad9429f83a817e68904f79892e6a4f982382a68554fe7953b32d474d57e2564bba4f1397147cf5766b19c7aa2027b435642a
7
+ data.tar.gz: 5b01633eccdbdb0c80a54819def9ae3c9679047c9bba47c8ef16726f1d0aca5b1e5edc9fd94430b298cd29358b7a464d1ada34b1be92b8fbeefe064aacf823da
data/README.md CHANGED
@@ -25,8 +25,6 @@ formula = "\\sum_{i = 0}^{i = n} \\frac{i}{2}"
25
25
 
26
26
  converter = Text2png::Convert(formula)
27
27
 
28
- converter.png #=> "/path/to/file.png"
29
-
30
28
  converter.png {|file| ...do something with 'file'...}
31
29
 
32
30
  converter.data #=> "data:image/png;base64, iVBOR...."
@@ -1,4 +1,5 @@
1
1
  require "securerandom"
2
+ require "base64"
2
3
 
3
4
  module Tex2png
4
5
  class Converter
@@ -26,7 +27,9 @@ module Tex2png
26
27
  end
27
28
 
28
29
  def data
29
- png {|io| "data:image/png;base64, #{io.read}"}
30
+ @data ||= png do |io|
31
+ "data:image/png;base64, #{Base64.encode64(io.read)}"
32
+ end
30
33
  end
31
34
 
32
35
  def png(&block)
@@ -1,3 +1,3 @@
1
1
  module Tex2png
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,6 +6,6 @@ module Tex2png
6
6
  let(:converter) {Converter.new(formula)}
7
7
 
8
8
  it {expect(converter.png {|io| io}).to be_an IO}
9
- it {expect(converter.data).to be_a String}
9
+ it {expect(converter.data).to include "iVBOR"}
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tex2png
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaid