Sha256: 4f0dde8bfe31add6979bc5fad945dc9d2f81fd098cc8164f3be70bd88255f4c8
Contents?: true
Size: 523 Bytes
Versions: 6
Compression:
Stored size: 523 Bytes
Contents
module SlideHero class Code 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 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
Version data entries
6 entries across 6 versions & 1 rubygems