fangorn 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fangorn/app.rb +2 -2
- data/lib/fangorn/haml.rb +9 -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: 48eb52d12b998f1474c0c6d9a1ad5ba29601a195
|
4
|
+
data.tar.gz: bf14913ad0ab3f4cd24c93081b54ec07d51f69a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f182ce750c5767e0286e7330439ea9569daed87517ac0f4f72b93e275a660048af189f32cb1a67cf9e8d7b9e84bb6eda0d6945ff347ffe827bcac4170fb841
|
7
|
+
data.tar.gz: acc6a13a48fbe48594c67f947b1cb56ff58ff9e382a8e33d53242563430c7f706f493dea7c8a21b1acc3eb429e971c7647081151b71789603ef01f37edb1aacf
|
data/lib/fangorn/app.rb
CHANGED
@@ -31,7 +31,7 @@ module Fangorn
|
|
31
31
|
|
32
32
|
if @serve
|
33
33
|
puts "Watching #{Output::source}"
|
34
|
-
listener = Listen.to(Output::source, :filter => /\.(haml|sass|js|ico|jpg)$/, &update)
|
34
|
+
listener = Listen.to(Output::source, :filter => /\.(haml|sass|js|ico|jpg|ttf)$/, &update)
|
35
35
|
listener.start
|
36
36
|
|
37
37
|
puts 'Starting server on port 8080'
|
@@ -41,7 +41,7 @@ module Fangorn
|
|
41
41
|
server.start
|
42
42
|
else
|
43
43
|
puts "Updating #{Output::source}"
|
44
|
-
update[Dir[File.join(Output::source, '**/*.{haml,sass,js,ico,jpg}')], [], []]
|
44
|
+
update[Dir[File.join(Output::source, '**/*.{haml,sass,js,ico,jpg,ttf}')], [], []]
|
45
45
|
end
|
46
46
|
end
|
47
47
|
def report(type, input, output)
|
data/lib/fangorn/haml.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'haml'
|
2
|
+
require 'securerandom'
|
2
3
|
|
3
4
|
module Fangorn
|
4
5
|
class Haml < Output
|
@@ -6,6 +7,8 @@ module Fangorn
|
|
6
7
|
|
7
8
|
SCRIPT_SOURCES = {}
|
8
9
|
|
10
|
+
CACHE_BREAK = SecureRandom.hex(4)
|
11
|
+
|
9
12
|
def initialize(input)
|
10
13
|
super input, File.join(Output::dest, input.sub(File.join(Output::source, ''), '').sub(/\.haml$/, ''))
|
11
14
|
end
|
@@ -18,7 +21,7 @@ module Fangorn
|
|
18
21
|
end
|
19
22
|
|
20
23
|
def css_include(file)
|
21
|
-
::Haml::Engine.new("%link{ rel: 'stylesheet', type: 'text/css', href: '#{file}' }").render
|
24
|
+
::Haml::Engine.new("%link{ rel: 'stylesheet', type: 'text/css', href: '#{cache_update file}' }").render
|
22
25
|
end
|
23
26
|
|
24
27
|
def css_include_tree(dir)
|
@@ -39,12 +42,16 @@ module Fangorn
|
|
39
42
|
break
|
40
43
|
end
|
41
44
|
end
|
42
|
-
::Haml::Engine.new("%script{ src: '#{file}' }").render
|
45
|
+
::Haml::Engine.new("%script{ src: '#{cache_update file}' }").render
|
43
46
|
end
|
44
47
|
def js_include_tree(dir)
|
45
48
|
Dir[File.join(Output::dest, dir, '**', '*.js')].sort_by(&:length).map do |file|
|
46
49
|
js_include file.sub File.join(Output::dest, ''), ''
|
47
50
|
end.join
|
48
51
|
end
|
52
|
+
|
53
|
+
def cache_update(file)
|
54
|
+
file + "?p=" + CACHE_BREAK
|
55
|
+
end
|
49
56
|
end
|
50
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fangorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Calhoun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|