vitrine 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/asset_compiler.rb +6 -8
- data/lib/version.rb +1 -1
- data/test/test_vitrine_asset_compiler.rb +3 -4
- 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: fe7abf99aab7d3ee66abc1be9c1c28a19cf2aef7
|
4
|
+
data.tar.gz: 29d1551d75b724d0645467cb38cfd9cdbb1eb951
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5be1d60c2fc56e9e4ecdad8486d3fb64edc86f64e54baf06ffb88e0840401205c7637197a3cee31c9335345ad0273690ef3e153a63d45bf01ed42910fc571cb
|
7
|
+
data.tar.gz: 4afdf3e31b68ae1d326d7205062cd7615637caf517f42be0a9ccc8e2edcaa7d4f545198540cccd0487bd2f2eb170359472d1ae1900c92a754896c6c71ae4e1f5
|
data/lib/asset_compiler.rb
CHANGED
@@ -82,16 +82,14 @@ class Vitrine::AssetCompiler < Sinatra::Base
|
|
82
82
|
# If this file is not found resort back to a coffeescript
|
83
83
|
begin
|
84
84
|
coffee_source = File.join(get_public, "#{basename}.coffee")
|
85
|
-
mtime_cache coffee_source
|
85
|
+
mtime_cache coffee_source # Avoid CS recompilation if it isn't needed
|
86
86
|
content_type 'text/javascript'
|
87
87
|
source_body = File.read(coffee_source)
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
[
|
92
|
-
|
93
|
-
"//# sourceMappingURL=#{basename}.js.map",
|
94
|
-
].join("\n")
|
88
|
+
|
89
|
+
built = Vitrine.compile_coffeescript(source_body),
|
90
|
+
response.headers['X-SourceMap'] = "#{basename}.js.map"
|
91
|
+
response.headers['SourceMap'] = "#{basename}.js.map"
|
92
|
+
built
|
95
93
|
rescue Errno::ENOENT # Missing CoffeeScript
|
96
94
|
forward_or_halt "No such JS file and could not find a .coffee replacement"
|
97
95
|
rescue Exception => e # CS syntax error or something alike
|
data/lib/version.rb
CHANGED
@@ -18,11 +18,10 @@ class TestVitrineAssetCompiler < Test::Unit::TestCase
|
|
18
18
|
assert_equal 200, last_response.status
|
19
19
|
assert_equal 'text/javascript;charset=utf-8', last_response.content_type
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
assert_equal '/nice.js.map', last_response.headers['X-SourceMap']
|
22
|
+
assert_equal '/nice.js.map', last_response.headers['SourceMap']
|
23
23
|
|
24
|
-
|
25
|
-
assert_include last_line, 'sourceMappingURL'
|
24
|
+
assert_include last_response.body, 'alert("rockage!")', 'Should include the compiled function'
|
26
25
|
end
|
27
26
|
|
28
27
|
def test_compiles_coffeescript_sourcemap
|
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.26"
|
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-02-
|
12
|
+
s.date = "2014-02-17"
|
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.26
|
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-02-
|
11
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|