Michael Schuerig wrote:
> On Tuesday 10 August 2010, Marnen Laibow-Koser wrote:
>> Then, instead of a meta tag, why not just put it in a hidden (or
>> smallish) div in the HTML?
>
> Why? I don't see what I would gain.
If it's not hidden, the user can actually *see* the build number rather
than having to send you the HTML source. (This is the approach we use
here at work.)
Besides, <meta name="version"> is meant for the version of the
*document*, not the version of the *application* that built it, isn't
it?
> I may need to mention that I'm not
> actually overwriting a file. The partial containing the explicit call to
> git is contained in an engine common to several applications. The
> partial I write that's containing the deployed version is in the app
> itself and therefore earlier in the path.
But you *are* overwriting a file. Your initial post with your Cap
recipe says that you're doing just that.
>
>> And I think Parker may have the right idea. It seems reasonable to
>> read this from a VERSION file that's updated by Git or Cap.
>
> That doesn't explain why that approach is better than what I'm currently
> doing. Yes, it does seem reasonable, but is my current approach
> unreasonable?
>
I think it is. It seems extremely hackish. The build number is an
application-wide constant, so it should be defined as a Ruby constant
(so that the app can be aware of it) instead of just hacked into an ERb
partial.
In other words, the same code that now writes <meta name="version"
content="#{tag}"> in your partial should probably be changed to write
VERSION=#{tag} in some initializer file. Then the partial can just read
VERSION -- and so can anything else that needs to know the build number.
> Michael
>
> --
> Michael Schuerig
> mailto:[email protected]
> http://www.schuerig.de/michael/
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
Posted via http://www.ruby-forum.com/.
--
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.