четверг, 14 июля 2011 г.

latest xen 4 and libvirt.

For connect libvirt to xen4 on fedora15 require install latest version of libvirt.
Today it is
rpm -Uvh http://kojipkgs.fedoraproject.org/packages/libvirt/0.9.3/2.fc16/x86_64/libvirt-0.9.3-2.fc16.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/libvirt/0.9.3/2.fc16/x86_64/libvirt-python-0.9.3-2.fc16.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/libvirt/0.9.3/2.fc16/x86_64/libvirt-client-0.9.3-2.fc16.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/parted/3.0/2.fc16/x86_64/parted-3.0-2.fc16.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/netcf/0.1.8/1.fc16/x86_64/netcf-libs-0.1.8-1.fc16.x86_64.rpm

But after tests: kvm is faster simpler and better.

воскресенье, 10 июля 2011 г.

capybara get html

For get html
find("ul.random_quotes").native.to_html
for get elements count
find("ul.random_quotes").native.search("li").size

четверг, 7 июля 2011 г.

запускаем тесты на jenkins

Приложение без иксов может работать в фреймбуфере.
Для рельсы есть готовый гем headless, добавляем его в Gemfile
gem "headless"

В features/support/env.rb добавляем проверку на то как запускать тесты - в иксах или Xvfb:
if ENV['HEADLESS'] == 'true'
require 'headless'
headless = Headless.new
headless.start
at_exit do
headless.destroy
end
end

ну а фреймбуфер ставим в зависимости от дистрибутива.Для федоры
yum install xorg-x11-server-Xvfb

теперь перед запуском в окружение стоит добавить export HEADLESS='true'

пятница, 1 июля 2011 г.

spree amazon api

Hello
released new spree ext. for export products from amazon.
https://github.com/pronix/spree_amazon_api

Spree <-> Amazon
Requirements

Spree >= 0.60.0
Installation

Add to Gemfile:

gem "spree_amazon_api", :git => "git@github.com:pronix/spree_amazon_api.git"

run task:

rake spree_amazon_api:install

run migrate: (add amazon_id to product table)

rake db:migrate

Root taxons define in file: db/amazon_categories.yml
Configure Amazon access:

Setting amazon options in amazon.yml file( Rails.root/config).
Configure example:

development:
:configure: # acces options
:aWS_access_key_id: 0XQXXC6YV2C85DX1BF02
:aWS_secret_key: fwLOn0Y/IUXEM8Hk49o7QJV+ryOscbhXRb6CmA5l
:response_group: 'Large'
:country: 'us' # region
:query: # search options
:q: "%{q}" # %{q} replace on user keywords
:options:
:search_index: 'Books'
:response_group: 'Large, Accessories'
:sort: "salesrank" # default sort

production:
:configure:
:aWS_access_key_id: 0XQXXC6YV2C85DX1BF02
:aWS_secret_key: fwLOn0Y/IUXEM8Hk49o7QJV+ryOscbhXRb6CmA5l
:response_group: 'Large'
:country: 'us'
:query:
:q: "%{q}"
:options:
:search_index: 'Books'
:response_group: 'Large, Accessories'
:sort: "salesrank"

Search options

To customize the search, set search format in param :q(Rails.root/config/amazon.yml)

For instance: if you set :q with "%{q} made in Vermont" then user query "tools" will be replaced with "tools made in Vermont"