Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-16 Thread Matthew Winter
Hi, Thanks guys for all the suggestions. Most helpfull. I got the print outs I wanted to take with me on my flight. 51 hours of flights so plenty of time to digest ruby code. Regards Matthew Winter On 12/02/2010, at 3:51 PM, Clifford Heath wrote: On 13/02/2010, at 8:42 AM, Lucas Parr

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-12 Thread Clifford Heath
On 13/02/2010, at 3:49 PM, Nicholas Jefferson wrote: The find script sorts the filenames (something find doesn't do), but also handles files with spaces in the names. GNU sort has the -z (--zero-terminated) option to "end lines with 0 byte, not newline", so find whatever -print0 | sort -z, and

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-12 Thread Nicholas Jefferson
The find script sorts the filenames (something find doesn't do), but also handles files with spaces in the names. GNU sort has the -z (--zero-terminated) option to "end lines with 0 byte, not newline", so find whatever -print0 | sort -z, and you don't need the tr. Thanks, Nicholas -- You r

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-12 Thread Clifford Heath
On 13/02/2010, at 8:42 AM, Lucas Parry wrote: why involve xargs at all? find -type f -name '*.rb' -exec cat {} \; Because this forks and execs 'cat' for every single file, which can be a lot slower. Find also scans all your .git/.svn directories etc, which means you get a lot of false hits on

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-12 Thread Lucas Parry
why involve xargs at all? find -type f -name '*.rb' -exec cat {} \; On Fri, Feb 12, 2010 at 3:19 PM, Nicholas Jefferson wrote: >> find . | grep .rb | xargs cat >> >> yes? > > ugh.. > > find -type f -name '*.rb' -print0 | xargs -0 cat > > Thanks, > > Nicholas > > -- > You received this message b

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-12 Thread Nicholas Jefferson
find . | grep .rb | xargs cat yes? ugh.. find -type f -name '*.rb' -print0 | xargs -0 cat Thanks, Nicholas -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to rails-ocea...@googlegroups.com. To uns

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Andrew Grimm
You can replace that grep with find . -name "*.rb" so you can have find . -name "*.rb" | xargs cat | grep OMG http://github.com/rails/rails/commit/2ebea1c02d10e0fea26bd98d297a8f4d41dc1aff Andrew On Fri, Feb 12, 2010 at 3:14 PM, Jonathan Clarke wrote: > Insert your swearword of choice below:

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Korny Sietsma
I'm afraid I kill a few trees this way - printouts are still the best way to use my commuting time; until I get something with a kindle-like screen, that also does syntax highlighting (ideally in colour!) :) Mind you, I do print 4-up double-sided, so 316 pages becomes 39 pages of 4-up double-side

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Ryan Bigg
Whilst this app that I'm doing at the moment isn't the biggest I've ever worked on, the total line count of it is 10,128. Given an average number of 32 lines on a single piece of paper, this would mean 316 pieces of paper or 158 if you duplexed. According to this rake stats output the code LOC is o

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
On 12/02/2010, at 4:09 PM, Clifford Heath wrote: > On 12/02/2010, at 3:45 PM, Matthew Winter wrote: >> On 12/02/2010, at 3:15 PM, Clifford Heath wrote: >> Kill Trees vs Get a big screen >> Eco Papervs Coal fired power station > > Yo

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Clifford Heath
On 12/02/2010, at 3:50 PM, Matthew Winter wrote: On 12/02/2010, at 3:25 PM, Chris Lloyd wrote: In Coders at Work, Peter Norvig recalled working on an interpreter. To refractor it he printed out all the code, took it to a cabin for a week and rewrote it with a pen and paper. My memory is prett

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Clifford Heath
On 12/02/2010, at 3:45 PM, Matthew Winter wrote: On 12/02/2010, at 3:15 PM, Clifford Heath wrote: Kill Trees vs Get a big screen Eco Paper vs Coal fired power station You can turn off a screen. You can't turn a tree on again.

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
On 12/02/2010, at 3:25 PM, Chris Lloyd wrote: > In Coders at Work, Peter Norvig recalled working on an interpreter. To > refractor it he printed out all the code, took it to a cabin for a week and > rewrote it with a pen and paper. My memory is pretty fuzzy, so it may not > have been Peter Nor

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
On 12/02/2010, at 3:15 PM, Clifford Heath wrote: > It's never elegant to gratuitously kill trees. > Get a big screen and practise using your tools better, would be my advice. > Kill Trees vs Get a big screen Eco Paper vs Coa

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
On 12/02/2010, at 3:15 PM, Jonathan Clarke wrote: > Best way to get to know the project is through the tests...read and > understand every one of them and mastery shall be yours... > > There are tests right? > > Jonathan There are tests and plenty of them. Agreed, going through the tests are

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Geoff Tench
On Fri, Feb 12, 2010 at 2:03 PM, Matthew Winter wrote: > Hi, > > I was wondering if anyone knows of a good method of being able to print all > source code within a Rails project, ideally with a single command. > > I have seen many methods of printing Ruby code, but nothing that would > allow me to

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Jared Fraser
As I was just recalling on Twitter, at the end of my first semester teaching, My boss requested that I print out the entire rails app developed by my students (I was teaching a class which just develops a real world project). I objected, but he was insistent. After seeing the sheer size of the thin

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Mark Wotton
Printing out can be helpful for really gnarly code. I used to do it a lot more - even with your own code, you sometimes see it in a different light on paper. mark On Fri, Feb 12, 2010 at 3:34 PM, Ryan Bigg wrote: > I agree with going through the code and reading the tests (again "there are > tes

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Ryan Bigg
I agree with going through the code and reading the tests (again "there are tests, aren't there?", aka TATAT). If the application is a bit light on tests ask them what they spend most of their time as that's probably going to be where you're going to spend most of yours too. See a bug? Write a test

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Chris Lloyd
On 12 February 2010 14:52, Anthony Richardson wrote: > I don't know the answer sorry but the mind boggles as to why anyone > would want to do that? In Coders at Work, Peter Norvig recalled working on an interpreter. To refractor it he printed out all the code, took it to a cabin for a week

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Gavin Sinclair
"head -1" may be better than "cat". It titles each file. On 12/02/2010, at 3:13 PM, Matthew Winter wrote: Hi, When picking up an existing project, I find it so much easier to be able to print the source and work through the paper output. Taking notes etc. Guess this could be someth

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Clifford Heath
On 12/02/2010, at 3:13 PM, Matthew Winter wrote: I guess resorting to unix commands will be the only option. Just figured that someone in the Rails community had probably already wrapped this into some elegant alternative. It's never elegant to gratuitously kill trees. Get a big screen and p

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Jonathan Clarke
Best way to get to know the project is through the tests...read and understand every one of them and mastery shall be yours... There are tests right? Jonathan On 12 February 2010 15:13, Matthew Winter wrote: > Hi, > When picking up an existing project, I find it so much easier to be able to > p

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Jonathan Clarke
Insert your swearword of choice below: find . | grep .rb | xargs cat | grep shit vendor/gems/cucumber-rails-0.2.4/spec/cucumber/web/tableish_spec.rb it "should do complex shit" do My lulz for the day On 12 February 2010 15:03, Grant Bissett wrote: > point the command at a rails project

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
Hi, When picking up an existing project, I find it so much easier to be able to print the source and work through the paper output. Taking notes etc. Guess this could be something for the iPad to do. I guess resorting to unix commands will be the only option. Just figured that someone in the R

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Grant Bissett
point the command at a rails project and for it to automatically *concatenate* all source code use concatenate! find . | grep .rb | xargs cat yes? -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Glen Maddern
It's the 'Filing Cabinet' approach to source control, perhaps? -glen. On Fri, Feb 12, 2010 at 2:52 PM, Anthony Richardson < goo...@anthonyrichardson.com> wrote: > I don't know the answer sorry but the mind boggles as to why anyone > would want to do that? > > Cheers, > > Anthony > > > > On

Re: [rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Anthony Richardson
I don't know the answer sorry but the mind boggles as to why anyone would want to do that? Cheers, Anthony On Fri, Feb 12, 2010 at 1:33 PM, Matthew Winter wrote: > Hi, > > I was wondering if anyone knows of a good method of being able to print all > source code within a Rails project, ide

[rails-oceania] Printing Ruby on Rails Source Code

2010-02-11 Thread Matthew Winter
Hi, I was wondering if anyone knows of a good method of being able to print all source code within a Rails project, ideally with a single command. I have seen many methods of printing Ruby code, but nothing that would allow me to point the command at a rails project and for it to automatically