view · edit · sidebar · attach · print · history

20101214-update-bbmb-ch

<< Masa.20101215-update-bbmb-ch | 2010 | Masa.20101213-update-export_fachinfo_yaml >>


  1. Report update gem
  2. Check Hoe error
  3. Review and commit bbmb.ch
  4. Change email addresses bbmb.ch
  5. Check different files one by one bbmb.ch

Goal
  • Update bbmb.ch / 90%
Milestones
  1. Spreadsheet announcement japanese
  2. Check Hoe error 10:15
  3. Review bbmb.ch 14:50
    1. Create customer data
    2. Confirm customer interface (simpler version)
    3. Commit (only the customer interface update)
  4. Change email addresses bbmb.ch 15:40
    1. Resolve pull errors
  5. (bbmb.ch setup script)
Summary
Commits
ToDo Tomorrow
Keep in Mind
  1. export_fachinfo test locally
  2. All test cases YamlExporter test cases oddb.org 20101213
  3. On Ice
  4. emerge --sync

Report update gem

spreadsheet gem package is now updated!!

masa@masa ~ $ gem search spreadsheet -r

*** REMOTE GEMS ***

spreadsheet (0.6.5.0)

Davatz-san's mail latest spreadsheet 0.6.5.0 gem is out

  • He did
 rake release VERSION=0.6.5.0 --trace

Reference

Announcement to ruby-list

Check Hoe error

Error

masa@masa ~/ywesee/spreadsheet $  rake post_news --trace
(in /home/masa/ywesee/spreadsheet)
Hoe.new {...} deprecated. Switch to Hoe.spec.
WARNING: HOE DEPRECATION: Add '>= 0' to the 'ruby-ole' dependency.
** Invoke post_news (first_time)
** Execute post_news
Posted to rubyforge

If I change Hoe.new to Hoe.spec, then

