mark_version 0.5.0 → 0.6.0
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.
- checksums.yaml +4 -4
- data/README.md +160 -2
- data/lib/mark_version/mark_version_config.rb +13 -2
- data/mark_version.gemspec +1 -1
- metadata +1 -2
- data/.mark_version/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f7ed1a235a8fc32b458945a94600bbf9512b7fc
|
4
|
+
data.tar.gz: c0c8e21b6d67df79566fb627b17a1f7ceeecfaa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0be1fe2cd0428f5805d2a8d6579afc37033a9066d5c0409de2c1147f730c7cf25ba1f28deb129c0dbc71bc2f319c221ae1357359ce564c1f8f8845efcc55e06
|
7
|
+
data.tar.gz: b2ee350a7b2e45c4bc3e844cc45fcefcd52be24817e30a6af4685fcf39b650d04bfdd4bdd7632ba41743fa90e55f62b80ce6fb7e583b0a043c469aa7a50a9fdb
|
data/README.md
CHANGED
@@ -1,2 +1,160 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# Mark Version
|
2
|
+
|
3
|
+
**A simple version tracking tool for the modern development workflow.**
|
4
|
+
|
5
|
+
Mark version was created to help track the version of ruby projects. It can be included as a gem with a command line interface to change the version of your project, provides classes for accessing the version information in project, integrates seamlessly with GIT and works in a complex development workflow.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
To install add the following to your Gemfile:
|
10
|
+
|
11
|
+
```
|
12
|
+
gem 'mark_version'
|
13
|
+
```
|
14
|
+
|
15
|
+
Or install manually:
|
16
|
+
|
17
|
+
```
|
18
|
+
gem install 'mark_version'
|
19
|
+
```
|
20
|
+
|
21
|
+
This will install the *version* binary. Once installed, the next thing you'll need to do is initialize your project. You can do this by running:
|
22
|
+
|
23
|
+
## Setup
|
24
|
+
|
25
|
+
```
|
26
|
+
version init
|
27
|
+
```
|
28
|
+
|
29
|
+
This will create a few config files, as well as the VERSION file. It is recommended that you add .mark_version/LOCAL_CONFIG to your .gitignore file and add commit the other files to source code control. Configuration options will be explored later in this README.
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
Mark version is based on the semantic versioning standard. For more information on semantic versioning see http://semver.org.
|
34
|
+
|
35
|
+
### Basic Usage
|
36
|
+
|
37
|
+
Mark version comes with a built in binary for managing and viewing your application version. Here is the output of version -h:
|
38
|
+
|
39
|
+
```
|
40
|
+
Commands:
|
41
|
+
version help [COMMAND] # Describe available commands or one specific command
|
42
|
+
version increment_release_candidate # increments the current release candidate (n.n.n-RCX)
|
43
|
+
version init # initialize the project to start tracking it's version
|
44
|
+
version major # create a new major-level (X.n.n) release
|
45
|
+
version major_release_candidate # create a new major-level (X.n.n-RC1) release candidate
|
46
|
+
version minor # create a new minor-level (n.X.n) release
|
47
|
+
version minor_release_candidate # create a new minor-level (n.X.n-RC1) release candidate
|
48
|
+
version patch # create a new patch-level (n.n.X) release
|
49
|
+
version release # releases the current release candidate (n.n.n)
|
50
|
+
version show # print the current version level from the VERSION file
|
51
|
+
```
|
52
|
+
|
53
|
+
The three most basic commands for version management are:
|
54
|
+
|
55
|
+
```
|
56
|
+
version patch
|
57
|
+
```
|
58
|
+
Which increases the patch version of your project.
|
59
|
+
|
60
|
+
```
|
61
|
+
version minor
|
62
|
+
```
|
63
|
+
Which increases the minor version of your project, while resetting the patch version.
|
64
|
+
|
65
|
+
```
|
66
|
+
version major
|
67
|
+
```
|
68
|
+
Which increases the major version of your project, while resetting the minor and patch versions.
|
69
|
+
|
70
|
+
At any time, you can check the current version of your project by running:
|
71
|
+
```
|
72
|
+
version show
|
73
|
+
```
|
74
|
+
|
75
|
+
### Advanced Usage
|
76
|
+
|
77
|
+
If your development workflow involves the use of release candidates, mark version will be your friend. To create a new release candidate you can either run:
|
78
|
+
|
79
|
+
```
|
80
|
+
version minor_release_candidate
|
81
|
+
```
|
82
|
+
|
83
|
+
which will result in something like version "1.1.0-RC1"
|
84
|
+
|
85
|
+
OR
|
86
|
+
|
87
|
+
```
|
88
|
+
version major_release_candidate
|
89
|
+
```
|
90
|
+
|
91
|
+
which will result in something like version "2.0.0-RC1".
|
92
|
+
|
93
|
+
While your project is a release candidate you can run:
|
94
|
+
|
95
|
+
```
|
96
|
+
version increment_relese_candidate
|
97
|
+
```
|
98
|
+
|
99
|
+
which will result in something like this: "2.0.0-RC2".
|
100
|
+
|
101
|
+
You can release your release candidate by running:
|
102
|
+
|
103
|
+
```
|
104
|
+
version release
|
105
|
+
````
|
106
|
+
|
107
|
+
**NOTE: Mark Version automatically creates tags, but it is up to you to push these tags to your github repository.**
|
108
|
+
|
109
|
+
### Usage In Code
|
110
|
+
|
111
|
+
Mark Version is made to be used on the command line, and in your application code. One common use case is to print the version of your application to end users. In Rails you could do something like this:
|
112
|
+
|
113
|
+
```
|
114
|
+
<%= VersionFile.new.version %>
|
115
|
+
```
|
116
|
+
|
117
|
+
Or, for your development environment you could do something like this:
|
118
|
+
|
119
|
+
```
|
120
|
+
<% if Rails.env.development? %>
|
121
|
+
<%= VersionFile.new.dev_version %>
|
122
|
+
<% end %>
|
123
|
+
```
|
124
|
+
|
125
|
+
The difference here is that dev_version will show you how many commits ahead of the last release the application is at, and, if you have release branches configured, it will point out when you are off of your release branch.
|
126
|
+
|
127
|
+
## Configuration
|
128
|
+
|
129
|
+
Mark Version installs two config files on initialization:
|
130
|
+
|
131
|
+
* .mark_version/CONFIG
|
132
|
+
* .mark_version/LOCAL_CONFIG
|
133
|
+
|
134
|
+
As mentioned before, it is recommended that you add .mark_version/LOCAL_CONFIG to your .gitignore list and commit .mark_version/CONFIG to source code control.
|
135
|
+
|
136
|
+
**Both config files use a JSON format.**
|
137
|
+
|
138
|
+
### Project Config
|
139
|
+
|
140
|
+
Project config is where you can specify your release branches. The default project config looks like this:
|
141
|
+
|
142
|
+
```
|
143
|
+
{
|
144
|
+
"release_branches": ["master"]
|
145
|
+
}
|
146
|
+
```
|
147
|
+
|
148
|
+
You can add or remove release branches here depending on the needs of your project.
|
149
|
+
|
150
|
+
### Local Config
|
151
|
+
|
152
|
+
Local config allows for a options that each project team member can configure for their personal workflow. An example config file with all options included is shown below:
|
153
|
+
|
154
|
+
```
|
155
|
+
{
|
156
|
+
"auto_push": true
|
157
|
+
}
|
158
|
+
```
|
159
|
+
|
160
|
+
With auto push on, tags created on new versions are pushed automatically.
|
@@ -9,10 +9,21 @@ class MarkVersionConfig
|
|
9
9
|
|
10
10
|
def init
|
11
11
|
f1 = open(project_config_file, 'w')
|
12
|
-
f1.puts(
|
12
|
+
f1.puts(<<CONF
|
13
|
+
{
|
14
|
+
"release_branches": ["master"]
|
15
|
+
}
|
16
|
+
CONF
|
17
|
+
)
|
18
|
+
|
13
19
|
f1.close
|
14
20
|
f2 = open(local_config_file, 'w')
|
15
|
-
f2.puts(
|
21
|
+
f2.puts(<<CONF
|
22
|
+
{
|
23
|
+
"auto_push": false
|
24
|
+
}
|
25
|
+
CONF
|
26
|
+
)
|
16
27
|
f2.close
|
17
28
|
end
|
18
29
|
|
data/mark_version.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mark_version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grayden Smith
|
@@ -60,7 +60,6 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".mark_version/VERSION"
|
64
63
|
- ".rspec"
|
65
64
|
- LICENSE
|
66
65
|
- README.md
|
data/.mark_version/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.0
|