On Jun 12, 5:23   
> Hi Paul,
> I am currently working on a project that aims to use git as a back-end
> data store. I am using the 'grit' Ruby library. I believe it is used to
> power git hum and will enable you to do what you require. I'm however
> not an expert, and documentation is a bit thin on the ground.
>
> You can install it by typing:
>   
>
> the url is:
>  𺯯
Hi Jen,

Many, many thanks for the tip. I've just had a look at the
documentation and it appears that this is more than I could have hoped
for - the world of ruby just gets better and better.

It looks like I now won't need to clone or pull the files out of the
repo in order to access them from my Rails app, and by being able to
traverse the Git tree, my Rails app can easily just work on the the
changed files, access data from old files, deleted files, etc. I
should be able to get access to the complete documentation history for
my office, for any given set of dates.

Many thanks

Paul

>
> Hope this helps,
> Jen.
>
> On 12/06/11 15:05, paul h wrote:
>
>
>
> > Hi all,
>
> > I need to interact with Git via Ruby on my server and hope someone can
> > point me in the right direction.
>
> > This is the env I have:
>
> > Paperless office (Windows boxes), using Git to back up files to the
> > repo on my server (Centos 5)
>
> > Back Office server application built with Rails manages customer
> > information/emails/standard letters/todo lists etc
>
> > Ruby 1.9.2
>
> > This is the problem I have:
>
> > The Rails app needs to pull backed-up files from the Git repo into a
> > private part of the server so that the Rails app can read/evaluate/
> > display files backed up from the office.
>
> > Therefore, I need ruby to:
>
> > git pull ...
> > enter password
> > wait for git to complete pulling files in
> > hand control back to the Rails app to analyse the files and perform
> > any back office processing as I see fit
>
> > Obviously, I could just ssh into my server and pull the files myself,
> > but that relies on me being around the office all the time, what I
> > really need to do is:
>
> > a) automate the process and,
> > b) provide a function in the Rails app so that non-technical staff can
> > press a button on a web page and begin the process (this part is
> > simple if I can solve a), above)
>
> > I've been through the Pickaxe book, and am going to look closer at PTY
> > and the 'expect' method later today and see if I can figure it out
> > with these, but I am self taught, not 'classically trained' , so I
> > would imagine this may spawn a whole new branch of learning for me in
> > regards to processes and subprocesses, which I need to learn anyhow,
> > so would appreciate any pointers any of the ruby experts out there
> > might be willing to provide.
>
> > Thanks
>
> > Paul