Alex Gräfenstein
von ,

Displaying the version of your Rails app

We created a code snippet that displays the git repository, git url, last commit and author of a rails application.

During development it is helpful to see the version of an application that is currently on stage or in production. With the following code you get all that inside a handy method.

Put it somwhere in your lib folder where rails is able to locate and load it. The script extends the ActionController::Base and ActionView::Base classes about the methods git_info and git_info_text. The latter may be used to render the information inside a template. So using

= git_info_text.html_safe

will print the following information

  • Url of the used repository
  • Current deployed branch
  • Info about last commit including author, date and message
  • Aplication and environment names

Now you always know who pushed the latest bug, enjoy.

Themen

Letzte Artikel

G|Predictive Unternehmenswebseite

empuxa wird zwei Jahre alt!

c2dm-rails gem released

empuxa im K24

Snaptury-App

Cronjobber gem released

empuxa wünscht ein frohes Fest

ClipFlip-Android-App veröffentlicht!

HANSA-PARK: Ticket-Vorverkauf relaunched!

empuxa nun auch mobil verfügbar

Archiv