venerdì 19 giugno 2009

Git in Gedit

Uno stumento veramente comodo ed efficace per il versionamento è l'ormai famoso e diffuso Git.

Utilizzando come IDE Gedit adeguatamente potenziato (qualche plugin qua e là, nulla di che) mi trovo veramente bene e l'unica mancanza finora era la possibilità di una integrazione con Git.
Partendo da questo post ho scelto di crearmi alcuni semplici script da utilizzare con il plugin Tools Extension, già ampiamente sfruttato.

Premessa
tutti questi comandi fanno riferimento al file attivo in gedit al momento del loro invio quindi bisogna prestare attenzione al file aperto al momento del loro utilizzo. L'istallazione del plugin è facilmente recuperabile in rete, per esempio qui, quindi la considero già fatta.
Per quanto riguarda Git presuppongo che sia già istallato e il repository inizializzato.

Questa è l'interfaccia del plugin richiamabile da:

Strumenti>Strumenti esterni...

Creazione procedura
Clicchiamo su New specificando il nome (a volte non lo prende, non preoccupatevi basta tornare successivamente a personalizzarlo)

Aggiungiamo una descrizione che ci aiuti in Description.

In Accelerator indichiamo il tasto scorciatoia (tutti i comandi saranno disponibili nel menu Strumenti)

In Commands incolliamo lo script che ci interessa

In Inputs scegliamo Nothing
In Output scegliamo 'Display in bottom panel'
In Applicability scegliamo 'All Documents'

L'output dell'esecuzione dei comandi viene visualizzato nella finestra inferiore "Output della shell" visualizzabile con Ctrl+F9

SCRIPT

Commit del file nel branch attivo
#!/bin/sh
# Ask message for commit
COMMIT_MESSAGE=`zenity --text-info --editable --width=500 --title="Commit message - gedit" --text="Insert commit message for this file"`
# add current file into repository
git add "$GEDIT_CURRENT_DOCUMENT_NAME"
# Commit current file with previous message
git commit -m "$COMMIT_MESSAGE"
# Print git status
git status

Commit di tutti i file modificati nel branch attivo
#!/bin/sh
# Ask message for commit
COMMIT_MESSAGE=`zenity --text-info --editable --width=500 --title="Commit message - gedit" --text="Insert commit message"`
# add all files into repository
git add .
# Commit current file with previous message
git commit -m "$COMMIT_MESSAGE"
# Print git status
git status


Cambio branch
#!/bin/sh
# Ask name of branch to change
NEW_BRANCH=`zenity --text-info --editable --width=500 --title="New branch - gedit" --text="Insert the name of new current branch"`
# change branch
git checkout "$NEW_BRANCH"
# Print git status
git status

Caricamento branch"sviluppo" sul master
#!/bin/sh
# Ask name of branch to add to master
NEW_BRANCH=`zenity --text-info --editable --width=500 --title="Branch to add - gedit" --text="Insert the name of branch to add"`
# change branch
git checkout master
git merge "$NEW_BRANCH"
# Print git status
git status

Ovviamente ogni script ha bisogno di una sua procedura :-)
Buon versionamento!

venerdì 22 maggio 2009

A rdoc collection auto-updated

Ever more applications hosted by git hub without documentation updated on-line !

http://rdoc.info/

A simple and really useful service that allows you to always have updated the documentation without having to regenerate every time.

Just click on the update button at the top to make sure that the documentation is up to date and a link back to the corresponding page github

doc of ActiveWarehouse

doc of ActiveWarehouse-etl

A little step by step building AW

A very simple guide to bild a basic RoR application with ActiveWarehouse e ActiveWarehouse-etl

the application

a simple italian guide

venerdì 20 febbraio 2009

Getting started with Activewarehouse: documentation and examples

I began to discover these gems
ActiveWarehouse
ActiveWarehouse-etl

and the first problem was to put together some documentation and examples

an important introduction
a presentation and the code
another presentation

activewarehouse:
rdoc (documentation dated, regenerate it locally rake doc:plugin)
readme

a demo application (github rails 1.1.6) (svn link)
tutorial (via web archive)
a important change

activewarehouse-etl:
the first
ctl examples: 1, 2, 3

the 2 blog of developpers:
http://blog.anthonyeden.com/
http://martyhaught.com/

This is only a first collection and I hope to update it thanks to feedback
Will soon try to write a brief account of my step-by-step experiments