app_version 0.1.1 → 0.1.5
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/{README.rdoc → README.md} +35 -31
- data/lib/install.rb +2 -2
- data/lib/tasks/app_version_tasks.rake +2 -2
- data/lib/uninstall.rb +4 -4
- metadata +2 -2
data/{README.rdoc → README.md}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
## App Version
|
2
2
|
|
3
3
|
This is a simple plugin that makes it easy to manage the version number of your
|
4
4
|
Rails application. The version numbers supported by this plugin look like
|
@@ -6,37 +6,39 @@ Rails application. The version numbers supported by this plugin look like
|
|
6
6
|
|
7
7
|
The components of the version number are:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
2 => major
|
10
|
+
0 => minor
|
11
|
+
1 => patch
|
12
|
+
M4 => milestone
|
13
|
+
(600) => build number (usually Subversion revision)
|
14
|
+
branch => the name of the branch this version is from.
|
15
|
+
coder => the name of the user that made the release
|
16
|
+
2008-10-27 => the date of the release
|
17
17
|
|
18
18
|
Only the major and minor numbers are required. The rest can be omitted and the
|
19
19
|
plugin will attempt to do the right thing.
|
20
20
|
|
21
|
-
|
21
|
+
### Install
|
22
22
|
|
23
|
-
To install
|
23
|
+
To install include in your Gemfile and execute bundler install
|
24
24
|
|
25
|
-
|
25
|
+
gem 'app_version'
|
26
|
+
|
27
|
+
Will then have the rake tasks below available.
|
26
28
|
|
27
29
|
== Usage
|
28
30
|
|
29
31
|
To use, simply place a file in RAILS_ROOT/config called version.yml with the
|
30
32
|
following format:
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
major: 2
|
35
|
+
minor: 0
|
36
|
+
patch: 1
|
37
|
+
milestone: 4
|
38
|
+
build: git-revcount
|
39
|
+
branch: master
|
40
|
+
committer: coder
|
41
|
+
build_date: 2008-10-27
|
40
42
|
|
41
43
|
If the milestone or patch fields are less than 0 then they will not show up
|
42
44
|
in the version string. The build field can be a build number or one of the
|
@@ -59,7 +61,7 @@ properly formatted version number. APP_VERSION also has +major+, +minor+,
|
|
59
61
|
+patch+, +milestone+, +build+, +branch+, +committer+, and +build_date+
|
60
62
|
methods to retrieve the individual components of the version number.
|
61
63
|
|
62
|
-
|
64
|
+
### Capistrano Usage
|
63
65
|
|
64
66
|
When the app_version plugin is installed, it copies a templated edition of the
|
65
67
|
version.yml file into /lib/templates/version.yml.erb, the initial file shows a
|
@@ -75,23 +77,25 @@ Both the standard and extended capistrano usage can co-exist in the same project
|
|
75
77
|
the dynamic rendering of the version.yml only happens when using capistrano to
|
76
78
|
deploy your app.
|
77
79
|
|
78
|
-
|
80
|
+
**Not Confirmed working in this version**
|
81
|
+
|
82
|
+
### Rake tasks
|
79
83
|
|
80
84
|
This plugin includes 4 new rake tasks:
|
81
85
|
|
82
|
-
rake app:install - will copy the version.yml and version.yml.erb into more user
|
83
|
-
|
86
|
+
rake app:install - will copy the version.yml and version.yml.erb into more user
|
87
|
+
accessible locations (/config, and /lib/templates)
|
84
88
|
|
85
|
-
rake app:uninstall - will remove the files copied in the install task
|
89
|
+
rake app:uninstall - will remove the files copied in the install task
|
86
90
|
|
87
|
-
rake app:render - will render the erb template into /config/version.yml
|
88
|
-
|
89
|
-
|
91
|
+
rake app:render - will render the erb template into /config/version.yml
|
92
|
+
in case you want to have dynamic values updated via a rake task.
|
93
|
+
Note: certain examples expect the app to be in a git working directory.
|
90
94
|
|
91
|
-
rake app:version - will output the version number of the current rails
|
92
|
-
|
95
|
+
rake app:version - will output the version number of the current rails
|
96
|
+
application.
|
93
97
|
|
94
|
-
|
98
|
+
## License
|
95
99
|
|
96
100
|
This plugin is released under the terms of the Ruby license. See
|
97
101
|
http://www.ruby-lang.org/en/LICENSE.txt.
|
data/lib/install.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# copy the version.yml.erb to some user editable location for example, in lib
|
2
2
|
|
3
3
|
targetTemplateDir = File.join(Rails.root.to_s, 'lib/templates')
|
4
|
-
sourceTemplateFile = File.join(File.dirname(__FILE__), '
|
4
|
+
sourceTemplateFile = File.join(File.dirname(__FILE__), 'app_version/templates/version.yml.erb')
|
5
5
|
|
6
|
-
sourceSampleFile = File.join(File.dirname(__FILE__), '
|
6
|
+
sourceSampleFile = File.join(File.dirname(__FILE__), 'app_version/templates/version.yml')
|
7
7
|
targetSampleDir = File.join(Rails.root.to_s, '/config')
|
8
8
|
|
9
9
|
FileUtils.mkdir( targetTemplateDir, :verbose => true) unless File.exists?(targetTemplateDir)
|
@@ -9,12 +9,12 @@ namespace :app do
|
|
9
9
|
|
10
10
|
desc 'Configure for initial install.'
|
11
11
|
task :install do
|
12
|
-
require File.join(File.dirname(__FILE__), "
|
12
|
+
require File.join(File.dirname(__FILE__), "../install.rb")
|
13
13
|
end
|
14
14
|
|
15
15
|
desc 'Clean up prior to removal.'
|
16
16
|
task :uninstall do
|
17
|
-
require File.join(File.dirname(__FILE__), "
|
17
|
+
require File.join(File.dirname(__FILE__), "../uninstall.rb")
|
18
18
|
end
|
19
19
|
|
20
20
|
desc 'Render the version.yml from its template.'
|
data/lib/uninstall.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
targetTemplateDir = File.join(
|
1
|
+
targetTemplateDir = File.join(Rails.root.to_s, 'lib/templates')
|
2
2
|
|
3
|
-
targetTemplateFile = File.join(
|
4
|
-
targetConfigSampleFile = File.join(
|
5
|
-
targetTemplateSampleFile = File.join(
|
3
|
+
targetTemplateFile = File.join(Rails.root.to_s, 'lib/templates/version.yml.erb')
|
4
|
+
targetConfigSampleFile = File.join(Rails.root.to_s, '/config/version.yml')
|
5
|
+
targetTemplateSampleFile = File.join(Rails.root.to_s, 'lib/templates/version.yml')
|
6
6
|
|
7
7
|
if File.exist?(targetTemplateFile) then FileUtils.rm( targetTemplateFile, :verbose => true) end
|
8
8
|
if File.exist?(targetConfigSampleFile) then FileUtils.rm( targetConfigSampleFile, :verbose => true) end
|
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.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -45,7 +45,7 @@ files:
|
|
45
45
|
- lib/tasks/app_version_tasks.rake
|
46
46
|
- lib/uninstall.rb
|
47
47
|
- Rakefile
|
48
|
-
- README.
|
48
|
+
- README.md
|
49
49
|
- test/app_version_test.rb
|
50
50
|
- test/version.yml
|
51
51
|
homepage: ''
|