masa@masa ~/ywesee/spreadsheet $  rake post_news --trace
(in /home/masa/ywesee/spreadsheet)
rake aborted!
wrong number of arguments (2 for 1)
/home/masa/ywesee/spreadsheet/Rakefile:12:in `spec'
/home/masa/ywesee/spreadsheet/Rakefile:12
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

But it looks working

Experiment

masa@masa ~/ywesee/spreadsheet $ cat Rakefile 
# -*- ruby -*-

$: << File.expand_path("./lib", File.dirname(__FILE__))

require 'rubygems'
require 'hoe'
require './lib/spreadsheet.rb'

ENV['RDOCOPT'] = '-c utf8'

#Hoe.new('spreadsheet', Spreadsheet::VERSION) do |p|
Hoe.spec('spreadsheet') do |p|
  # p.rubyforge_name = 'spreadsheetx' # if different than lowercase project name
   p.developer('Masaomi Hatakeyama, Zeno R.R. Davatz','mhatakeyama@ywesee.com, zdavatz@ywesee.com')
   p.remote_rdoc_dir = ''
   #p.extra_deps << 'ruby-ole'
   p.extra_deps << ['ruby-ole', '>=1.0']
end

# vim: syntax=Ruby

Result

masa@masa ~/ywesee/spreadsheet $ rake gem
(in /home/masa/ywesee/spreadsheet)
  • Warning disappears

Commit

Memo (How to create Rakefile)

 sow first_project

Rakefile

# -*- ruby -*-

require 'rubygems'
require 'hoe'

# Hoe.plugin :compiler
# Hoe.plugin :gem_prelude_sucks
# Hoe.plugin :inline
# Hoe.plugin :inline
# Hoe.plugin :racc
# Hoe.plugin :rubyforge
# Hoe.plugin :rubyforge

Hoe.spec 'swissmedic_diff' do
 # HEY! If you fill these out in ~/.hoe_template/Rakefile.erb then
 # you'll never have to touch them again!
 # (delete this comment too, of course)

 # developer('FIX', 'FIX@example.com')

 # self.rubyforge_name = 'swissmedic_diffx' # if different than
 # 'swissmedic_diff'
end

# vim: syntax=ruby

Link

Review bbmb.ch

Last update

Confirm bbmb.ch working locally

I forgot my password locally

Reset the password

1. Run bbmb.ch/bin/bbmbd

2. Check hash code

src/model/user.rb

        def recognizes? session
            #puts "#{session[:email].inspect} <=> #{@attributes[:email].inspect}"
            #puts "#{session[:pass].inspect} <=> #{@attributes[:pass_hash].inspect}"
      return false unless session[:email] && session[:pass]
print "session[:pass]="
p session[:pass]
print "@attributes[:pass_hash]="
print @attributes[:pass_hash]
print "session[:email]="
p session[:email]
print "@attributes[:email]="
p @attributes[:email]

3. rewrite the root password

src/model/root.rb

        INITIAL_VALUES = {
            #:email         =>  "hwyss@ywesee.com",
            :email          =>  "mhatakeyama@ywesee.com",
            #:pass_hash =>  "eb5b821092e2f46b27c06a613d7a51dc",
            :pass_hash  =>  "c4efd5020cb49b9d3257ffa0fbccc0ae"
        }

4. Confirm login

Access to http://masapharm.bbmb.ch/

Result

  • Success

Commit

Load customer's information

Memo

 120                         :update_stock,
 121                         :update_suppliers,
 122                         :update_users,
 123                         :update_user_access,
 124                         :update_group_access,

Note

Change email addresses bbmb.ch

Commit

I got an error when I pulled on the bbmb server.

$ git pull
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 6), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From git+ssh://192.168.0.36/home/ywesee/git/bbmb.ch/
  964a381..e68c022  master     -> origin
Updating 964a381..e68c022
error: Your local changes to 'src/custom/behavior.rb' would be
overwritten by merge.  Aborting.
Please, commit your changes or stash them before you can merge.

Note

  • The source on bbmb server did not look the latest
  • It seems that somebody (probably Hannes-san) changed the code directly on the server
  • I mean, the source code on bbmb server is actually DIFFERENT from the source code on git server

git status on bbmb.ch server

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   bin/bbmbd
#       modified:   doc/index.rbx
#       modified:   src/custom/behavior.rb
#       modified:   src/util/bbmbconfig.rb
#       modified:   src/view/favorites.rb
#       modified:   src/view/format.rb
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       .gitignore
#       KD504106_1254299648.dat
#       behavior.patch
#       bin/bbmbd.rej
#       data/
#       doc/favicon.ico
#       doc/resources/dojo.diff
#       doc/resources/dojo/
#       doc/resources/nightly.tgz
#       doc/robots.txt
#       src/custom/behavior.rb.orig
no changes added to commit (use "git add" and/or "git commit -a")

diff between behavior.rb on bbmb.ch server and the latest behavior.rb on git server

masa@masa ~/work $ diff behavior_bbmb.ch.rb behavior_local.rb 
181,182c181,182
<               MAIL_RECIPIENTS_CC = ['it@globopharm.com','zdavatz@ywesee.com','hwyss@ywesee.com']
<               MAIL_INJECT_RECIPIENTS = ['hwyss@ywesee.com']
---
>               MAIL_RECIPIENTS_CC = ['it@globopharm.com','zdavatz@ywesee.com','mhatakeyama@ywesee.com']
>               MAIL_INJECT_RECIPIENTS = ['mhatakeyama@ywesee.com']
184c184
<               MAIL_PDF_RECIPIENTS_CC = ['zdavatz@ywesee.com','hwyss@ywesee.com']
---
>               MAIL_PDF_RECIPIENTS_CC = ['zdavatz@ywesee.com','mhatakeyama@ywesee.com']
186c186
<               #MAIL_RECIPIENTS = ['hwyss@ywesee.com']
---
>               #MAIL_RECIPIENTS = ['mhatakeyama@ywesee.com']
188c188
<               #MAIL_PDF_RECIPIENTS = ['hwyss@ywesee.com']
---
>               #MAIL_PDF_RECIPIENTS = ['mhatakeyama@ywesee.com']
193c193
<                       :update                                 =>      '/YWESEE/Out',
---
>                       :update                                 =>      '/ywesee/Out',
356c356
<                                       error.to = 'hwyss@ywesee.com'
---
>                                       error.to = 'mhatakeyama@ywesee.com'
480,492c480,482
<                       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
---
>                       remote_file(:transmit_order, name).open("w") { |file|
>                               file.puts(transmission_format(user, order))
>                       }

Note

  • In my opinion,
    • The merging or stashing of the code on bbmb.ch server is not good idea,
    • since now the bbmb.ch is working

Question

  • How can I merge only one file? (git)

Next

  • Check different files one by one

Check different files one by one bbmb.ch

git status on bbmb.ch

/var/www/bbmb.ch $ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   bin/bbmbd
#       modified:   doc/index.rbx
#       modified:   src/custom/behavior.rb
#       modified:   src/util/bbmbconfig.rb
#       modified:   src/view/favorites.rb
#       modified:   src/view/format.rb
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       .gitignore
#       KD504106_1254299648.dat
#       behavior.patch
#       bin/bbmbd.rej
#       data/
#       doc/favicon.ico
#       doc/resources/dojo.diff
#       doc/resources/dojo/
#       doc/resources/nightly.tgz
#       doc/robots.txt
#       src/custom/.behavior.rb.swp
#       src/custom/behavior.rb.orig
no changes added to commit (use "git add" and/or "git commit -a")
  • Save these files in local PC just in case
    1. modified: bin/bbmbd
    2. modified: doc/index.rbx
    3. modified: src/custom/behavior.rb
    4. modified: src/util/bbmbconfig.rb
    5. modified: src/view/favorites.rb
    6. modified: src/view/format.rb

Compare files between bbmb.ch and git servers

1. bin/bbmbd

masa@masa ~/work $ diff bbmb.ch_server/bbmbd local/bin/bbmbd 
6d5
< require 'fastthread'

2. doc/index.rbx

masa@masa ~/work $ diff bbmb.ch_server/index.rbx local/doc/index.rbx 
8,11c8,9
< $: << File.expand_path('../src', File.dirname(__FILE__))
< require 'util/bbmbconfig'
< #load(File.expand_path('../src/util/bbmbconfig.rb', 
< #     File.dirname(__FILE__)))
---
> load(File.expand_path('../src/util/bbmbconfig.rb', 
>       File.dirname(__FILE__)))

3. src/custom/behavior.rb

masa@masa ~/work $ diff bbmb.ch_server/behavior.rb local/src/custom/behavior.rb 
181,182c181,182
<               MAIL_RECIPIENTS_CC = ['it@globopharm.com','zdavatz@ywesee.com','hwyss@ywesee.com']
<               MAIL_INJECT_RECIPIENTS = ['hwyss@ywesee.com']
---
>               MAIL_RECIPIENTS_CC = ['it@globopharm.com','zdavatz@ywesee.com','mhatakeyama@ywesee.com']
>               MAIL_INJECT_RECIPIENTS = ['mhatakeyama@ywesee.com']
184c184
<               MAIL_PDF_RECIPIENTS_CC = ['zdavatz@ywesee.com','hwyss@ywesee.com']
---
>               MAIL_PDF_RECIPIENTS_CC = ['zdavatz@ywesee.com','mhatakeyama@ywesee.com']
186c186
<               #MAIL_RECIPIENTS = ['hwyss@ywesee.com']
---
>               #MAIL_RECIPIENTS = ['mhatakeyama@ywesee.com']
188c188
<               #MAIL_PDF_RECIPIENTS = ['hwyss@ywesee.com']
---
>               #MAIL_PDF_RECIPIENTS = ['mhatakeyama@ywesee.com']
356c356
<                                       error.to = 'hwyss@ywesee.com'
---
>                                       error.to = 'mhatakeyama@ywesee.com'
480,492c480,482
<                       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
---
>                       remote_file(:transmit_order, name).open("w") { |file|
>                               file.puts(transmission_format(user, order))
>                       }

4. src/util/bbmbconfig.rb

masa@masa ~/work $ diff bbmb.ch_server/bbmbconfig.rb local/src/util/bbmbconfig.rb 
6c6
<       SERVER_URI = ["druby://localhost:9999"]#, "druby://192.168.0.35:9876"]
---
>       SERVER_URI = ["druby://localhost:9999", "druby://192.168.0.35:9876"]

5. src/view/favorites.rb

masa@masa ~/work $ diff bbmb.ch_server/favorites.rb local/src/view/favorites.rb 
58c58
<                       [9,0,3] =>      'info',
---
>                       [8,0,3] =>      'info',

6. src/view/format.rb

masa@masa ~/work $ diff bbmb.ch_server/format.rb local/src/view/format.rb 
39c39
<                               if(comment.to_s.empty?)
---
>                               if(comment.empty?)

Memo

  • 'vimdiff' command is also useful to check differences

Next

  • Check one by one and understand them, and think what to do
view · edit · sidebar · attach · print · history
Page last modified on July 13, 2011, at 12:05 PM