class Locomotive::Wagon::PullSectionsCommand
Public Instance Methods
_pull()
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb, line 5 def _pull api_client.sections.all.each do |section| write_section(section) end end
write_section(section)
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb, line 11 def write_section(section) write_to_file(section_filepath(section), <<-FRONT_MATTER #{section.definition.to_yaml} --- #{section.template} FRONT_MATTER ) end
Private Instance Methods
section_filepath(section)
click to toggle source
# File lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb, line 22 def section_filepath(section) File.join('app', 'views', 'sections', section.slug + '.liquid') end