Class: Vacation::Jekyll
- Inherits:
-
Object
- Object
- Vacation::Jekyll
- Defined in:
- lib/vacation/jekyll.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #compile_to(destination, options = {}) ⇒ Object
- #config_hash ⇒ Object
-
#initialize(source) ⇒ Jekyll
constructor
A new instance of Jekyll.
Constructor Details
#initialize(source) ⇒ Jekyll
Returns a new instance of Jekyll.
7 8 9 10 |
# File 'lib/vacation/jekyll.rb', line 7 def initialize(source) @source = source throw StandardError unless File::readable_real?(source) and File::directory?(source) end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
5 6 7 |
# File 'lib/vacation/jekyll.rb', line 5 def source @source end |
Instance Method Details
#compile_to(destination, options = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/vacation/jekyll.rb', line 23 def compile_to(destination, = {}) = config_hash.deep_merge('destination' => destination).deep_merge() site = ::Jekyll::Site.new site.process end |
#config_hash ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vacation/jekyll.rb', line 12 def config_hash config_file = File.join(source, '_config.yml') begin config = YAML.load_file(config_file) rescue => err config = {} end ::Jekyll::DEFAULTS.deep_merge(config).deep_merge('source' => source) end |