view · edit · sidebar · attach · print · history

20111010-deubg-import-daily-oddb_org-debug-table-content-kindle-ebook

<< | Index | >>


  1. Debug import export daily oddb.org
  2. New process in bin/admin
  3. Setup oddb.org on Ruby 1.9.3
  4. Debug table of contents kindle ebook

Goal/Estimate/Evaluation
  • Debug jobs oddb / 100% / 100%
  • Debug table of contents kindle ebook / 80% / 50%
  • Setup oddb.org on Ruby 1.9.3 / 50% / 30%
Milestones
  1. Debug import daily, export daily
  2. Missing table contents kindle
  3. Add French link
  4. Setup oddb.org on Ruby 1.9.3
Commit

Debug import export daily oddb.org

Error

/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load --
oddb/util/m10l_document (MissingSourceFile)
       from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
       from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
`require'
       from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in
`new_constants_in'
       from /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
`require'

Note

  • This error comes from 'src/remote/migel/model_super.rb'
  • model_super.rb requires 'require 'oddb/util/m10l_document'

Solution

  • oddb.org needs model_super.rb because of the referential calling of DRbObject for migel server
  • model_super.rb is the same file as the one of migel server
  • I should resolve first the requirement problem in migel server about m10l_document.rb
    • in order to execute migel server without '-I /home/ywesee/git/de.oddb.org/lib' on the server

Experiment

  • lib/migel/model_super.rb
 #require 'oddb/util/m10l_document'
 require 'migel/util/m10l_document'

Run

  • bin/migeld

Result

masa@masa ~/ywesee/migel $ bin/migeld 
/home/masa/ywesee/migel/lib/migel/model_super.rb:98:in `has_many': undefined method `singular' for "subgroups":String (NoMethodError)
        from /home/masa/ywesee/migel/lib/migel/model/group.rb:9
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from /home/masa/ywesee/migel/lib/migel/model.rb:6
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from bin/migeld:10

Updates

  • lib/migel/model_super.rb
 require 'fixes/singular'
 #require 'oddb/util/m10l_document'
 require 'migel/util/m10l_document'
  • add migel/lib/fixes/singular.rb
#!/usr/bin/env ruby
# Fix for String#singular -- migel -- 10.10.2011 -- mhatakeyama@ywesee.com
# Fix for String#singular -- de.oddb.org -- 20.11.2006 -- hwyss@ywesee.com

require 'rubygems'
require 'facet/string/singular'

class String
  inflection_rule '', 'e', 'es'
end

Run

  • bin/migel

Result

  • Run without error

Note

  • We do not have to put '-I /home/ywesee/git/de.oddb.org/lib' option to execute migeld on the server

Commit

New process in bin/admin

Problem

  • A command called from bin/admin runs on the same process with bin/oddbd

Note

  • Jobs scripts run in a different process from bin/oddbd

Task

  • New bin/admin command (or update bin/admin) to execute in a different process from bin/oddbd

suspend

Setup oddb.org on Ruby 1.9.3

First

  • Fix the top page style

Current state

Compare two top page html files with eyes

Note

  • dojo.js javascript is not loaded in Ruby 1.9.3

Debug table of contents kindle ebook

Problem

  • Missing table of contents in compendium_ch.oddb.org.kindle.mobi

Note

  • scripts
    1. /var/ebps/bin/oddb_kindle
    2. /var/ebps/bin/decorators/ch_oddb_de.rb
    3. /etc/ebps/oddb_kindle.yml
    4. source: /var/ebps/data/yaml/fachinfos.ch.oddb.yaml
    5. importer: /usr/local/share/src/ebps/lib/ebps/conversion/fachinfo_yaml.rb
    6. exporter: /usr/local/share/src/ebps/lib/ebps/conversion/mobi_pocket.rb

Run (locally)

masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml"

Result

Note

  • Table of contents is shown

Next

  • Try to run with full data (fachinfos.ch.oddb.yaml)

Result

  • Failed
  • Table of contents is NOT shown

Note

Experiment

  • lib/ebps/conversion/oebps.rb
        def table_of_contents
=begin
          if title = EBPS.config.content_title
            id = "toc-#@uid"
            @ids.push [id, title]
            @builder.h2(title, :id => id)
          end
          @builder.p 'class' => 'ebps' do |xml|
            @subject.chapters.each_with_index do |chapter, idx|
              unless chapter.partial?
                xml.a chapter.heading, 'href' => "#chapter-#{idx.next}-#@uid"
                xml.br
              end
            end
          end
=end
        end

Run

masa@masa ~/ywesee/ebps/data/books $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml" 

Result

  • Table of contents is SHOWN!!

Note

  • The 'table_of_contents' method is NOT related to the table of contents of BOOK
  • This method creates the table of contents in each drug page

Experiment

  • lib/ebps/conversion/oebps.rb
      def self.to_ncx docs, ids, tmpdir
        #NcxFactory.new(docs, ids, tmpdir).to_ncx
      end

Result

  • Table of contents is NOT shown!!

Note

  • This 'to_ncx' method creates the table of contents of book

Note

  • The following warning looks a cause
 ...
 Info(prcgen): Parsing files  0004525
 Info(prcgen): Resolving hyperlinks
 Info(prcgen): Building table of content     URL: /tmp/d20111010-7588-1dc3h71/toc.nc
 Warning(index build): string too long (max=255). Truncated.
 Warning(index build): string too long (max=255). Truncated.
 ...

Reference

Note

  • I have checked each 1,000,000 yaml data but the warning does not come
  • When the script runs all the data at the same time, the warning comes
view · edit · sidebar · attach · print · history
Page last modified on October 11, 2011, at 07:28 AM