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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83a9b99a57ac246824bee23629f05ba41c85c739
4
- data.tar.gz: c1cf7509aa32244ee6a74dd8cc7e9da5151a4b66
3
+ metadata.gz: 48eb52d12b998f1474c0c6d9a1ad5ba29601a195
4
+ data.tar.gz: bf14913ad0ab3f4cd24c93081b54ec07d51f69a4
5
5
  SHA512:
6
- metadata.gz: 263565e3e63437cfe38222425d8ab94924846907715e40ef483663abfd3606f844c73a5def68ac348e244f175cd3d10f109b6c3b5966701df6c6287d59e743cd
7
- data.tar.gz: 3aaad46cfc2f7d3faaa1ab9e15f4b58c3e0f095b7c342b60c90dfda534885025a5d90781b7cefcd1b2a41bf09219961a5fe0607662ea9f1bfda1ebc02434c8e8
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.6
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-06-02 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen