fuse 0.1.6 → 0.1.7
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.
- data/lib/fuse.rb +1 -1
- data/lib/fuse/document.rb +7 -0
- data/lib/fuse/document/asset_types.rb +7 -0
- metadata +2 -2
data/lib/fuse.rb
CHANGED
data/lib/fuse/document.rb
CHANGED
@@ -37,6 +37,13 @@ class Fuse::Document
|
|
37
37
|
title.children = Nokogiri::XML::Text.new(@options[:title], document)
|
38
38
|
end
|
39
39
|
|
40
|
+
#add favicon
|
41
|
+
assets.of_type(Fuse::Document::Asset::Image).select{ |a| a.path.match %r`\bfavicon\.\w+$` }.each do |asset|
|
42
|
+
head << link = Nokogiri::XML::Node.new('link', document)
|
43
|
+
link['rel'] = 'shortcut icon'
|
44
|
+
link['href'] = asset.relative_path
|
45
|
+
end
|
46
|
+
|
40
47
|
#attach stylesheets and scripts
|
41
48
|
[Fuse::Document::Asset::StyleSheet, Fuse::Document::Asset::JavaScript].each do |klass|
|
42
49
|
collection = assets.of_type(klass).sort!
|
@@ -5,6 +5,12 @@ require 'uglifier'
|
|
5
5
|
class Fuse::Document::Asset
|
6
6
|
|
7
7
|
class Image < self
|
8
|
+
MIME_TYPES = {
|
9
|
+
ico: 'image/x-icon'
|
10
|
+
}
|
11
|
+
def type
|
12
|
+
MIME_TYPES[extension.to_sym] || super
|
13
|
+
end
|
8
14
|
end
|
9
15
|
|
10
16
|
class Xml < self
|
@@ -27,6 +33,7 @@ class Fuse::Document::Asset
|
|
27
33
|
png: Image,
|
28
34
|
gif: Image,
|
29
35
|
svg: Image,
|
36
|
+
ico: Image,
|
30
37
|
ttf: Font,
|
31
38
|
woff: Font,
|
32
39
|
eot: Font,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thin
|