Tag Archives: ruby

Guitr – the ease of git usage with multi-git-repo-project structure v0.0.6

Today new version 0.0.6 of the Guitr gem was released with following enhancements:

  • git related operations should be silent to not spam if there is nothing to display
  • options resolving logic was rewritten with OptionParser
  • –exec – a new operation allows to invoke commands against repository directory. For example, you can run guitr –exec ‘git status’ command git status will be invoked against repository directory. It will be helpful if you need to perform similar operations against each repository directory but guitr does not support it. Also the command can be any system command.

For now that’s it.

Enjoy playing Guitr 😉

Guitr – the ease of git usage with multi-git-repo-project structure v0.0.4

Recently new version of the guitr ruby gem was pushed and ready to use.

There are following changes were made since my first post about this gem:

  • –unpushed operation – helps to check what was commited but havn’t pushed yet
  • –pull operation was refactored to a standard git pull command
  • –status operation was refactored to a standard git status command as well
  • git operation error stops guitr invocation bug was fixed
  • spec coverage was enhanced

What’s next.

In the future time I’m going to implement push operation and integrate with http://optionparser.rubyforge.org/ to handle command line arguments.

And in the far future time commits, think it can help to have one message for commits across several repositories related to one feature/user story.

That’s it, thanks for your time.

Enjoy playing guitr 😉

Guitr – the ease of git usage with multi-git-per-project structure

Today I’ve pushed a gem to ease of git pull/status actions on multi-modules projects with git repository per project.

What I mean about multi-modules projects – this is a case when you have some modules/projects with separate git repositories. To avoid manually entering into each directory to perform pulling or checking the status you can install guitr and relax a bit 😉

To install guitr use following command:

[sudo] gem install guitr

To check status use following command:

guitr --status [path_to_repo]  #path is optional argument and if not specified guitr will use current directory as a base directory to start walk from.
guitr --pull [path_to_repo] #Invokes git pull per each git working directory

Fow this time that’s it what guitr can do.

Stay up-to-date here http://webdizz.name/posts/guitr.

Enjoy playing guitr 😉

What’s new in up-coming BuildR

Сегодня заглянул в треккер проекта Buildr и по всей вероятности уже очень скоро можно будет насладится вкусностями, которые обещают включить в версию 1.4.

Итак, что же в этой версии ожидается:

  • поддержка JRuby 1.5, JMock 2.5.1, Ant 1.8.0, JUnit 4.7
  • устранена ошибка падения при работе с rubygems 1.3.6
  • include/exclude методы научились поддерживать лямбда выражения, принимать на вход таски Rake, а так же поддрежка регулярных выражений
  • улучшена поддержка Scala
  • имплементирована поддержка protobuf
  • поддержка в качестве билд-файла файлы buildfile.rb и Buildfile.rb на ряду с buildfile.

Полный список изменений можно узнать тут.

P.S. Немного рекламы – если вы используете Buildr для сборки вашего проекта и ваш проект на Java, то вооспользуйтесь екстеншеном для форматирования кода http://rubygems.org/gems/jstyler.

Jstyler v0.0.4 – update

Jstyler gem was updated to version 0.0.4.
This version contains one major change – avoiding extraction of formatter.jar file, this should help to avoid permission issues on non-windows machines. Also a bit improves a performance on the first run.
New gem is available on http://rubygems.org/gems/jstyler and can be installed using following command:
$[sudo] gem install jstyler -v 0.0.4
Enjoy your “jstyled” code…

Jstyler v0.0.3 – code formatting extension for BuildR

There I’m going to post information related to Jstyler – code formatting extension for BuildR.
Some time ago the v0.0.3 was released and is ready to use.
Prelude…
The main goal of this gem is to provide functionality to perform java code formatting for buildr. I’ve made a little research but it had no luck and decided to make own extension with such functionality. But there was a requirement to not to implement whole staff by my self.  I knew there is a cool functionality built-in Eclipse, but I’d like to have it outside of IDE. After research I’ve found out a lot of libraries, but most of them were not feed my needs and I decided to concentrate my attention on functionality provided by Eclipse. That can be ran through command line, actually here you can find out how it can be configured. But this was not what I wanted also, but I believed in Eclipse “magic”.
Then I’ve tried to extract classes required to perform formatting and had a luck. Now I have a jar files to for this and my runners – 2 java classes to prepare context and invoke format action using  Eclipse classes. All that staff I packed into one jar file.
Now it’s a Ruby‘s turn…
With Ruby things were a bit complicated as I don’t know to much of this language, but have a big desire to make it closer to me. At the end I have several Ruby files with BuildR extension definition.
That’s all about pre-history of this gem.
How-to…
To use this extension you need to install BuildR and gem with extension itself.
sudo gem install buildr
sudo gem install jstyler
After installation you should add several lines of code into your project build-file (buildfile).
require 'jstyler' # this is inclusion of extension's code
And if you agree with Java convention about code formatting that’s it. To perform formatting you need to run command:
buildr format
But if you are disagree with Java conventions and want to use Eclipse convention you need to define a configuration options like following:
jstyler.options[:convention] = 'eclipse'
After all if you would like to have own style you should create it in Eclipse and save under some directory, then define path to it in your buildfile like following:
jstyler.options[:config] = 'path_to_your_org.eclipse.jdt.core.prefs'
Also you can define following configuration options:
  • jstyler.options[:config]  – receives path to config file with formatting style definition (Eclipse generated).
  • jstyler.options[:verbose] – if is specified output should be more detailed

  • jstyler.options[:convention] – java or eclipse – which convention should be used if config path was not specified, by default java is used.

Those options can be defined in ~/.buildr/settings.yaml or per project folder in the build.yaml files.
Next I give you a buildfile for sample project to start with.
# Sample project buildfile
require 'jstyler' # include extension
 
jstyler.options[:config] = "path_to_config"
 
define 'testsrc' do
  # extend Jstyler::Beautify #to extend buildr only for this project
  project.version = 1.0
  project.group = 'name.webdizz.jstyler'
  compile.options.target = '1.5'
  package :jar
end
Source code of the gem can be find here http://github.com/webdizz/jstyler. And the gem itself http://rubygems.org/gems/jstyler
If you have any question related to gem ask here.
That’s it.
Have a fun formatting.