Sha256: 5dbe578d583855fdc90390101cea5a12a1d19ed7b2eec2f34fdbb19fdbb9a7ba
Contents?: true
Size: 748 Bytes
Versions: 1
Compression:
Stored size: 748 Bytes
Contents
require 'hackety_hack/lessons/version' require 'hackety_hack/lessons/rails/engine' if defined?(Rails) require 'metadown' module HacketyHack module Lessons extend self FILE_LIST = Dir["#{File.dirname(__FILE__)}/../../content/*.md"] def titles all.collect{|data| data.metadata["title"]} end def slugs all.collect{|data| data.metadata["slug"]} end def find_by_title(title) all.find{|data| data.metadata["title"] == title} end def find_by_slug(slug) all.find{|data| data.metadata["slug"] == slug} end def all FILE_LIST.collect{|file| Metadown.render(File.read(file)) } end def static_directory "#{File.dirname(__FILE__)}/../../static" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hackety_hack-lessons-1.1.0 | lib/hackety_hack/lessons.rb |