<< Masa.20101216-update-import_de_oddb_org_Festbe_Zubef | 2010 | Masa.20101214-update-bbmb-ch >>
except for fastthread gem updating
Run
masa@masa ~/ywesee/bbmb.ch $ bin/bbmbd
[DEPRECATED] By requiring 'spreadsheet/excel' you are loading a Compatibility
layer which provides a drop-in replacement for Spreadsheet::Excel
versions <= 0.3.5.1. This code will be removed in Spreadsheet
version 1.0.0
no such file to load -- /home/masa/ywesee/bbmb.ch/etc/access_gag.rb
loading testenvironment
disabling UPDATER
BbmbApp::RUN_UPDATER=false
BbmbApp::RUN_STATISTICS=false
BBMB::CustomBehaviorGag::MAIL_RECIPIENTS=["mhatakeyama@ywesee.com"]
/usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:148: warning: Object#type is deprecated; use Object#class
...
running cleaner thread
running cleaner thread
starting drb-service
Result
Run
masa@masa ~/ywesee/bbmb.ch $ bin/bbmbd
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- fastthread (LoadError)
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from bin/bbmbd:6
Result
Check fastthread on server
$ gem search fastthread
*** LOCAL GEMS ***
fastthread (0.6.4.1, 0.4)
Optimized replacement for thread.rb primitives
$ emerge -s fastthread
Searching...
[ Results for search key : fastthread ]
[ Applications found : 1 ]
* dev-ruby/fastthread
Latest version available: 1.0.7
Latest version installed: [ Not Installed ]
Size of files: 21 kB
Homepage: http://mongrel.rubyforge.org/
Description: Optimized replacement for thread.rb primitives
License: Ruby
Note
Check fastthread on remote
masa@masa ~/ywesee/bbmb.ch $ gem search fastthread -r *** REMOTE GEMS *** blackwinter-fastthread (1.0.7) fastthread (1.0.7)
Note
fastthread on bbmb.ch server is not the latest version
Note
Run
masa@masa ~/ywesee/bbmb.ch $ bin/bbmbd
[DEPRECATED] By requiring 'spreadsheet/excel' you are loading a Compatibility
layer which provides a drop-in replacement for Spreadsheet::Excel
versions <= 0.3.5.1. This code will be removed in Spreadsheet
version 1.0.0
no such file to load -- /home/masa/ywesee/bbmb.ch/etc/access_gag.rb
loading testenvironment
disabling UPDATER
BbmbApp::RUN_UPDATER=false
BbmbApp::RUN_STATISTICS=false
BBMB::CustomBehaviorGag::MAIL_RECIPIENTS=["mhatakeyama@ywesee.com"]
/usr/lib64/ruby/site_ruby/1.8/mnemonic/Mnemonic.rb:148: warning: Object#type is deprecated; use Object#class
...
running cleaner thread
running cleaner thread
starting drb-service
Result
Note
Run bin/bbmbd
Result
Note
Run bin/bbmbd
Result
Note
Run bin/bbmbd
Result
Differences between bbmb.ch server and git server
Note
Link
Experiment (install fastthread 1.0.7 and run again)
masa@masa ~/ywesee/bbmb.ch $ sudo gem install fastthread Passwort: Building native extensions. This could take a while... Successfully installed fastthread-1.0.7 1 gem installed Installing ri documentation for fastthread-1.0.7... No definition for dummy_dump No definition for dummy_dump No definition for rb_queue_marshal_load No definition for rb_queue_marshal_dump No definition for dummy_dump No definition for dummy_dump No definition for rb_queue_marshal_load No definition for rb_queue_marshal_dump Installing RDoc documentation for fastthread-1.0.7... No definition for dummy_dump No definition for dummy_dump No definition for rb_queue_marshal_load No definition for rb_queue_marshal_dump No definition for dummy_dump No definition for dummy_dump No definition for rb_queue_marshal_load No definition for rb_queue_marshal_dump masa@masa ~/ywesee/bbmb.ch $ gem search fastthread *** LOCAL GEMS *** fastthread (1.0.7)
Run bin/bbmbd
Result
Conclution
Note
$: << File.expand_path("../src", File.dirname(__FILE__))
$: << File.expand_path('../src', File.dirname(__FILE__))
Conclution
Note
Checking point is
def transmit_order(user, order, flavor=BBMB::DEFAULT_FLAVOR)
if(order.empty?)
raise ProcessingException.new(:order, :empty, order)
end
name = transmission_filename(user, order, flavor)
if(flavor == 'vetoquinol')
require 'fileutils'
dir = '/var/www/bbmb.ch/data/vetoquinol/'
FileUtils.mkdir_p(dir)
path = File.join(dir, name)
File.open(path, 'w') { |fh|
fh.puts(transmission_format(user, order))
}
else
remote_file(:transmit_order, name).open("w") { |file|
file.puts(transmission_format(user, order))
}
end
end
Check the data on bbmb.ch server
/var/www/bbmb.ch/data/vetoquinol $ ls -al total 8 drwxr-xr-x 2 apache apache 16 2006-10-01 21:04 . drwxr-xr-x 5 apache apache 24 2006-09-29 16:07 .. -rw-r--r-- 1 apache apache 470 2006-09-29 16:35 KD126043_1159540504.dat -rw-r--r-- 1 apache apache 584 2006-10-01 21:04 KD126823_1159729490.dat
Conclution
Note
masa@masa ~/ywesee/bbmb.ch $ grep -r SERVER_URI *
bin/bbmbd:if(BBMB::SERVER_URI.is_a? Array)
bin/bbmbd: BBMB::SERVER_URI.each { |uri|
bin/bbmbd: DRb.start_service(BBMB::SERVER_URI, bbmb)
src/util/bbmbconfig.rb: SERVER_URI = ["druby://localhost:9999"]#, "druby://192.168.0.35:9876"]
src/util/bbmbconfig.rb: if(SERVER_URI.is_a? Array)
src/util/bbmbconfig.rb: SERVER_URI.first
src/util/bbmbconfig.rb: SERVER_URI.to_s
test/stub_bbmb.rb: remove_const :SERVER_URI
test/stub_bbmb.rb: SERVER_URI = "druby://localhost:2153"
test/test_bbmbapp.rb: drbsession_uri = BBMB::SERVER_URI
test/test_bbmbapp.rb: drbsession_uri = BBMB::SERVER_URI
test/test_bbmbapp.rb: drbsession_uri = BBMB::SERVER_URI
bin/bbmbd
if(BBMB::SERVER_URI.is_a? Array)
BBMB::SERVER_URI.each { |uri|
DRb.start_service(uri, bbmb)
}
else
DRb.start_service(BBMB::SERVER_URI, bbmb)
end
Conclusion
class FavoritesListGag < ProductsListGag
include SizeInputMethods
POSITION_MODIFIER = "favorite_search"
CSS_CLASS = 'favorites'
COMPONENT_CSS_MAP = {
[1,0] => "input-tiny",
[4,0] => "list-big",
[9,0,3] => 'info', # <= here
}
def size(model)
input = SizeInput.new(model, @session, self)
input
end
end
Question
Consideration
Check src/view/favorites.rb
class FavoritesListGag < ProductsListGag
...
end
class FavoritesFormGag < FavoritesForm
def products(model)
FavoritesListGag.new(model.sorted, @session, self)
end
end
class FavoritesCompositeGag < FavoritesComposite
COMPONENTS = {
...
[0,1] => FavoritesFormGag,
...
}
end
class FavoritesViewGag < OrderView
CONTENT = FavoritesCompositeGag
end
Check src/state/favorites.rb
module BBMB
class FavoritesState < OrderState
...
VIEW = FavoritesView
def init_view
user = @session.user
if(user.value(:group_short) == 'Vétoqu')
@default_view = FavoritesViewVetoquinol
elsif(@session.flavor == 'gag')
@default_view = FavoritesViewGag
end
end
Note
Next
grep search
masa@masa ~/ywesee/bbmb.ch $ grep -r FavoritesState * src/model/hospital.rb: NAVIGATION = [ :home, OrdersState, FavoritesState, ProductHistoryState, src/state/favoriteresult.rb: FavoritesState.new(@session, nil) src/state/favorites.rb:# FavoritesState -- bbmb -- 21.04.2004 -- hwyss@ywesee.com src/state/favorites.rb: class FavoritesState < OrderState src/state/hospitaluser.rb: :favorites
Consideration
Then
masa@masa ~/ywesee/bbmb.ch $ grep -r HospitalUserState * src/state/hospitaluser.rb:# HospitalUserState -- bbmb -- 21.04.2004 -- hwyss@ywesee.com src/state/hospitaluser.rb: module HospitalUserState src/state/login.rb: state.extend(HospitalUserState)
Note
Check src/state/login.rb
def login
@session.login
case @session.user
when RootUser
state = AdminsState.new(@session, nil)
state.extend(RootState)
state
when AdminUser
state = HospitalsState.new(@session, nil)
state.extend(AdminUserState)
state
when SubAdminUser
state = HospitalsState.new(@session, nil)
state.extend(SubAdminUserState)
state
when HospitalUser
state = CurrentOrderState.new(@session, nil)
state.extend(HospitalUserState)
state
when SupplierUser
state = BackordersState.new(@session, nil)
state.extend(SupplierUserState)
state
else
self
end
end
Note
Question
Experiment
def login
@session.login
case @session.user
when RootUser
p "login as RootUser"
state = AdminsState.new(@session, nil)
state.extend(RootState)
state
when AdminUser
p "login as AdminUser"
state = HospitalsState.new(@session, nil)
state.extend(AdminUserState)
state
when SubAdminUser
p "login as SubAdminUser"
state = HospitalsState.new(@session, nil)
state.extend(SubAdminUserState)
state
when HospitalUser
p "login as HospitalUser"
state = CurrentOrderState.new(@session, nil)
state.extend(HospitalUserState)
state
when SupplierUser
p "login as SupplierUser"
state = BackordersState.new(@session, nil)
state.extend(SupplierUserState)
state
else
p "login as who?"
self
end
end
Result
Note
Experiment
COMPONENTS = {
[1,0] => "input-tiny",
[4,0] => "list-big",
[9,0,3] => 'info',
}
Note
Experiment

Check HTML source
...class="info" title="Fachinformation">Fi</A><... ...class="info">DDD</A>...
Conclusion
Note
def article_backorder(model)
if(model.value(:article_backorder))
comment = model.backorder_comment
if(comment.to_s.empty?) # <= Here
Consideration
Experiment
def article_backorder(model)
p "getin ValueFormat#article_backorder"
print "model.class=", model.class, "\n"
if(model.value(:article_backorder))
comment = model.backorder_comment
print "comment.class=", comment.class, "\n"
print "comment.empty?=", comment.empty?, "\n"
print "comment.to_s.empty?=", comment.to_s.empty?, "\n"
if(comment.to_s.empty?)
Run (login as customer@ywesee.com (HospitalUser))
Result
"getin ValueFormat#article_backorder" model.class=BBMB::Position "getin ValueFormat#article_backorder" model.class=BBMB::Position "getin ValueFormat#article_backorder" model.class=BBMB::Position "getin ValueFormat#article_backorder" model.class=BBMB::Position comment.class=BBMB::BackorderComment comment.empty?=true comment.to_s.empty?=false "getin ValueFormat#article_backorder" model.class=BBMB::Position
Note
Check BBMB::BackorderComment
src/model/backorder_comment.rb
module BBMB
class BackorderComment
...
def empty?
@attributes.nil? || @attributes.empty? \
|| @attributes.all? { |key, val| val.to_s.empty? }
end
Note
Consideration
Conclusion
Commit
On bbmb.ch server
But I failed to update fastthread through gem
ywesee@whitie /var/www/bbmb.ch $ gem search fastthread -r *** REMOTE GEMS *** ERROR: While executing gem ... (Gem::RemoteSourceException) HTTP Response 302
Memo (git log failed but git log|cat works, due to the character code)
/var/www/bbmb.ch $ git log
invalid charset name
/var/www/bbmb.ch $ git log | cat | more
Date: Wed Dec 15 15:41:51 2010 +0100
Changed files as on bbmb.ch server
commit 2283d32aba16fdfebb2f5150b29a5f89c6f8e429
Author: Masaomi Hatakeyama <mhatakeyama@ywesee.com>
Date: Tue Dec 14 16:19:22 2010 +0100
Change /ywesee/Out to /YWESEE/Out
...
Davatz-san updated gem and fastthread on bbmb.ch server