Skip to content

Commit

Permalink
Dir.chdir before triggering before_render events
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Jun 29, 2012
1 parent 6248752 commit 92c6f85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/stasis.rb
Expand Up @@ -179,16 +179,16 @@ def render(*only)
Tilt.mappings.keys.detect do |ext|
File.extname(@path)[1..-1] == ext
end

# Change current working directory.
Dir.chdir(File.dirname(@path))

# Trigger all plugin `before_render` events.
trigger(:before_render)

# Skip if `@path` set to `nil`.
next unless @path

# Change current working directory.
Dir.chdir(File.dirname(@path))

# Render the view.
view =
# If the path has an extension supported by [Tilt][ti]...
Expand Down

0 comments on commit 92c6f85

Please sign in to comment.