Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support for partials inside partials

  • Loading branch information...
commit f4ae7347328e8cb024a19bfd05c7a37b4d0d9076 1 parent d6e5a71
David Francisco authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 watch
11 watch
View
@@ -83,7 +83,8 @@ module Builder
puts "LOADED : #{name}.partial"
f = File.open(filename, 'rb')
# _partial_ is the var where the result is stored, since we're inside a ERB.new already!
- page = ERB.new(f.read, nil, nil, '_partial_')
+ # The rand() was added in case partials contain partials themselves too
+ page = ERB.new(f.read, nil, nil, "_partial_#{rand(2010)}") # TODO add collision detection
f.close
else
puts "ERROR : #{filename}"
@@ -204,6 +205,10 @@ define_singleton_method(:partial) { |name| Builder::partial(name) }
# Check if the specified options are valid
exit unless Options::valid_options?
+puts ">>> Watching #{$settings[:root]}/#{$settings[:watched_files]}"
+puts ">>> Check your slideshow at http://#{$settings[:binding]}:#{$settings[:port]}/index.html"
+puts ">>> Your slideshow will be built and refreshed automagically\n\n"
+
# Launch the watcher
Thread.new do
script = Watchr::Script.new
@@ -215,10 +220,6 @@ Thread.new do
controller.run
end
-puts ">>> Watching #{$settings[:root]}/#{$settings[:watched_files]}"
-puts ">>> Check your slideshow at http://#{$settings[:binding]}:#{$settings[:port]}/index.html"
-puts ">>> Your slideshow will be built and refreshed automagically\n\n"
-
# Run the thin server
Thin::Server.start($settings[:binding], $settings[:port]) do
run Rack::Directory.new("#{$settings[:root]}")
Please sign in to comment.
Something went wrong with that request. Please try again.