<< | Index | >>
Error when 'git pull' online server
oddb.org $ git pull remote: Counting objects: 25, done. remote: Compressing objects: 100% (13/13), done. remote: Total 13 (delta 11), reused 0 (delta 0) Unpacking objects: 100% (13/13), done. From /home/ywesee/git/oddb.org fc33b55..1353688 master -> origin Updating fc33b55..1353688 error: Your local changes to the following files would be overwritten by merge: src/util/exporter.rb Please, commit your changes or stash them before you can merge. Aborting
Note
diff --git a/src/util/exporter.rb b/src/util/exporter.rb index 23571e2..1935ce2 100644 --- a/src/util/exporter.rb +++ b/src/util/exporter.rb @@ -53,9 +53,11 @@ module ODDB export_doc_csv export_index_therapeuticus_csv export_price_history_csv +=begin # inoperable atm. run_on_monthday(1) { export_fachinfo_pdf } +=end nil end def export_helper(name)
Note
Commit
Restart
Run
~ $ screen -S masa ~ $ cd /var/www/oddb.org/ /var/www/oddb.org $ bin/admin ch.oddb> Exporter.new(self).export_oddbdat (Ctl+a, Ctl+d) (detach) ~ $ screen -ls There are screens on: 11252.pts-2.thinpower (Detached) 28306.pts-2.thinpower (Detached) 31058.masa (Detached) 3 Sockets in /var/run/screen/S-ywesee.
Note
screen -x masa
or
screen -r masa
Note
/var/www/oddb.org $ ls -al data/downloads/ 2011-02-03 10:02 oddbdat.tar.gz 2011-02-03 10:02 oddbdat.zip
Memo
Reference
Run
Run export_fachinfo_pdf
masa@masa ~/ywesee/oddb.org $ bin/admin ch.oddb> Exporter.new(self).export_fachinfo_pdf
Result
Error: Errno::ENOENT Message: No such file or directory - fachinfos_de.pdf Backtrace: (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:39:in `initialize' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:39:in `open' (druby://localhost:10005) /home/masa/ywesee/oddb.org/ext/export/src/odba_exporter.rb:39:in `compress' /home/masa/ywesee/oddb.org/src/util/exporter.rb:109:in `export_fachinfo_pdf' /home/masa/ywesee/oddb.org/src/util/exporter.rb:304:in `call' /home/masa/ywesee/oddb.org/src/util/exporter.rb:304:in `safe_export' /home/masa/ywesee/oddb.org/src/util/exporter.rb:106:in `export_fachinfo_pdf' /home/masa/ywesee/oddb.org/src/util/exporter.rb:104:in `each' /home/masa/ywesee/oddb.org/src/util/exporter.rb:104:in `export_fachinfo_pdf' (eval):1:in `_admin' /home/masa/ywesee/oddb.org/src/util/failsafe.rb:9:in `call' /home/masa/ywesee/oddb.org/src/util/failsafe.rb:9:in `failsafe' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1399:in `_admin' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1397:in `initialize' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1397:in `new' /home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1397:in `_admin' /usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__' /usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block' /usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform' /usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop' /usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop' /usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start' /usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run' /usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize' /usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new' /usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service' bin/oddbd:38
Note
Certainly 'export_fachinfo_pdf' does not work
Check changed parts
File list
masa@masa ~/work/oddb.org $ ruby test/test_model/package.rb /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- util/quanty (LoadError) from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/masa/work/oddb.org/src/model/dose.rb:4 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/work/oddb.org/src/model/part.rb:4 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/work/oddb.org/src/model/package.rb:10 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 test/test_model/package.rb:6
for src/plugin/oddbdat_export.rb
masa@masa ~/work/oddb.org/test/test_plugin $ ruby oddbdat_export.rb Loaded suite oddbdat_export Started Finished in 0.0001 seconds. 0 tests, 0 assertions, 0 failures, 0 errors
Note
masa@masa ~/work $ git clone git://scm.ywesee.com/oddb.org Initialized empty Git repository in /home/masa/work/oddb.org/.git/ remote: Counting objects: 27515, done. remote: Compressing objects: 100% (9158/9158), done. remote: Total 27515 (delta 21538), reused 22975 (delta 18081) Receiving objects: 100% (27515/27515), 16.37 MiB | 3.39 MiB/s, done. Resolving deltas: 100% (21538/21538), done. masa@masa ~/work $ cd oddb.org masa@masa ~/work/oddb.org $ ruby test/test_model/package.rb /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- util/quanty (LoadError) from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/masa/work/oddb.org/src/model/dose.rb:4 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/work/oddb.org/src/model/part.rb:4 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/work/oddb.org/src/model/package.rb:10 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 test/test_model/package.rb:6
But
masa@masa ~/work $ sh setup.oddb.org.sh masa@masa ~/work $ cd oddb.org masa@masa ~/work/oddb.org $ ruby test/test_model/package.rb Loaded suite test/test_model/package Started .................................................... Finished in 0.02224 seconds. 52 tests, 128 assertions, 0 failures, 0 errors
Note
Experiment
def test_comparable_size__empty assert_equal 'masa', @package.comparable_size end
Result (confirm the failure)
masa@masa ~/ywesee/oddb.org $ ruby test/test_model/package.rb Loaded suite test/test_model/package Started ..........F.......................................... Finished in 0.022925 seconds. 1) Failure: test_comparable_size__empty(ODDB::TestPackage) [test/test_model/package.rb:171]: <"masa"> expected but was <Quanty(0,'')>. 53 tests, 129 assertions, 1 failures, 0 errors
Experiment (make it pass)
def test_comparable_size__empty assert_equal [], @package.parts assert_equal Dose.new(0, ''), @package.comparable_size end
Result
masa@masa ~/ywesee/oddb.org $ ruby test/test_model/package.rb Loaded suite test/test_model/package Started ..................................................... Finished in 0.02257 seconds. 53 tests, 130 assertions, 0 failures, 0 errors
Note
Next
Done
ext/export/test/test_oddbdat.rb (the first skelton)
#!/usr/bin/env ruby # ODDB::OdbaExporter::TestTable, TestLine -- oddb -- 03.02.2011 -- mhatakeyama@ywesee.com $: << File.expand_path('../src', File.dirname(__FILE__)) $: << File.expand_path('../../../src', File.dirname(__FILE__)) $: << File.expand_path('../../..', File.dirname(__FILE__)) require 'test/unit' require 'flexmock' require 'oddbdat' module ODDB module OdbaExporter class TestTable < Test::Unit::TestCase Table::FILENAME = 'table' def test_filename table = Table.new assert_equal('table', table.filename) end end class TestLine < Test::Unit::TestCase def test_content line = Line.new assert([], line.content(nil)) end end end end
Result
masa@masa ~/ywesee/oddb.org/ext/export/test $ ruby test_oddbdat.rb Loaded suite test_oddbdat Started .. Finished in 0.000563 seconds. 2 tests, 2 assertions, 0 failures, 0 errors
Next
ext/export/test/test_oddbdat.rb (About Table and Line classes)
#!/usr/bin/env ruby # ODDB::OdbaExporter::TestTable, TestLine -- oddb -- 03.02.2011 -- mhatakeyama@ywesee.com $: << File.expand_path('../src', File.dirname(__FILE__)) $: << File.expand_path('../../../src', File.dirname(__FILE__)) $: << File.expand_path('../../..', File.dirname(__FILE__)) require 'test/unit' require 'flexmock' require 'oddbdat' module ODDB module OdbaExporter class TestTable < Test::Unit::TestCase Table::FILENAME = 'table' def test_filename table = Table.new assert_equal('table', table.filename) end end class TestLine < Test::Unit::TestCase Line::LENGTH = 3 def setup @line = Line.new end def test_content assert_equal([], @line.content(nil)) structure = {1=>"1", 2=>"2", 3=>"3"} assert_equal(["1", "2", "3"], @line.content(structure)) end def test_empty? assert_equal(true, @line.empty?) end def test_structure assert_equal(nil, @line.structure) end def test_to_s assert_equal('', @line.to_s) end end end end
Result
masa@masa ~/ywesee/oddb.org/ext/export/test $ ruby test_oddbdat.rb Loaded suite test_oddbdat Started ..... Finished in 0.001622 seconds. 5 tests, 6 assertions, 0 failures, 0 errors
Next
Memo
AcLine test
class TestAcLine < Test::Unit::TestCase include FlexMock::TestCase def setup @package = ODDB::Package.new('12') @package.sequence = StubPackageSequence.new @registration = flexmock('registration') do |mock| mock.should_receive(:generic_type).and_return(:generic) mock.should_receive(:registration_date).and_return(Date.new(2011,2,3)) end @package.sequence.registration = @registration @package.create_sl_entry @package.sl_entry.limitation = 'limitation' @package.sl_entry.limitation_points = 5 @acline = AcLine.new(@package) end def test_generic_code assert_equal('Y', @acline.generic_code(@registration)) end def test_iks_date assert_equal('20110203', @acline.iks_date(@registration)) end def test_ikskey assert_equal('12345012', @acline.ikskey) end def test_inscode assert_equal('1', @acline.inscode) end def test_limitation assert_equal('Y', @acline.limitation) end def test_limitation_points assert_equal(5, @acline.limitation_points) end def test_structure expected = { 1 =>"01", 2 =>"20110203000000", 3 =>"1", 4 =>@package.oid, 5 =>"4", 7 =>"12345012", 14=>nil, 20=>"Y", 22=>"20110203", 29=>"3", 32=>nil, 39=>"1", 40=>"Y", 41=>5, 47=>nil, } # test assert_equal(expected.sort, @acline.structure.sort) end end
Result
masa@masa ~/ywesee/oddb.org/ext/export/test $ ruby test_oddbdat.rb Loaded suite test_oddbdat Started ............ Finished in 0.006488 seconds. 12 tests, 13 assertions, 0 failures, 0 errors
Note
Next
Result
masa@masa ~/ywesee/oddb.org/ext/export/test $ ruby test_oddbdat.rb Loaded suite test_oddbdat Started ......................... Finished in 0.014636 seconds. 25 tests, 27 assertions, 0 failures, 0 errors
Test coverage (ext/export/src/oddbdat.rb)
masa@masa ~/ywesee/oddb.org/ext/export/test $ rcov test_oddbdat.rb ... ext/export/src/oddbdat.rb 54.75%
Total coverage (oddb.org)
masa@masa ~/ywesee/oddb.org $ rcov test/suite.rb ... TOTAL 63.83%