<< | Index | >>
File
Run
$ ruby pickup_all_groups.rb > ywsbezber_new
Result
Upload it to the test server
Experiment (src/custom/behavior.rb#update_users)
def update_users
users = []
map = user_map
update_values(:users, USER_MAP) { |values|
unless(/Konditionskunde/.match(values[:address1]))
if(uid = map[values[:customer_id]])
values[:uid] = uid
else
values[:klass] = HospitalUser
end
# updated users must be in the group 'Apo'
# Apo group is granted to access all the products
# See ywsbezber
values[:group_short] = 'Apo'
users.push(values)
end
}
users unless users.empty?
end
Run
masa@masa ~/ywesee/bbmb.ch $ cd log/mnemonic/ masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ rm *.* masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ cp ~/work/mnemonic_local_update_all_kund_bak/*.* . masa@masa ~/ywesee/bbmb.ch/log/mnemonic $ cd ../.. masa@masa ~/ywesee/bbmb.ch $ bin/admin ch.bbmb.globopharm> overwrite_customer_ids_by_email '/home/masa/work/new_data/new_customer_id_ean_email.dat' -> 27 ch.bbmb.globopharm> replace_customer_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_user_ids.csv' -> 123 ch.bbmb.globopharm> replace_article_ids_gag_to_alloga '/home/masa/work/new_data/actual_gag_ean_allo_stock_ids.csv' -> 284 ch.bbmb.globopharm> update ->
Result
Experiment (lib/xmlconv/util/application.rb#masa)
module XmlConv module Util class Application def masa 'masa' end
Run
masa@masa ~/ywesee/globopharm.xmlconv.bbmb.ch $ bin/xmlconvd config="etc/xmlconv.yml"
Result
masa@masa ~/ywesee/globopharm.xmlconv.bbmb.ch $ bin/admin server_url="druby://localhost:10012" ch.xmlconv> masa -> masa
Next
Experiment (lib/lib/xmlconv/util/application.rb#inject_xml_order)
def inject_xml_order drb_url = "druby://localhost:9999" name_short = 'gag' inject_id = '123456' src = File.read('/home/masa/work/input.xml') transaction = XmlConv::Util::Transaction.new xml_doc = REXML::Document.new(src) bdd = XmlConv::Conversion::PharmaciePlusBdd.convert(xml_doc) transaction.instance_eval('@model = bdd') XmlConv::PostProcess::Bbmb.inject(drb_url, name_short, inject_id, transaction) rescue => e open('/home/masa/work/log1.dat', 'w') do |out| out.print e end end
Result
Test yaml methods
Run
masa@masa ~/work $ ruby yaml_save.rb > test.yml masa@masa ~/work $ ruby yaml_load.rb #<Test:0x7f109aba23e8 @val="hellooo"> "hellooo"
Note
Polling process
Note (key point)
Experiment (Using PollingMission. it is for the polling of local order file)
polling_file: "/home/masa/work/polling.yml"
require 'conversion/pharmacieplus_bdd' require 'conversion/bdd_i2' require 'postprocess/bbmb'
Run
masa@masa ~/work $ cp input.xml xml_orders/
Wait for a minute (because the polling thread execute start_polling method once a minute)
Result
masa@masa ~/work $ ls input.xml polling_bak polling.yml xml_orders
In order to polling local files (inject the orders to the ftp server)
Current status
187 tests, 764 assertions, 20 failures, 28 errors