Class: Locomotive::Mounter::Writer::FileSystem::ContentTypesWriter
- Defined in:
- lib/locomotive/mounter/writer/file_system/content_types_writer.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#prepare ⇒ Object
It creates the content types folder.
-
#write ⇒ Object
It writes all the content types into files.
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
#prepare ⇒ Object
It creates the content types folder
9 10 11 12 |
# File 'lib/locomotive/mounter/writer/file_system/content_types_writer.rb', line 9 def prepare super self.create_folder 'app/content_types' end |
#write ⇒ Object
It writes all the content types into files
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/locomotive/mounter/writer/file_system/content_types_writer.rb', line 15 def write self.mounting_point.content_types.each do |filename, content_type| self.output_resource_op content_type self.open_file("app/content_types/#{filename}.yml") do |file| file.write(content_type.to_yaml) end self.output_resource_op_status content_type end end |