buildar 3.0.0.1 → 3.0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +96 -69
- data/VERSION +1 -1
- data/lib/buildar.rb +1 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a290c0a56acbb29c1c8afc792b47eca64966a483
|
4
|
+
data.tar.gz: 76fa4de94bf9708fbfb94a737965590f480235fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddd306d90efb9e04b610db960f3ca9aea44b07bb70be7af4df3b0966d4109ee39344cf9f309feb03764c82ed8ea983fce44ce8a471322c82c0a60e2394e69a94
|
7
|
+
data.tar.gz: d99d227d9e0f66c5b236c1febbd6b124921618bd7f615588056a68735b31151b6ba6e61f39dea7e2036da8de74c7a73efa921dccf2c24a0c052689f227a10fe3
|
data/README.md
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
[![Dependency Status](https://gemnasium.com/rickhull/buildar.svg)](https://gemnasium.com/rickhull/buildar)
|
3
3
|
[![Security Status](https://hakiri.io/github/rickhull/buildar/master.svg)](https://hakiri.io/github/rickhull/buildar/master/shield)
|
4
4
|
|
5
|
-
Buildar
|
6
|
-
|
5
|
+
# Buildar
|
6
|
+
|
7
7
|
Buildar provides a set of rake tasks to help automate releasing your gem:
|
8
8
|
* Versioning
|
9
9
|
* Building / Packaging
|
@@ -11,45 +11,49 @@ Buildar provides a set of rake tasks to help automate releasing your gem:
|
|
11
11
|
|
12
12
|
With a set of options to integrate with your current project.
|
13
13
|
|
14
|
-
Rake tasks
|
15
|
-
|
16
|
-
Core
|
17
|
-
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
*
|
27
|
-
*
|
28
|
-
*
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
*
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
*
|
40
|
-
*
|
41
|
-
*
|
14
|
+
## Rake tasks
|
15
|
+
|
16
|
+
### Core
|
17
|
+
|
18
|
+
* **`release`** - *`build`*, *`publish`*, *`tag`*
|
19
|
+
* **`build`** - *`prebuild`*, `gem build`
|
20
|
+
* **`gem_package`** - *`pre_build`*, build with `Gem::PackageTask`
|
21
|
+
* **`publish`** - *`built`*, `gem push`
|
22
|
+
* **`buildar`** - config check
|
23
|
+
|
24
|
+
### Aux
|
25
|
+
|
26
|
+
* **`pre_build`** - invoke *`test`* and *`bump:build`* conditionally
|
27
|
+
* **`built`** - invoke *`build`* conditionally
|
28
|
+
* **`install`** - *`built`*, `gem install`
|
29
|
+
* **`install_new`** - *`build`*, `gem install`
|
30
|
+
* **`version`** - show the current project version
|
31
|
+
|
32
|
+
### With git integration
|
33
|
+
|
34
|
+
* **`tag`** - *`message`*, `git tag` current version, `git push` to origin
|
35
|
+
* **`message`** - capture a message from `ENV['message']` or prompt STDIN
|
36
|
+
|
37
|
+
### With version file integration
|
38
|
+
|
39
|
+
* **`bump:build`** - increment the 4th version number (1.2.3.4 -> 1.2.3.5)
|
40
|
+
* **`bump:patch`** - increment the 3rd version number (1.2.3.4 -> 1.2.4.0)
|
41
|
+
* **`bump:minor`** - increment the 2nd version number (1.2.3.4 -> 1.3.0.0)
|
42
|
+
* **`bump:major`** - increment the 1st version number (1.2.3.4 -> 2.0.0.0)
|
43
|
+
* **`release:patch`** - *`bump:patch`*, *`release`*
|
44
|
+
* **`release:minor`** - *`bump:minor`*, *`release`*
|
45
|
+
* **`release:major`** - *`bump:major`*, *`release`*
|
42
46
|
|
43
47
|
[Just show me the tasks](https://github.com/rickhull/buildar/blob/master/lib/buildar.rb#L73)
|
44
48
|
|
45
|
-
Install
|
46
|
-
|
49
|
+
## Install
|
50
|
+
|
47
51
|
```shell
|
48
52
|
$ gem install buildar # sudo as necessary
|
49
53
|
```
|
50
54
|
|
51
|
-
Usage
|
52
|
-
|
55
|
+
## Usage
|
56
|
+
|
53
57
|
Edit your Rakefile. Add to the top:
|
54
58
|
|
55
59
|
```ruby
|
@@ -60,10 +64,15 @@ Buildar.new do |b|
|
|
60
64
|
end
|
61
65
|
```
|
62
66
|
|
63
|
-
That is basically the minimal Rakefile needed for Buildar to operate, assuming
|
67
|
+
That is basically the minimal Rakefile needed for Buildar to operate, assuming
|
68
|
+
you have a valid gemspec file named `example.gemspec`.
|
69
|
+
|
70
|
+
|
71
|
+
Let's try a Buildar task, **`release`**:
|
64
72
|
|
65
73
|
```
|
66
74
|
$ rake release
|
75
|
+
|
67
76
|
gem build example.gemspec
|
68
77
|
WARNING: no email specified
|
69
78
|
Successfully built RubyGem
|
@@ -76,8 +85,8 @@ Pushing gem to https://rubygems.org...
|
|
76
85
|
Successfully registered gem: example (1.2.3)
|
77
86
|
```
|
78
87
|
|
79
|
-
Without a gemspec file
|
80
|
-
|
88
|
+
### Without a gemspec file
|
89
|
+
|
81
90
|
```ruby
|
82
91
|
Buildar.new do |b|
|
83
92
|
b.gemspec.name = 'example'
|
@@ -92,24 +101,30 @@ end
|
|
92
101
|
|
93
102
|
From [examples/no_gemspec_file.rb](https://github.com/rickhull/buildar/blob/master/examples/no_gemspec_file.rb)
|
94
103
|
|
95
|
-
Dogfood
|
96
|
-
|
104
|
+
### Dogfood
|
105
|
+
|
97
106
|
Here is Buildar's [Rakefile](https://github.com/rickhull/buildar/blob/master/Rakefile):
|
98
107
|
|
99
108
|
```ruby
|
100
|
-
|
109
|
+
begin
|
110
|
+
require 'buildar'
|
101
111
|
|
102
|
-
Buildar.new do |b|
|
103
|
-
|
104
|
-
|
105
|
-
|
112
|
+
Buildar.new do |b|
|
113
|
+
b.gemspec_file = 'buildar.gemspec'
|
114
|
+
b.version_file = 'VERSION'
|
115
|
+
b.use_git = true
|
116
|
+
end
|
117
|
+
|
118
|
+
rescue LoadError => e
|
119
|
+
warn "buildar failed to load: #{e}"
|
106
120
|
end
|
107
121
|
```
|
108
122
|
|
109
|
-
|
123
|
+
Let's try **`release:patch`**, this time with `b.version_file` and `b.use_git`:
|
110
124
|
|
111
125
|
```
|
112
126
|
$ rake release:patch message="added version task; demonstrating Usage"
|
127
|
+
|
113
128
|
bumping 2.0.0.9 to 2.0.1.0
|
114
129
|
git commit VERSION -m "Buildar version:bump_patch to 2.0.1.0"
|
115
130
|
[master 5df1ff8] Buildar version:bump_patch to 2.0.1.0
|
@@ -134,28 +149,39 @@ To https://github.com/rickhull/buildar.git
|
|
134
149
|
* [new tag] v2.0.1.1 -> v2.0.1.1
|
135
150
|
```
|
136
151
|
|
137
|
-
Use a VERSION file
|
138
|
-
|
152
|
+
### Use a VERSION file
|
153
|
+
|
139
154
|
* Buildar can manage your version numbers with `b.version_file`
|
140
|
-
* The version only matters in the context of a release. For internal
|
141
|
-
|
155
|
+
* The version only matters in the context of a release. For internal
|
156
|
+
development, git SHAs vastly outclass version numbers.
|
157
|
+
* "The right version number" for the next release is a function of the current
|
158
|
+
release version and the magnitude (or breakiness) of the change
|
142
159
|
* http://guides.rubygems.org/patterns/#semantic-versioning
|
143
160
|
* http://semver.org/
|
144
161
|
* Automate everything
|
145
162
|
|
146
163
|
The [VERSION](https://github.com/rickhull/buildar/blob/master/VERSION) file at your project root should look something like
|
164
|
+
|
147
165
|
```
|
148
166
|
1.2.3.4
|
149
167
|
```
|
150
168
|
|
151
|
-
Buildar will be able to
|
169
|
+
Buildar will be able to **`bump:major`**, **`bump:minor`**, **`bump:patch`**,
|
170
|
+
and **`bump:build`**. This helps with a repeatable, identifiable builds:
|
171
|
+
**`build`** invokes **`bump:build`** etc.
|
152
172
|
|
153
|
-
Every build bumps the build number. Since the build operates off of your
|
173
|
+
Every build bumps the build number. Since the build operates off of your
|
174
|
+
potentially dirty working copy, and not some commit SHA, there is no guarantee
|
175
|
+
that things haven't changed between builds, even if "nothing is supposed to
|
176
|
+
have changed". This guarantees that you can't have 2 builds floating around
|
177
|
+
with the same version number but different contents.
|
154
178
|
|
155
|
-
Typically you'll want to let Buildar manage the build number, and you manage
|
156
|
-
|
157
|
-
|
158
|
-
*
|
179
|
+
Typically you'll want to let Buildar manage the build number, and you manage
|
180
|
+
the major, minor, and patch numbers with:
|
181
|
+
|
182
|
+
* **`release:major`** - *`bump:major`*
|
183
|
+
* **`release:minor`** - *`bump:minor`*
|
184
|
+
* **`release:patch`** - *`bump:patch`*
|
159
185
|
|
160
186
|
To make your app or lib aware of its version via this file, simply:
|
161
187
|
|
@@ -165,15 +191,16 @@ To make your app or lib aware of its version via this file, simply:
|
|
165
191
|
module Foo
|
166
192
|
def self.version
|
167
193
|
file = File.expand_path('../../VERSION', __FILE__)
|
168
|
-
|
194
|
+
File.read(file).chomp
|
169
195
|
end
|
170
196
|
end
|
171
197
|
```
|
172
198
|
|
173
|
-
`b.version_file` defaults to nil, so if you don't set it, you'll have to keep
|
199
|
+
`b.version_file` defaults to nil, so if you don't set it, you'll have to keep
|
200
|
+
your gemspec's version attribute updated.
|
201
|
+
|
202
|
+
### Gemspec file tricks
|
174
203
|
|
175
|
-
Gemspec file tricks
|
176
|
-
-------------------
|
177
204
|
With
|
178
205
|
```ruby
|
179
206
|
Buildar.new do |b|
|
@@ -181,18 +208,18 @@ Buildar.new do |b|
|
|
181
208
|
b.version_file = 'VERSION'
|
182
209
|
```
|
183
210
|
|
184
|
-
You'll need to keep your gemspec file in synch with
|
211
|
+
You'll need to keep your gemspec file in synch with `b.version_file`.
|
212
|
+
Here's [how Buildar does it](https://github.com/rickhull/buildar/blob/master/buildar.gemspec):
|
213
|
+
|
185
214
|
```ruby
|
186
215
|
# Gem::Specification.new do |s|
|
187
216
|
# ...
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
manifest_file = File.join(this_dir, 'MANIFEST.txt')
|
192
|
-
|
193
|
-
# dynamic assignments
|
194
|
-
s.version = File.read(version_file).chomp
|
195
|
-
s.files = File.readlines(manifest_file).map { |f| f.chomp }
|
217
|
+
s.version = File.read(File.join(__dir__, 'VERSION')).chomp
|
218
|
+
s.files =
|
219
|
+
File.readlines(File.join(__dir__, 'MANIFEST.txt')).map { |f| f.chomp }
|
196
220
|
```
|
197
221
|
|
198
|
-
|
222
|
+
Buildar maintains a
|
223
|
+
[MANIFEST.txt](https://github.com/rickhull/buildar/blob/master/MANIFEST.txt)
|
224
|
+
-- the canonical list of files belonging to the project --
|
225
|
+
outside of the gemspec.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.0.
|
1
|
+
3.0.0.2
|
data/lib/buildar.rb
CHANGED