On Tuesday 10 August 2010, Marnen Laibow-Koser wrote:
> Michael Schuerig wrote:
> [...]
> > Trust me, I'm not overwriting anything. Yes, I wrote so originally,
> > but that was only for easier explanation. When I had to go into
> > the details, I clarified that I'm not overwriting, but rather
> > overriding.
>
> What's the difference? What are you *actually* doing? Your Cap
> recipe that you posted pretty clearly overwrites a file. Is that
> not your actual recipe?
I would be overwriting a file if there was one to begin with. There
isn't one.
> > Here are the desiderata:
> >
> > * The shown version has to be current, not just the last commit.
>
> What do you mean? The version *is* the last commit, unless I totally
> misunderstand.
>
> > * In production, no VERSION file is re-read for each request.
No, in development the version is *not* the last commit, but what
happens to be in my directory. I want that to be reflected in the
version.
> > During deployment
> > * The version is frozen to the deployed tag.
> > * No markup is written.
> > * No file is overwritten.
> >
> > Capistrano already writes a REVISION file containing the commit
> > sha1. Let's assume there's a TAG file, too. Then an initializer
> > like this would do the job
> >
> > if Rails.env.production?
> >
> > version = File.read('TAG').strip
> >
> > else
> >
> > version = `git describe --tags --always --dirty`.chomp
> >
> > end
> > Rails.application.config.version = version
>
> This looks to me like just about exactly what I have been suggesting.
> Why do you like this and not my suggestions? What are the
> differences as you see them?
I don't need a commit hook and I get a dirty indication in development.
Something like "60a5c37-dirty".
Michael
--
Michael Schuerig
mailto:[email protected]
http://www.schuerig.de/michael/
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.