texrack 0.6.1 → 0.6.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: 8e927a95d9a26f57660682245b8692cf66e92e59
4
- data.tar.gz: 638cba00dce6aa7ac0789ca38725e5221b1aa4e8
3
+ metadata.gz: 7bfd05831d8152524aaffa8c9010236ae1df91bb
4
+ data.tar.gz: 41f7804550ebcabcb899067ef2050447bb2178b2
5
5
  SHA512:
6
- metadata.gz: 55342332aad05363d60a949b407acf9d4cc08361e321d843625f63fc02395b39ef771ef11b9bd2fc21ded597b85948e91179d271fb7c0a1be098a42b19cfbafa
7
- data.tar.gz: 36fe4e980ad2d7cb24556ff10fbe4ac1f516a2255ea0861c7af8e7da09626cbe5627286b6b81620241a43273445505701ca71037f7bfcfb12febb9dc3474ebbf
6
+ metadata.gz: 81f357de2ffe1d4e1e03f56013078a39c6373d41c060b9c5ccb8f4720dde78ded2e131ebe1c1c518be3c96c86528db4797a271756453c306531103fccd48c188
7
+ data.tar.gz: 6c229ac6abbc7c03e1ad5cbe986e64e852f5901cea05e4c3e0a2e2524ec1284b7a002a0cd4c963a4cadce35ecb8e6f37c84e4b44275ab443440c942bf8b51ce5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.6.2 / 2014-10-27
2
+
3
+ * Respond to /crossdomain.xml for Flash-based usage
4
+
1
5
  # 0.6.1 / 2014-10-27
2
6
 
3
7
  * Expire the cache when the version of Texrack changes
data/README.md CHANGED
@@ -22,7 +22,8 @@ Texrack.config = {
22
22
  pdflatex: "pdflatex",
23
23
  convert: "convert",
24
24
  logger: nil,
25
- cache_dir: Dir.mktmpdir
25
+ cache_dir: Dir.mktmpdir,
26
+ allowed_domains: ['*.example.com']
26
27
  }
27
28
  ```
28
29
 
@@ -54,6 +55,16 @@ If you are dealing with software incapable of proper status codes (looking at
54
55
  you, Flash), you can pass `always_200=1` and it'll respond with 200 OK even
55
56
  though we should really respond with a 5xx.
56
57
 
58
+ ### Trim result image
59
+ Pass `trim=1` to tell ImageMagick to trim the result using [-trim](http://www.imagemagick.org/Usage/crop/#trim).
60
+
61
+ ### crossdomain.xml
62
+ If TexRack is used from Flash, and hosted on a different domain, you might need a crossdomain.xml file.
63
+ Set `Texrack.config[:allowed_domains]` to an array of domains that should be allowed access.
64
+
65
+ Example:
66
+ `allowed_domains: ['*.example.com']`
67
+
57
68
  ### Caching
58
69
  Generated images are cached by default, so we don't have to shell out to
59
70
  pdflatex and imagemagick all the time. Configure `cache_dir` to store the
data/lib/texrack.rb CHANGED
@@ -16,7 +16,8 @@ module Texrack
16
16
  pdflatex: "pdflatex",
17
17
  convert: "convert",
18
18
  logger: nil,
19
- cache_dir: Dir.mktmpdir
19
+ cache_dir: Dir.mktmpdir,
20
+ allowed_domains: ['*.example.com']
20
21
  }
21
22
  end
22
23
  end
@@ -21,9 +21,12 @@ module Texrack
21
21
  render_png
22
22
  end
23
23
 
24
- def render_png
25
- set_headers
24
+ get '/crossdomain.xml' do
25
+ content_type 'application/xml'
26
+ erb :crossdomain
27
+ end
26
28
 
29
+ def render_png
27
30
  begin
28
31
  output = Texrack::OutputFile.new(digest)
29
32
  unless output.exists?
@@ -33,6 +36,7 @@ module Texrack
33
36
  output.finish
34
37
  end
35
38
 
39
+ set_headers
36
40
  send_file output, disposition: :inline
37
41
  rescue Texrack::LatexFailedError
38
42
  send_static_error "latex-failed.png"
@@ -51,7 +55,7 @@ module Texrack
51
55
  end
52
56
 
53
57
  def send_static_error(filename)
54
- headers['ETag'] = nil
58
+ headers['ETag'] = ''
55
59
  send_file File.join(settings.public_folder, filename), {
56
60
  disposition: :inline,
57
61
  status: error_status
@@ -1,3 +1,3 @@
1
1
  module Texrack
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Per Christian B. Viken