Mailinglist Archive: yast-devel (36 mails)

< Previous Next >
Re: [yast-devel] Yast webservice - sharing .rake files
  • From: Ladislav Slezak <lslezak@xxxxxxx>
  • Date: Thu, 28 May 2009 15:50:00 +0200
  • Message-id: <4A1E9688.2030502@xxxxxxx>
Ladislav Slezak napsal(a):
Duncan Mac-Vicar Prett wrote:
Once the tasks are in a library we don't need to hardcode paths anymore.

I'll try building a separate library...

OK, I have created yast2-webservice-tasks ruby gem in
rest-service/webservice-tasks directory.

The shared tasks (*.rake) are in lib/tasks subdirectory, there is webservice.rb
loads them. You don't have to specify any strange path in Rakefile anymore, the
is more straightforward, see below.

Please review it, this is my first ruby gem package...

I have a question, are there any conventions how to name a gem (resp. the
RPM package)? The gem is named 'yast2-webservice-tasks', the RPM package is
'rubygem-yast2-webservice-tasks'. Is that OK?

How to build the gem

# cd rest-service/webservice-tasks
# rake package

How to install it

# sudo gem install yast2-webservice-tasks

(or you can build the RPM package in package subdirectory)

How to use it in the webservice (or plugins)

Just add

require 'tasks/webservice'

line to your Rakefile. The tasks will be found and loaded automatically,
you can verify it with 'rake -T' command.

Existing tasks

git_check - checks whether the local and remote GIT repo are in sync
(e.g. no uncommitted changes...)

syntax_check - check syntax of all Ruby (*.rb) files

We should use both tasks in the package task, similar to 'make package' in
Yast modules.

How to add a new task

Just place the .rake file into rest-service/webservice-tasks/lib/tasks

Note: I have adapted the devtools skeleton to use this gem.


Best Regards

Ladislav Slez√°k
Yast Developer
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarsk√° 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups