Sha256: 758a7712841d88b50b011c6272bb5401ec523944117fb64e1036d505b4bbf65e

Contents?: true

Size: 506 Bytes

Versions: 5

Compression:

Stored size: 506 Bytes

Contents

module Locomotive::Wagon

  class PullSectionsCommand < PullBaseCommand

    def _pull
      api_client.sections.all.each do |section|
        write_section(section)
      end
    end

    def write_section(section)
      write_to_file(section_filepath(section), <<-FRONT_MATTER
#{section.definition.to_yaml}
---
#{section.template}
      FRONT_MATTER
      )
    end

    private

    def section_filepath(section)
      File.join('app', 'views', 'sections', section.slug + '.liquid')
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
locomotivecms_wagon-3.2.0.alpha2 lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb
locomotivecms_wagon-3.2.0.alpha1 lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb
locomotivecms_wagon-3.1.1 lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb
locomotivecms_wagon-3.1.0 lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb
locomotivecms_wagon-3.1.0.beta1 lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb