mbj-assets 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets.gemspec +1 -1
- data/lib/assets/handler.rb +1 -2
- data/lib/assets/mime.rb +2 -1
- data/lib/assets/rule/compile/css.rb +17 -0
- data/spec/integration/assets/spike_spec.rb +4 -4
- 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: e7bb892f77acea2eaba5bed4c187c87ae91f15f5
|
4
|
+
data.tar.gz: 82a3ceb222a646a5381c5be3fab50ddd0ef65fdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d76caf751333480032402aa82633c2bd6bd5665deee8eb18af604f6f5b64f1fc930c0f31983f42f47b2e5d210e415701fe01f0aae88cc84c74bc51ab216441
|
7
|
+
data.tar.gz: 9a7457795473be3e031e481355a2dfc104887e5f6ef53aba151549212b190eecec6bbfd9899582300b4009275f1eeb446d195667353f1e3d0f887832b7b44d17
|
data/assets.gemspec
CHANGED
data/lib/assets/handler.rb
CHANGED
@@ -18,14 +18,13 @@ module Assets
|
|
18
18
|
|
19
19
|
# Call handler
|
20
20
|
#
|
21
|
-
# @param [Application] application
|
22
21
|
# @param [Request] request
|
23
22
|
#
|
24
23
|
# @return [Response]
|
25
24
|
#
|
26
25
|
# @api private
|
27
26
|
#
|
28
|
-
def call(
|
27
|
+
def call(request)
|
29
28
|
name = request.path_info.gsub(prefix, '')
|
30
29
|
asset = environment.get(name)
|
31
30
|
if asset
|
data/lib/assets/mime.rb
CHANGED
@@ -44,7 +44,7 @@ module Assets
|
|
44
44
|
extname(::File.extname(name))
|
45
45
|
end
|
46
46
|
|
47
|
-
# Instantiate object
|
47
|
+
# Instantiate object
|
48
48
|
#
|
49
49
|
# @return [Mime]
|
50
50
|
#
|
@@ -70,6 +70,7 @@ module Assets
|
|
70
70
|
JAVASCRIPT = new('.js', 'application/javascript; charset=UTF-8' )
|
71
71
|
COFFEESCRIPT = new('.coffee', 'application/coffeescript; charset=UTF-8' )
|
72
72
|
SASS = new('.sass', 'text/plain; charset=UTF-8' )
|
73
|
+
SCSS = new('.scss', 'text/plain; charset=UTF-8' )
|
73
74
|
HTML = new('.html', 'text/html; charset=UTF-8' )
|
74
75
|
|
75
76
|
IMAGES = [
|
@@ -22,6 +22,23 @@ module Assets
|
|
22
22
|
|
23
23
|
end # Sass
|
24
24
|
|
25
|
+
# Compiler for sass
|
26
|
+
#
|
27
|
+
class Scss < self
|
28
|
+
handle(Mime::SCSS)
|
29
|
+
|
30
|
+
# Return body
|
31
|
+
#
|
32
|
+
# @return [String]
|
33
|
+
#
|
34
|
+
# @api private
|
35
|
+
#
|
36
|
+
def body
|
37
|
+
::Sass.compile(input.body, :syntax => :scss)
|
38
|
+
end
|
39
|
+
|
40
|
+
end # Sass
|
41
|
+
|
25
42
|
end # Css
|
26
43
|
end # Compile
|
27
44
|
end # Rule
|
@@ -9,11 +9,11 @@ describe Assets, 'and spiking around' do
|
|
9
9
|
let(:repository) do
|
10
10
|
Assets::Repository::Directory.new(root)
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
let(:fonts) do
|
14
14
|
repository.file('fonts.css')
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
let(:application) do
|
18
18
|
repository.compile('application.sass')
|
19
19
|
end
|
@@ -47,8 +47,8 @@ describe Assets, 'and spiking around' do
|
|
47
47
|
Request::Rack.new({'PATH_INFO' => path_info}.merge(extra_hash))
|
48
48
|
end
|
49
49
|
|
50
|
-
subject do
|
51
|
-
server.call(
|
50
|
+
subject do
|
51
|
+
server.call(request)
|
52
52
|
end
|
53
53
|
|
54
54
|
def strip_indentation(text)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mbj-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adamantium
|