vitrine 0.0.25 → 0.0.26

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: 91384529ab3b17a8f37ab9c2e78cecc2182cc091
4
- data.tar.gz: 4031c3404bd57c1d9cf13e45193b60df945ac79e
3
+ metadata.gz: fe7abf99aab7d3ee66abc1be9c1c28a19cf2aef7
4
+ data.tar.gz: 29d1551d75b724d0645467cb38cfd9cdbb1eb951
5
5
  SHA512:
6
- metadata.gz: 894d0915eab432b3bfd615792c924ab200ca7f3f9cfd6b74ff7ca3d4990e1353d37392f61a12636b2fa781d6fc4b21f8cdfdfd7b9c5a5df1b4ba5f0e48da05f4
7
- data.tar.gz: 55f4a1a7a8d009fbe6ec9cee1bcadaa705e884362bbc3270bc667e71c668ec410df9e9b1a2dbf4295a86857a60e8f1c2fc1660560a3945701bed925d09355f7f
6
+ metadata.gz: d5be1d60c2fc56e9e4ecdad8486d3fb64edc86f64e54baf06ffb88e0840401205c7637197a3cee31c9335345ad0273690ef3e153a63d45bf01ed42910fc571cb
7
+ data.tar.gz: 4afdf3e31b68ae1d326d7205062cd7615637caf517f42be0a9ccc8e2edcaa7d4f545198540cccd0487bd2f2eb170359472d1ae1900c92a754896c6c71ae4e1f5
@@ -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
- # We could have sent a header, but it's a nice idea to have the
89
- # sourcemap header saved if we write out the compiled JS,
90
- # whereas otherwise it would have been discarded
91
- [
92
- Vitrine.compile_coffeescript(source_body),
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
@@ -1,3 +1,3 @@
1
1
  module Vitrine
2
- VERSION = '0.0.25'
2
+ VERSION = '0.0.26'
3
3
  end
@@ -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
- assert_include last_response.body, 'alert("rockage!")', 'Should include the compiled function'
22
- assert_include last_response.body, '//# sourceMappingURL=/nice.js.map', 'Should include the reference to the source map'
21
+ assert_equal '/nice.js.map', last_response.headers['X-SourceMap']
22
+ assert_equal '/nice.js.map', last_response.headers['SourceMap']
23
23
 
24
- last_line = last_response.body.split("\n").pop
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.25"
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-10"
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.25
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-10 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra