Sha256: 067d236b9491632e1697999c53839f681652ef8dfc46b66baf183be57cfb22f7

Contents?: true

Size: 531 Bytes

Versions: 16

Compression:

Stored size: 531 Bytes

Contents

module EbooksRenamer
  class EpubParser
    class << self
      def parse(filename)
        info = EPUBInfo.get(filename)
        if info.present?
          title     = info.titles.first if info.titles
          author    = info.creators.map(&:name).first if info.creators
          publisher = info.publisher
          if title.present?
            OpenStruct.new title:     title,
                           author:    author,
                           publisher: publisher
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ebooks_renamer-0.2.6 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.2.5 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.2.4 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.2.3 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.2.2 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.5 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.4 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.3 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.2 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.1 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.1.0 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.0.5 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.0.4 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.0.3 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.0.2 lib/ebooks_renamer/epub_parser.rb
ebooks_renamer-0.0.1 lib/ebooks_renamer/epub_parser.rb