app_version 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +27 -37
- metadata +5 -4
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
## App Version
|
2
2
|
|
3
|
-
This is a simple plugin that makes it easy to manage the version number of your
|
4
|
-
Rails application. The version numbers supported by this plugin look like
|
5
|
-
'2.0.1 M4 (600) of branch by coder on 2008-10-27'.
|
3
|
+
This is a simple plugin that makes it easy to manage the version number of your Rails application. The version numbers supported by this plugin look like '2.0.1 M4 (600) of branch by coder on 2008-10-27'.
|
6
4
|
|
7
5
|
The components of the version number are:
|
8
6
|
|
@@ -15,8 +13,7 @@ The components of the version number are:
|
|
15
13
|
coder => the name of the user that made the release
|
16
14
|
2008-10-27 => the date of the release
|
17
15
|
|
18
|
-
Only the major and minor numbers are required. The rest can be omitted and the
|
19
|
-
plugin will attempt to do the right thing.
|
16
|
+
Only the major and minor numbers are required. The rest can be omitted and the plugin will attempt to do the right thing.
|
20
17
|
|
21
18
|
### Install
|
22
19
|
|
@@ -26,7 +23,19 @@ To install include in your Gemfile and execute bundler install
|
|
26
23
|
|
27
24
|
Will then have the rake tasks below available.
|
28
25
|
|
29
|
-
|
26
|
+
To include the version information into your running application create an initialiser within the config directory of the rails application that includes.
|
27
|
+
|
28
|
+
if defined?(Rails.root.to_s) && File.exists?("#{(Rails.root.to_s)}/config/version.yml")
|
29
|
+
APP_VERSION = App::Version.load "#{(Rails.root.to_s)}/config/version.yml"
|
30
|
+
end
|
31
|
+
|
32
|
+
This will load a constant called APP_VERSION That includes the version information. This can then be rendered within the application using
|
33
|
+
|
34
|
+
APP_VERSION.to_s
|
35
|
+
|
36
|
+
Use this within your application view or helper methods, more detail on other version meta data in the usage section.
|
37
|
+
|
38
|
+
### Usage
|
30
39
|
|
31
40
|
To use, simply place a file in RAILS_ROOT/config called version.yml with the
|
32
41
|
following format:
|
@@ -40,42 +49,23 @@ following format:
|
|
40
49
|
committer: coder
|
41
50
|
build_date: 2008-10-27
|
42
51
|
|
43
|
-
If the milestone or patch fields are less than 0 then they will not show up
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
Using 'svn' for the build number will cause the plugin to query Subversion for
|
53
|
-
the current revision number. Since Git doesn't have a numbered revision we have
|
54
|
-
to fake it. 'git-revcount' will count the number of commits to the repository
|
55
|
-
and use that as the build number whereas 'git-hash' will use the first 6 digits
|
56
|
-
of the current HEAD's hash.
|
57
|
-
|
58
|
-
The plugin creates a constant APP_VERSION that contains the version number of
|
59
|
-
the application. Calling the +to_s+ method on APP_VERSION will result in a
|
60
|
-
properly formatted version number. APP_VERSION also has +major+, +minor+,
|
61
|
-
+patch+, +milestone+, +build+, +branch+, +committer+, and +build_date+
|
62
|
-
methods to retrieve the individual components of the version number.
|
52
|
+
If the milestone or patch fields are less than 0 then they will not show up in the version string. The build field can be a build number or one of the following strings: svn, git-hash or git-revcount. If it is a number then that number will be used as the build number, if it is one of the special strings then the plugin will attempt to query the source control system for the build number. The build date field can be a date or the following string: git-revdate.
|
53
|
+
|
54
|
+
If you use the special string it will query the source control system and output in YYYY-MM-DD format the commit date of the last revision.
|
55
|
+
|
56
|
+
Using 'svn' for the build number will cause the plugin to query Subversion for the current revision number. Since Git doesn't have a numbered revision we have to fake it. 'git-revcount' will count the number of commits to the repository and use that as the build number whereas 'git-hash' will use the first 6 digits of the current HEAD's hash.
|
57
|
+
|
58
|
+
The plugin creates a constant `APP_VERSION` that contains the version number of the application. Calling the `to_s` method on APP_VERSION will result in a properly formatted version number.
|
59
|
+
|
60
|
+
APP_VERSION also has `major`, `minor`, `patch`, `milestone`, `build`, `branch`, `committer`, and `build_date` methods to retrieve the individual components of the version number.
|
63
61
|
|
64
62
|
### Capistrano Usage
|
65
63
|
|
66
|
-
When the app_version plugin is installed, it copies a templated edition of the
|
67
|
-
version.yml file into /lib/templates/version.yml.erb, the initial file shows a
|
68
|
-
tag for retrieving the revision count with git. It also shows displaying the
|
69
|
-
branch as specified with "set :branch" in your capistrano deploy.rb, see the
|
70
|
-
comments in the erb file for more nifty tricks.
|
64
|
+
When the app_version plugin is installed, it copies a templated edition of the version.yml file into /lib/templates/version.yml.erb, the initial file shows a tag for retrieving the revision count with git. It also shows displaying the branch as specified with "set :branch" in your capistrano deploy.rb, see the comments in the erb file for more nifty tricks.
|
71
65
|
|
72
|
-
When you do a cap deploy, there is a capistrano recipe built-in to the app_version
|
73
|
-
plugin, which will render the templated version.yml into the standard location as
|
74
|
-
mentioned above. This happens automatically after the deploy is done.
|
66
|
+
When you do a cap deploy, there is a capistrano recipe built-in to the app_version plugin, which will render the templated version.yml into the standard location as mentioned above. This happens automatically after the deploy is done.
|
75
67
|
|
76
|
-
Both the standard and extended capistrano usage can co-exist in the same project
|
77
|
-
the dynamic rendering of the version.yml only happens when using capistrano to
|
78
|
-
deploy your app.
|
68
|
+
Both the standard and extended capistrano usage can co-exist in the same project the dynamic rendering of the version.yml only happens when using capistrano to deploy your app.
|
79
69
|
|
80
70
|
**Not Confirmed working in this version**
|
81
71
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -28,7 +28,8 @@ dependencies:
|
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 3.2.8
|
31
|
-
description: App Version Gem originally App Version Rails Plugin from https://github.com/toland/app_version
|
31
|
+
description: App Version Gem originally App Version Rails Plugin from https://github.com/toland/app_version,
|
32
|
+
updated to work within Rails 3.2+ as a gem.
|
32
33
|
email:
|
33
34
|
- mort666@virus.org
|
34
35
|
- phil.toland@gmail.com
|
@@ -48,7 +49,7 @@ files:
|
|
48
49
|
- README.md
|
49
50
|
- test/app_version_test.rb
|
50
51
|
- test/version.yml
|
51
|
-
homepage:
|
52
|
+
homepage: https://github.com/mort666/app_version
|
52
53
|
licenses: []
|
53
54
|
post_install_message:
|
54
55
|
rdoc_options: []
|
@@ -71,7 +72,7 @@ rubyforge_project:
|
|
71
72
|
rubygems_version: 1.8.25
|
72
73
|
signing_key:
|
73
74
|
specification_version: 3
|
74
|
-
summary:
|
75
|
+
summary: Rails App Version Gem
|
75
76
|
test_files:
|
76
77
|
- test/app_version_test.rb
|
77
78
|
- test/version.yml
|