<< | Index | >>
Git pull error
$ git pull remote: Counting objects: 46, done. remote: Compressing objects: 100% (26/26), done. remote: Total 26 (delta 20), reused 0 (delta 0) Unpacking objects: 100% (26/26), done. From /home/ywesee/git/oddb.org 81ca738..d8a4e48 master -> origin Updating 81ca738..d8a4e48 error: Your local changes to the following files would be overwritten by merge: src/util/persistence.rb Please, commit your changes or stash them before you can merge. Aborting
Note
class Hash alias :key :index end
Note
Example
masa@masa ~/work $ cat test.rb h = {'a' => 1, 'b' => 2} p h.index(1) p h.key(1) masa@masa ~/work $ ruby186 test.rb "a" test.rb:6: undefined method `key' for {"a"=>1, "b"=>2}:Hash (NoMethodError) masa@masa ~/work $ ruby187 test.rb "a" test.rb:6: undefined method `key' for {"a"=>1, "b"=>2}:Hash (NoMethodError) masa@masa ~/work $ ruby192 test.rb test.rb:5: warning: Hash#index is deprecated; use Hash#key "a" "a"
Namely
We should Hash#index in Ruby 1.8, Hash#key in Ruby 1.9
Experiment
class Hash alias :key :index end h = {'a' => 1, 'b' => 2} p h.index(1) p h.key(1)
Result
masa@masa ~/work $ ruby186 test.rb "a" "a" masa@masa ~/work $ ruby187 test.rb "a" "a" masa@masa ~/work $ ruby192 test.rb test.rb:8: warning: Hash#index is deprecated; use Hash#key "a" test.rb:9: warning: Hash#index is deprecated; use Hash#key "a"
Commit
Note
Bug
NoMethodError undefined method `to_csv' for nil:NilClass
Commit
Refer to: http://dev.ywesee.com/wiki.php/Masa/20110804-testcases-url-format-oddbOrg#Migel
ToDo
URL (example)
Note
Experiment
Run
Access
class List < HtmlGrid::List def migel_code(model) link = PointerLink.new(:to_s, model, @session, self) link.value = model.migel_code link.href = "http://oddb.masa.org" link end end
class ResultList < View::Migel::List
def compose_subheader(item, offset, css='list atc')
xval, yval = offset
#values = [limitation_text(item), nil, item.migel_code, nil, product_description(item)]
values = [limitation_text(item), nil, migel_code(item), nil, product_description(item)]
@grid.add(values, xval, yval)
@grid.add_style(css, xval, yval, 3)
@grid.set_colspan(xval + 2, yval, @width - xval - 1)
end
Result
Note
Next
Note
First design of search result
Experiment
def test ODDB::State::Migel::Test.new(@session, nil) end
EVENTS = [ ... :test ]
#!/usr/bin/env ruby # ODDB::State::Migel:Test -- oddb.org -- 08.08.2011 -- mhatakeyama@ywesee.com require 'state/global_predefine' require 'view/migel/test' module ODDB module State module Migel class Test < State::Migel::Global VIEW = View::Migel::Test end end end end
#!/usr/bin/env ruby # ODDB::View::Migel::Test -- oddb.org -- 08.08.2011 -- mhatakeyama@ywesee.com module ODDB module View module Migel class ResultComposite < HtmlGrid::Composite COMPONENTS = { } end class Test < View::PrivateTemplate CONTENT = ResultComposite end end end end
Access
Result
Next
Experiment
#!/usr/bin/env ruby # ODDB::State::Migel:Test -- oddb.org -- 08.08.2011 -- mhatakeyama@ywesee.com require 'state/global_predefine' require 'view/migel/test' module ODDB module State module Migel class Test < State::Migel::Global VIEW = View::Migel::Test def init @model = [1,2,3,4] end end end end end
#!/usr/bin/env ruby # ODDB::View::Migel::Test -- oddb.org -- 08.08.2011 -- mhatakeyama@ywesee.com require 'htmlgrid/list' module ODDB module View module Migel class List < HtmlGrid::List def init @components = { [0,0] => 'masa', [1,0] => 'hata', } super end end class ResultComposite < HtmlGrid::Composite COMPONENTS = { [0,0] => List } end class Test < View::PrivateTemplate CONTENT = ResultComposite end end end end
Access
Result
Next