class Shipmonk::ViewContext

Public Instance Methods

include_file(partial, locals = {}) click to toggle source
# File lib/shipmonk/view_context.rb, line 14
def include_file(partial, locals = {})
  content = File.read(File.expand_path "src/_#{partial.to_s}.html.haml")
  Haml::Engine.new(content).render Object.new, locals
end
livereload_tag() click to toggle source
# File lib/shipmonk/view_context.rb, line 3
def livereload_tag
  %Q{<script type="text/javascript">
        var tag = '<script type="text/javascript" src="http://thejayvm.ca/livereload.js?host=';
        tag += location.hostname;
        tag += '"></scr';
        tag += 'ipt>';
        document.write(tag);
    </script>
  } unless ENV.fetch('SHIPMONK_ENV', :local).to_sym == :live
end