Class: Locomotive::Mounter::Writer::FileSystem::SiteWriter

Inherits:
Base
  • Object
show all
Defined in:
lib/locomotive/mounter/writer/file_system/site_writer.rb

Instance Attribute Summary

Attributes inherited from Base

#mounting_point, #runner

Instance Method Summary collapse

Methods inherited from Base

#create_folder, #initialize, #open_file, #target_path

Constructor Details

This class inherits a constructor from Locomotive::Mounter::Writer::FileSystem::Base

Instance Method Details

#prepareObject

It creates the config folder



9
10
11
12
# File 'lib/locomotive/mounter/writer/file_system/site_writer.rb', line 9

def prepare
  super
  self.create_folder 'config'
end

#writeObject

It fills the config/site.yml file



15
16
17
18
19
20
21
22
23
# File 'lib/locomotive/mounter/writer/file_system/site_writer.rb', line 15

def write
  self.open_file('config/site.yml') do |file|
    self.output_resource_op self.mounting_point.site

    file.write(self.mounting_point.site.to_yaml)

    self.output_resource_op_status self.mounting_point.site
  end
end