eeepub 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
 - data/lib/eeepub/easy.rb +30 -1
 - data/spec/eeepub/easy_spec.rb +2 -0
 - metadata +2 -2
 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.5. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.5.1
         
     | 
    
        data/lib/eeepub/easy.rb
    CHANGED
    
    | 
         @@ -46,7 +46,32 @@ module EeePub 
     | 
|
| 
       46 
46 
     | 
    
         
             
                def save(filename)
         
     | 
| 
       47 
47 
     | 
    
         
             
                  Dir.mktmpdir do |dir|
         
     | 
| 
       48 
48 
     | 
    
         
             
                    prepare(dir)
         
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                    NCX.new(
         
     | 
| 
      
 51 
     | 
    
         
            +
                      :uid => @uid,
         
     | 
| 
      
 52 
     | 
    
         
            +
                      :title => @titles[0],
         
     | 
| 
      
 53 
     | 
    
         
            +
                      :nav => @nav
         
     | 
| 
      
 54 
     | 
    
         
            +
                    ).save(File.join(dir, @ncx_file))
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                    OPF.new(
         
     | 
| 
      
 57 
     | 
    
         
            +
                      :title => @titles,
         
     | 
| 
      
 58 
     | 
    
         
            +
                      :identifier => @identifiers,
         
     | 
| 
      
 59 
     | 
    
         
            +
                      :creator => @creators,
         
     | 
| 
      
 60 
     | 
    
         
            +
                      :publisher => @publishers,
         
     | 
| 
      
 61 
     | 
    
         
            +
                      :date => @dates,
         
     | 
| 
      
 62 
     | 
    
         
            +
                      :language => @languages,
         
     | 
| 
      
 63 
     | 
    
         
            +
                      :subject => @subjects,
         
     | 
| 
      
 64 
     | 
    
         
            +
                      :description => @descriptions,
         
     | 
| 
      
 65 
     | 
    
         
            +
                      :rights => @rightss,
         
     | 
| 
      
 66 
     | 
    
         
            +
                      :relation => @relations,
         
     | 
| 
      
 67 
     | 
    
         
            +
                      :manifest => @files.map{|i| File.basename(i)},
         
     | 
| 
      
 68 
     | 
    
         
            +
                      :ncx => @ncx_file
         
     | 
| 
      
 69 
     | 
    
         
            +
                    ).save(File.join(dir, @opf_file))
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
                    OCF.new(
         
     | 
| 
      
 72 
     | 
    
         
            +
                      :dir => dir,
         
     | 
| 
      
 73 
     | 
    
         
            +
                      :container => @opf_file
         
     | 
| 
      
 74 
     | 
    
         
            +
                    ).save(filename)
         
     | 
| 
       50 
75 
     | 
    
         
             
                  end
         
     | 
| 
       51 
76 
     | 
    
         
             
                end
         
     | 
| 
       52 
77 
     | 
    
         | 
| 
         @@ -60,6 +85,10 @@ module EeePub 
     | 
|
| 
       60 
85 
     | 
    
         
             
                    filenames << filename
         
     | 
| 
       61 
86 
     | 
    
         
             
                  end
         
     | 
| 
       62 
87 
     | 
    
         | 
| 
      
 88 
     | 
    
         
            +
                  assets.each do |file|
         
     | 
| 
      
 89 
     | 
    
         
            +
                    FileUtils.cp(file, dir)
         
     | 
| 
      
 90 
     | 
    
         
            +
                  end
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
       63 
92 
     | 
    
         
             
                  files(filenames + assets)
         
     | 
| 
       64 
93 
     | 
    
         
             
                  nav(
         
     | 
| 
       65 
94 
     | 
    
         
             
                    [sections, filenames].transpose.map do |section, filename|
         
     | 
    
        data/spec/eeepub/easy_spec.rb
    CHANGED