lib/slide_hero/code.rb in slide_hero-0.0.9 vs lib/slide_hero/code.rb in slide_hero-0.0.10

- old
+ new

@@ -1,18 +1,13 @@ module SlideHero class Code + include Compilable attr_reader :language, :source, :location def initialize(language, code_path=Dir.pwd, &code_file) @language = language @location = "#{code_path}/code/#{code_file.call}" @source = File.read(location) - rescue Errno::ENOENT + rescue Errno::ENOENT abort "#{Dir.pwd}/#{code_file.call} not found" - end - - def compile - Tilt::ERBTemplate. - new(File.join(SlideHero.template_path, - 'lib/slide_hero/views/code.html.erb')).render(self) end end end