<< | Index | >>
Experiment
Result
Note
Reference
Run
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml"
Log
************************************************** * Amazon.com kindlegen(Linux) V1.2 build 33307 * * A command line e-book compiler * * Copyright Amazon.com 2011 * ************************************************** option: -c2: Kindle Huffdic compression Error(kindlegen): Unsupported argument -nomin "No such file or directory - /tmp/d20111011-30268-1dfk99z/mobipocket.azw" ["/usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `stat'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1407:in `block in fu_each_src_dest'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1423:in `fu_each_src_dest0'", "/usr/lib64/ruby/1.9.1/fileutils.rb:1405:in `fu_each_src_dest'", "/usr/lib64/ruby/1.9.1/fileutils.rb:391:in `cp'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:18:in `compile_azw'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:30:in `block in export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:493:in `block in export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:513:in `call'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:513:in `with_tmpdir'", "/home/masa/ywesee/ebps/lib/ebps/conversion/oebps.rb:457:in `export'", "/home/masa/ywesee/ebps/lib/ebps/conversion/mobi_pocket.rb:29:in `export'", "bin/oddb_kindle:72:in `<main>'"]
Experiment
#'kindlegen_args' => '-c2 -nomin -unicode',
'kindlegen_args' => '-c2',
Run (with small test data)
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml"
Log
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml" ************************************************** * Amazon.com kindlegen(Linux) V1.2 build 33307 * * A command line e-book compiler * * Copyright Amazon.com 2011 * ************************************************** option: -c2: Kindle Huffdic compression Info(prcgen): Added metadata dc:Title "Test kindle 1.2" Info(prcgen): Added metadata dc:Date "2011-10-11" Info(prcgen): Added metadata dc:Creator "ch.oddb.org" Info(prcgen): Parsing files 0000009 Info(prcgen): Resolving hyperlinks Info(prcgen): Building table of content URL: /tmp/d20111011-30497-1aux5vw/toc.ncx Info(pagemap): No Page map found in the book Info(prcgen): Computing UNICODE ranges used in the book Info(prcgen): Found UNICODE range: Basic Latin [20..7E] Info(prcgen): Found UNICODE range: Latin-1 Supplement [A0..FF] Info(prcgen): Found UNICODE range: General Punctuation - Windows 1252 [2013..2014] Info(prcgen): Found UNICODE range: Basic Greek [370..3FF] Info(prcgen): Found UNICODE range: Mathematical Operators [2200..22FF] Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000001 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000002 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000004 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000008 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000016 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000032 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000064 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000128 Info(prcgen/compress): Compiling source text for compression (4096 passes max). Pass 0000154 Info(prcgen/compress): Compression pass 0000001 Info(prcgen/compress): Compression pass 0000002 Info(prcgen/compress): Compression pass 0000003 Info(prcgen/compress): Text compressed to (in % of original size): 056.84% Info(prcgen/compress): Compression dictionary statistics: 000019698 bytes 000001663 entries Info(prcgen/compress): Compression pass 0000004 Info(prcgen/compress): Text compressed to (in % of original size): 053.23% Info(prcgen/compress): Compression dictionary statistics: 000016820 bytes 000001300 entries Info(prcgen/compress): Compression pass 0000005 Info(prcgen/compress): Text compressed to (in % of original size): 051.35% Info(prcgen/compress): Compression dictionary statistics: 000014674 bytes 000001056 entries Info(prcgen/compress): Compression pass 0000006 Info(prcgen/compress): Text compressed to (in % of original size): 047.16% Info(prcgen/compress): Compression dictionary statistics: 000011120 bytes 000000863 entries Info(prcgen/compress): Compression pass 0000007 Info(prcgen/compress): Text compressed to (in % of original size): 046.77% Info(prcgen/compress): Compression dictionary statistics: 000010024 bytes 000000709 entries Info(prcgen/compress): Compression pass 0000008 Info(prcgen/compress): Text compressed to (in % of original size): 046.91% Info(prcgen/compress): Compression dictionary statistics: 000009256 bytes 000000588 entries Info(prcgen/compress): Advanced compression successful (decoded and verified). Info(prcgen): Final stats - text compressed to (in % of original size): 046.91% Info(prcgen): The document identifier is: "Test_kindle_1.2" Info(prcgen): The file format version is V6 Info(prcgen): Saving MOBI file Info(prcgen): MOBI File successfully generated!
Note
Run (with full data)
masa@masa ~/ywesee/ebps $ ruby1.9 -I lib bin/oddb_kindle config="etc/oddb_kindle.yml"
Result
Reference
Top page html files
Next
Experiment
def css_map p "ruby 1.8.6 getin css_map" @css_map ||= self::class::CSS_MAP.dup p @css_map @css_map end
def css_map p "ruby 1.9.3 getin css_map" @css_map ||= self::class::CSS_MAP.dup p @css_map @css_map end
p "css_map.store([0,4,1,9], 'list center')" css_map.store([0,4,1,9], 'list center')
Run
... "css_map.store([0,4,1,9], 'list center')" "ruby 1.8.6 getin css_map" {[0, 0, 1, 5]=>"list center"} "ruby 1.8.6 getin css_map" {[0, 4, 1, 9]=>"list center", [0, 0, 1, 5]=>"list center"} ...
... "ruby 1.9.3 getin css_map" {[0, 0, 1, 5]=>"list center"} "ruby 1.9.3 getin css_map" {[0, 0, 1, 5]=>"list center", [0, 4, 1, 9]=>"list center"} ...
Note
Note
Question
Note
Note
begin require 'htmlgrid.so' rescue LoadError puts "could not find htmlgrid.so, falling back to pure-ruby class" module HtmlGrid class Grid ...
Experiment
#begin # require 'htmlgrid.so' #rescue LoadError ... #end
Run
Result
Note
Setup
masa@masa ~/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/ext/htmlgrid $ ruby193 extconf.rb creating Makefile masa@masa ~/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/ext/htmlgrid $ make compiling grid.c grid.c: In Funktion »grid_set_dimensions«: grid.c:104: Warnung: ISO C90 forbids mixed declarations and code grid.c:126: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_cat_attribute«: grid.c:297: Warnung: Implizite Deklaration der Funktion »STR2CSTR« grid.c:297: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung grid.c:298: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung grid.c:299: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_store_allowed_attribute«: grid.c:337: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung grid.c: In Funktion »grid_to_html«: grid.c:436: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_push«: grid.c:601: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_set_colspan«: grid.c:618: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_insert_row«: grid.c:664: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_field_add_tag«: grid.c:752: Warnung: Übergabe des Arguments 2 von »strcpy« erzeugt Zeiger von Ganzzahl ohne Typkonvertierung /usr/include/bits/string3.h:104: Anmerkung: expected »const char * __restrict__« but argument is of type »int« grid.c: In Funktion »grid_row_set_attributes«: grid.c:781: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_add_attribute«: grid.c:805: Warnung: ISO C90 forbids mixed declarations and code compiling htmlgrid.c linking shared-object htmlgrid.so
#require 'htmlgrid.so'
require '/home/masa/work/htmlgrid.so'
Run
masa@masa ~/ywesee/oddb.org $ ruby193 -I ../oddb/lib bin/oddbd
Access
Result
Oddb (OddbApp): symbol lookup error: /home/masa/work/htmlgrid.so: undefined symbol: STR2CSTR
Reference
Experiment
masa@masa ~/work/ext/htmlgrid $ grep -r STR2CSTR grid.c masa@masa ~/work/ext/htmlgrid $ ruby193 extconf.rb creating Makefile masa@masa ~/work/ext/htmlgrid $ make compiling grid.c grid.c: In Funktion »grid_set_dimensions«: grid.c:104: Warnung: ISO C90 forbids mixed declarations and code grid.c:126: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_cat_attribute«: grid.c:301: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_to_html«: grid.c:439: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_push«: grid.c:604: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_set_colspan«: grid.c:621: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_insert_row«: grid.c:667: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_row_set_attributes«: grid.c:784: Warnung: ISO C90 forbids mixed declarations and code grid.c: In Funktion »grid_add_attribute«: grid.c:808: Warnung: ISO C90 forbids mixed declarations and code compiling htmlgrid.c linking shared-object htmlgrid.so
Result
Patch
Experiment
begin VERSION = '1.0.0'ext_dir = File.expand_path('../../ext/htmlgrid', File.dirname(__FILE__))
ext_lib = File.join(ext_dir, 'htmlgrid.so')
require ext_lib
rescue
Note