Class: Jekyll::Llms::FileWriter
- Inherits:
-
Object
- Object
- Jekyll::Llms::FileWriter
- Defined in:
- lib/jekyll/llms/file_writer.rb
Instance Method Summary collapse
-
#initialize(destination) ⇒ FileWriter
constructor
A new instance of FileWriter.
- #write(path, content) ⇒ Object
Constructor Details
#initialize(destination) ⇒ FileWriter
Returns a new instance of FileWriter.
8 9 10 |
# File 'lib/jekyll/llms/file_writer.rb', line 8 def initialize(destination) @destination = destination end |
Instance Method Details
#write(path, content) ⇒ Object
12 13 14 15 16 |
# File 'lib/jekyll/llms/file_writer.rb', line 12 def write(path, content) full_path = File.join(destination, path) FileUtils.mkdir_p(File.dirname(full_path)) File.write(full_path, content) end |