[Yesod] Is there a api which get yesod version?

hi, i'd like to display like as "powered by Yesod ver 0.6.7" on footer of my application. Is there an api?

It wouldn't be pretty, at all, but you might be able to throw something together with the cabal CPP macros that cabal will generate here: dist/build/autogen/cabal_macros.h max On Dec 20, 2010, at 1:28 PM, いとうかつとし wrote:
hi,
i'd like to display like as "powered by Yesod ver 0.6.7" on footer of my application. Is there an api?
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

I'm surprised there isn't some kind of cabal CPP macro automatically
included which has the version.
As far as the original question: I'd be wary of adding a function with
the Yesod version number, because I can almost guarantee that I will
forget to update the string when I release new versions ;).
Michael
2010/12/20 Max Cantor
It wouldn't be pretty, at all, but you might be able to throw something together with the cabal CPP macros that cabal will generate here: dist/build/autogen/cabal_macros.h
max
On Dec 20, 2010, at 1:28 PM, いとうかつとし wrote:
hi,
i'd like to display like as "powered by Yesod ver 0.6.7" on footer of my application. Is there an api?
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

Hi,
Can't you use cabal's version field? Cabal will create Paths_yesod,
and include a version number which you can link to.
Thanks, Neil
2010/12/20 Michael Snoyman
I'm surprised there isn't some kind of cabal CPP macro automatically included which has the version.
As far as the original question: I'd be wary of adding a function with the Yesod version number, because I can almost guarantee that I will forget to update the string when I release new versions ;).
Michael
2010/12/20 Max Cantor
: It wouldn't be pretty, at all, but you might be able to throw something together with the cabal CPP macros that cabal will generate here: dist/build/autogen/cabal_macros.h
max
On Dec 20, 2010, at 1:28 PM, いとうかつとし wrote:
hi,
i'd like to display like as "powered by Yesod ver 0.6.7" on footer of my application. Is there an api?
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

Do you know of any prior art that does this? Having a package import
files generated by cabal seems like it could cause problems.
Michael
2010/12/21 Neil Mitchell
Hi,
Can't you use cabal's version field? Cabal will create Paths_yesod, and include a version number which you can link to.
Thanks, Neil
2010/12/20 Michael Snoyman
: I'm surprised there isn't some kind of cabal CPP macro automatically included which has the version.
As far as the original question: I'd be wary of adding a function with the Yesod version number, because I can almost guarantee that I will forget to update the string when I release new versions ;).
Michael
2010/12/20 Max Cantor
: It wouldn't be pretty, at all, but you might be able to throw something together with the cabal CPP macros that cabal will generate here: dist/build/autogen/cabal_macros.h
max
On Dec 20, 2010, at 1:28 PM, いとうかつとし wrote:
hi,
i'd like to display like as "powered by Yesod ver 0.6.7" on footer of my application. Is there an api?
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

2010/12/21 Michael Snoyman
Do you know of any prior art that does this? Having a package import files generated by cabal seems like it could cause problems.
Although Cabal's documentation only mentions 'getDataFileName' [1], the API states that the Paths module should "enable [the packages] to find their version number" [2]. So that's the intended use, even if not very well documented. Just remember to put the Paths in 'other-modules' [1]. [1] http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.ht... [2] http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution... Cheers! =) -- Felipe.
participants (5)
-
Felipe Almeida Lessa
-
Max Cantor
-
Michael Snoyman
-
Neil Mitchell
-
いとうかつとし