Greita prieiga prie Rails projektų (2 dalis)

Neatsiejamas įrankis kiekvienos Rails aplikacijos kūrime – log bylos. *nix’e viskas paprasta: tail -f log/development.log ir turime gražią išklotinę. Nors Windows’ams paprasto analogo nėra, tačiau yra galimybė susiinstaliuoti *nix’o emuliatorių – Cygwin. Kaip tik jame ir galime rasti emuliuojamą tail programėlę.

Grįžtant prie “greitos prieigos” batch byla atrodytu taip:

[code]

@echo off
rem Launches tail for specified Ruby on Rails project
rem Usage: console [project_name]

set cygwin_path=c:\cygwin\

rem Windows style path
set projects_path=d:\work\
rem Unix style path
set projects_path_for_cygwin=d/work/

set project_name=%1

if not exist %cygwin_path%. goto wrong_cygwin_path
if not exist %projects_path%. goto wrong_projects_path
if not exist %projects_path%%project_name%. goto wrong_project_name
%cygwin_path%\bin\bash –login -c “tail -f /cygdrive/%projects_path_for_cygwin%%project_name%/log/development.log”
goto end

:wrong_cygwin_path
echo Wrong cygwin path. Check cygwin_path variable in this batch file
pause
goto end

:wrong_projects_path
echo Wrong projects path. Check projects_path variable in this batch file
pause
goto end

:wrong_project_name
echo Wrong project name. Please specify the directory for you Ruby on Rails application
pause
goto end

:end
[/code]

o paleidimas kaip ir ankščiau Win+R bei tail [project_name].

Produktyvaus naudojimo =)

One Reply to “Greita prieiga prie Rails projektų (2 dalis)”

  1. Nebutina instaliuoti Cygwin, si ir dar apie 120 kitu unixiniu programeliu yra rinkinyje “UnxUtils” windows’ams. Atsisiunti, ispakuoji i C:Windows ir naudokis i sveikata 🙂

Leave a Reply to Remigijus Cancel reply

Your email address will not be published. Required fields are marked *