April 28, 2008

ruby web stack on Ubuntu 8.04

Working installation instruction.

April 26, 2008

change font size in skype 2.0 in ubuntu 8.04

Default font size in skype is very small for me. Here what I did to increase it:
sudo apt-get install qt4-qtconfig
then in System->Preferencies->Qt 4 settings in font tab set desired font size

April 18, 2008

Приятности Ruby

Вот сидел я тут и разбирался с zentest и в его коде я узнал (я конечно, мало чего еще знаю про ruby) прикольную штуку. Если записать команду между ``, то запустится процесс и вернет весь output. Например:


irb(main):001:0> volume_info = `vol`
=> " Volume in drive C is vista\n Volume Serial Number is E486-92B6\n"
irb(main):002:0>

Даже не хочется приводить пример сколько строк кода это займет, например на C#. (Против C# я ничего не имею %).

Ruby zentest autotest and Netbeans 6.1

In netbeans auto test feature works well with rails projects but fails with simple ruby projects.
ZenTest has very strange heuristics for non rails projects:

  • Test files must be stored in the test directory
  • Implementation files must be stored in the lib directory
  • Test files names must start with test_
  • Test class names must start with Test
  • Test files corresponding to a specific implementation file must be named test_<name of implementation file>.rb
Active* libraries and many others have different convention for naming test files and classes:
  • Test files must be stored in the test directory
  • Implementation files must be stored in the lib directory
  • Test files names must end with _test
  • Test class names must end with Test
  • Test files corresponding to a specific implementation file must be named <name of implementation file>_test.rb
Moreover netbeans use this convention to find testing file and test for specific file (rclick->navigate->go to test/go to tested file).

So if I have project with following layout:
lib
--example
----some_class.rb
test
--example
----some_class_test.rb

Autotest gives me:
Dunno! nbproject/private/rake-t.txt
Dunno! lib/example/some_class.rb
Dunno! README
Dunno! lib/main.rb
Dunno! Rakefile
Dunno! nbproject/project.xml
Dunno! nbproject/project.properties
Dunno! test/example/some_class_test.rb

So autotest simply doesn't work with this test naming convention by default.
Lucky for us ZenTest have hooks mechanism that allows to change default behavior.

So I wrote .autotest file and put it in project directory:
lib
--example
----some_class.rb
test
--example
----some_class_test.rb
.autotest

.autotest contents:

Autotest.add_hook :initialize do |at|
at.clear_mappings
at.add_mapping(/^lib\/(.*)\.rb$/) do |f, m|
at.files_matching(/^test\/#{m[1]}_test\.rb$/)
end

at.add_mapping(/^test\/(.*)_test\.rb$/) do |f, m|
at.files_matching(/^test\/#{m[1]}_test\.rb$/)
end
end

class Autotest

def path_to_classname(s)
sep = File::SEPARATOR
f = s.sub(/^test#{sep}((unit|functional|\
integration|views|\
controllers|helpers)\
#{sep})?/, '').sub(/\.rb$/, '').split(sep)
f = f.map { |path| path.split(/_/).map { |seg|
seg.capitalize }.join }
res = f.join('::')
res
end
end
Теперь это выглядит так:



So I edit any class and autotest it! It very cool feature to have. Thanks for zentest authors.
I hope this post will help anyone.

April 3, 2008

Our new product - AnjLab.SyncIT

- Do you have a lot of projects?
- Are you using code.google.com hosing?
- Are you using trac?
- Or may be you are using dotproject?
- Or may be you are using all above?

We use all of them, and we develop small utility to stay tuned with all our projects - AnjLab.SyncIT.

Just try it! It's absolutely free, moreover it is open source.

new version of sql express profiler is out!

We just released new version (v0.1.296.50) of our sql express profiler.
Release contains minor bug fixes with filters.
We want to thanks all users who submitted feedback. Thank you ;).