jasmine-sprockets 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
  require "jasmine"
2
- require "jasmine-sprockets/version"
3
- require "jasmine-sprockets/jasmine_file"
4
2
  require "rack"
5
3
  require "sprockets"
4
+ require "jasmine-sprockets/jasmine_file"
5
+ require "jasmine-sprockets/version"
6
6
 
7
7
  module Jasmine
8
8
 
@@ -1,5 +1,6 @@
1
1
  require "rack"
2
2
  require "sprockets"
3
+ require "sprockets/environment"
3
4
 
4
5
  module Rack
5
6
 
@@ -9,13 +10,16 @@ module Rack
9
10
  end
10
11
 
11
12
  def serving
12
- body = [sprocket[@path].to_s]
13
+ base = sprocket[@path]
14
+ ctype = base.content_type
15
+
16
+ body = [base.to_s]
13
17
  size = Utils.bytesize(body.first)
14
18
 
15
19
  [200, {
16
20
  "Last-Modified" => F.mtime(@path).httpdate,
17
21
  "Cache-Control" => "must-revalidate",
18
- "Content-Type" => Mime.mime_type(F.extname(@path), 'text/plain'),
22
+ "Content-Type" => ctype || Mime.mime_type(F.extname(@path), 'text/plain'),
19
23
  "Content-Length" => size.to_s
20
24
  }, body]
21
25
  end
@@ -1,5 +1,5 @@
1
1
  module Jasmine
2
2
  module Sprockets
3
- VERSION = "0.1.4"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasmine-sprockets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-07 00:00:00.000000000Z
12
+ date: 2011-10-13 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jasmine
16
- requirement: &70211790417940 !ruby/object:Gem::Requirement
16
+ requirement: &70099788747040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.2.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70211790417940
24
+ version_requirements: *70099788747040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sprockets
27
- requirement: &70211790417440 !ruby/object:Gem::Requirement
27
+ requirement: &70099788746200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70211790417440
35
+ version_requirements: *70099788746200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rack
38
- requirement: &70211790417060 !ruby/object:Gem::Requirement
38
+ requirement: &70099788745600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70211790417060
46
+ version_requirements: *70099788745600
47
47
  description:
48
48
  email:
49
49
  - sgonyea@truecar.com