vitrine 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asset_compiler.rb +6 -0
- data/lib/version.rb +1 -1
- data/test/test_vitrine_asset_compiler.rb +6 -1
- data/vitrine.gemspec +2 -2
- 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: decd2f863fee2ee85665a655ba3bf0b9e119f89d
|
4
|
+
data.tar.gz: 5d01078ac0d84a7b7c9e3c882a4cb5572ad66186
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3bc122058c0142438dd3019209eb33a5fb2f286599312d95f29c438010393a17d9dacb9d5b5975767fad44ba37d28445de2b1af43e7534ed1d393f209637303
|
7
|
+
data.tar.gz: fbd77d2b1d504c4d7b933adc71a48fd3982234e00fa12512c5b96a5651c898e66e3e50365628c06971bf899c3b7bbefaa70d6a562e9f0d437a9f0f922eb7061f
|
data/lib/asset_compiler.rb
CHANGED
@@ -94,6 +94,12 @@ class Vitrine::AssetCompiler < Sinatra::Base
|
|
94
94
|
rescue Errno::ENOENT # Missing CoffeeScript
|
95
95
|
forward_or_halt "No such JS file and could not find a .coffee replacement"
|
96
96
|
rescue Exception => e # CS syntax error or something alike
|
97
|
+
|
98
|
+
# Ensure the response with the exception gets reloaded on next request
|
99
|
+
response.headers['Cache-Control'] = 'private'
|
100
|
+
response.headers['Pragma'] = 'no-cache'
|
101
|
+
response.headers.delete('ETag')
|
102
|
+
|
97
103
|
# Inject the syntax error into the browser console
|
98
104
|
console_message = 'console.error(%s)' % [e.class, "\n", "--> ", e.message].join.inspect
|
99
105
|
# Avoid 500 because it plays bad with LiveReload
|
data/lib/version.rb
CHANGED
@@ -51,7 +51,12 @@ class TestVitrineAssetCompiler < Test::Unit::TestCase
|
|
51
51
|
get '/faulty.js'
|
52
52
|
|
53
53
|
assert_equal 200, last_response.status
|
54
|
-
assert_equal 'text/javascript;charset=utf-8', last_response.content_type
|
54
|
+
assert_equal 'text/javascript;charset=utf-8', last_response.content_type, "Should set JS content type"
|
55
|
+
|
56
|
+
assert_equal 'private', last_response.headers['Cache-Control'], "Should be cache busting"
|
57
|
+
assert_equal 'no-cache', last_response.headers['Pragma'], "Should be cache busting with Pragma: no-cache"
|
58
|
+
assert_nil last_response.headers['ETag'], 'Should send no etag across'
|
59
|
+
|
55
60
|
err = 'console.error("ExecJS::RuntimeError\n--> SyntaxError: :1:1: reserved word \"function\"")'
|
56
61
|
assert_equal err, last_response.body
|
57
62
|
end
|
data/vitrine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "vitrine"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.24"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Julik Tarkhanov"]
|
12
|
-
s.date = "2014-
|
12
|
+
s.date = "2014-02-10"
|
13
13
|
s.description = " Serves ERB templates with live CoffeeScript and SASS "
|
14
14
|
s.email = "me@julik.nl"
|
15
15
|
s.executables = ["vitrine"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vitrine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|