Posts tagged with : git

How To Wire up Ruby on Rails and Ampersand.js As a Single Page Application


Ampersand.js is a latest web framework like any other javascript framework e.g. Angularjs. By definition,

Ampersand.js - A highly modular, loosely coupled, non-frameworky framework for building advanced JavaScript apps.

This definition is correct. Ampersandjs is really a non-frameworky framework. Now question comes, Why Ampersand.js?. Because we love Backbone.js, and Ampersand.js is written on the top of Backbone.js. For more details, please refer http://ampersandjs.com.

In this article, I am explaining you to build a simple single page application (not simple as much as any hello world or todo app :)) using rails and ampersand.js. The application will be wired-up with a Rails application and will fetch all its data from rails generated APIs. In fact, behind the scene, Rails application is providing the APIs directly from the file app/assets/javascripts/ampersandtest/data.json. You can also fetch the data from any other application too using your web-service call. The source code is residing on my github repository Source Code and demo is available on Demo. Let's start from scratch.

Basic Installation

More...


Successful Migration from svn to git with history


I am a git lover, not svn. But, when I started my programming, svn was so popular and widespread. But the discovery of git pushed the paradigm shift in world of version control. Git is better than svn in lot of senses which could easily be delineated with the fact that most of the open source contributions and repositories are found on Github. Github could be recognized as the UI interface for git version control.

The time has changed, but yet there are many projects are still residing on svn. This article will enable you to successfully migrate from your old svn version control to new git version control with the help of few chunck of statements. The astonishing fact is that this will not lose your history too.

Lets say your project name is dummyapp and its residing on svn say http://svn/Other/RubyOnRails/apps/dummyapp/trunk.

1). Please go to your local svn copy on your local workstation.

cd PATH_TO_LOCAL_SVN_COPY

2). Create a file say authors-transform.txt which will be having list of all users of current svn dummyapp application.

svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt

This command will fetch all users who have made any commit to dummyapp svn application before, then sort them and store in authors-transform.txt file.

3). Now, install git-svn on your system.

sudo apt-get install git-svn (on linux)

I am not sure about windows, but there will be any application to perform this task in windows also (Please help yourself window users).

4). Now, execute the command

git svn clone svn://svn/Other/RubyOnRails/apps/dummyapp/trunk -A authors-transform.txt  ~/temp

This command will take relatively longer time as it fetches all history of the svn application. For every commit in SVN, it will generate corresponding git commit ID, assign the commiter name and by default create the master branch. As well as, it will copy the whole application as a git repository on your local in temp directory (as in my case the temp directory is there in my home folder)

5). Once step 4 is completed, go to temp directory (cd ~/temp). Create origin remote and assign it to github path.

git remote add origin git@github.com:dummyapp.git

6). Push the code to github.

git push origin master

Thats it !!!

Congratulation !!! Your application has been successfully moved over github with all of its histories and users etc.


Visit the archives!