git_version 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in git_version.gemspec
4
+ gemspec
data/README ADDED
@@ -0,0 +1,19 @@
1
+ == GitVersion
2
+
3
+ Simple rails engine gem that provides a quick and easy way to check which commit version your server is running.
4
+
5
+ It essentially just serves up the last line of your .git/logs/HEAD when you point to #{ROOT_URL}/git_version
6
+
7
+ == Installing
8
+
9
+ Add the following line to your Gemfile:
10
+
11
+ gem 'git_version'
12
+
13
+ Then run the command:
14
+
15
+ bundle install
16
+
17
+ Add the following line to your routes.rb file:
18
+
19
+ mount GitVersion::Engine => "/git_version"
@@ -0,0 +1,3 @@
1
+ class GitVersion::ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,5 @@
1
+ class GitVersion::VersionsController < ApplicationController
2
+ def show
3
+ render :text => "#{IO.readlines(".git/logs/HEAD")[-1]}"
4
+ end
5
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ GitVersion::Engine.routes.draw do
2
+ root :to => 'versions#show'
3
+ end
data/config.ru ADDED
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run GitVersion::Application
@@ -0,0 +1,7 @@
1
+ require 'rails'
2
+
3
+ module GitVersion
4
+ class Engine < Rails::Engine
5
+ isolate_namespace GitVersion
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module GitVersion
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,6 @@
1
+ require "git_version/engine"
2
+ require "git_version/version"
3
+
4
+ module GitVersion
5
+ # Your code goes here...
6
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git_version
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Gary Haran
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-12-30 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rails
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: Simple rails engine to show the git commit version number installed
35
+ email:
36
+ - gary.haran@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - README
45
+ - Gemfile
46
+ - app/controllers/git_version/application_controller.rb
47
+ - app/controllers/git_version/versions_controller.rb
48
+ - config/routes.rb
49
+ - config.ru
50
+ - lib/git_version/engine.rb
51
+ - lib/git_version/version.rb
52
+ - lib/git_version.rb
53
+ homepage: ""
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options: []
58
+
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 3
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project: git_version
82
+ rubygems_version: 1.8.11
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: Rails engine that shows the git commit version number installed in ROOT_URL/git_version
86
+ test_files: []
87
+