Sha256: 0b63abb9de42a0d73a10040999e55184a6b7a810214666ec979074c99686fecb

Contents?: true

Size: 345 Bytes

Versions: 15

Compression:

Stored size: 345 Bytes

Contents

module EPUBInfo
  module Utils
    def self.parse_iso_8601_date(date_str)
      case date_str.count('-')
      when 0
        Date.strptime(date_str, '%Y')
      when 1
        Date.strptime(date_str, '%Y-%m')
      when 2
        Date.strptime(date_str, '%Y-%m-%d')
      end
    end
  end

  class NotAnEPUBFileError < StandardError; end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
epubinfo_with_toc-0.5.7 lib/epubinfo/utils.rb
epubinfo-0.4.4 lib/epubinfo/utils.rb
epubinfo_with_toc-0.5.6 lib/epubinfo/utils.rb
epubinfo_with_toc-0.5.5 lib/epubinfo/utils.rb
epubinfo_with_toc-0.5.4 lib/epubinfo/utils.rb
epubinfo_with_toc-0.5.2 lib/epubinfo/utils.rb
epubinfo_with_toc-0.5.0 lib/epubinfo/utils.rb
epubinfo_with_toc-0.4.5 lib/epubinfo/utils.rb
epubinfo-0.4.3 lib/epubinfo/utils.rb
epubinfo-0.4.2 lib/epubinfo/utils.rb
epubinfo-0.4.1 lib/epubinfo/utils.rb
epubinfo-0.4.0 lib/epubinfo/utils.rb
epubinfo-0.3.6 lib/epubinfo/utils.rb
epubinfo-0.3.5 lib/epubinfo/utils.rb
epubinfo-0.3.4 lib/epubinfo/utils.rb