Sha256: b99eea94d33ac4e9f1e6c944dfed141567be9667561cf6a5a32fec7b0833db14

Contents?: true

Size: 875 Bytes

Versions: 9

Compression:

Stored size: 875 Bytes

Contents

require_relative 'presentation_file_parser'
require_relative 'slides_file_content_parser'

module Parade
  module Parsers

    module PresentationDirectoryParser

      SLIDE_SEARCH_PATTERN = File.join('**','*.md')

      def self.parse(filepath,options = {})

        parade_file = Array(options[:parade_file]).find do |relative_filepath|
          parade_file = File.join(filepath,relative_filepath)
          File.exists? parade_file
        end
        
        if parade_file
          PresentationFileParser.parse File.join(filepath,parade_file), options
        else

          slides = Dir[File.join(filepath,SLIDE_SEARCH_PATTERN)].map do |slide_filepath|
            SlidesFileContentParser.parse slide_filepath, options
          end

          section = Section.new
          section.add_section slides
          section

        end
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
parade-0.10.2 lib/parade/parsers/presentation_directory_parser.rb
parade-0.10.1 lib/parade/parsers/presentation_directory_parser.rb
parade-0.10.0 lib/parade/parsers/presentation_directory_parser.rb
parade-0.9.2 lib/parade/parsers/presentation_directory_parser.rb
parade-0.9.1 lib/parade/parsers/presentation_directory_parser.rb
parade-0.9.0 lib/parade/parsers/presentation_directory_parser.rb
parade-0.8.2 lib/parade/parsers/presentation_directory_parser.rb
parade-0.8.1 lib/parade/parsers/presentation_directory_parser.rb
parade-0.8.0 lib/parade/parsers/presentation_directory_parser.rb