buildar 3.0.0.1 → 3.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +96 -69
- data/Rakefile +8 -12
- data/VERSION +1 -1
- data/buildar.gemspec +1 -2
- data/lib/buildar.rb +2 -3
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 833e11b9319991ccfebdaa2e20555b9fb4f2fdfa6bc40210897ed98282c67f40
|
4
|
+
data.tar.gz: 5527c38a72f392b139a1fa3a8cd865f541e642be6bf5feca512f593229d94d14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec66531a9d2ac8e5d0b9af9bbf8f1f3b27817c8c84af8210c049ed67f500313908cd3326555a146b8e193ddc145527a132de0062c1889cf2ffd16701573ef2be
|
7
|
+
data.tar.gz: bb1b780d9c9245cc7a5ccafb9802e539ef5e5c045e35e6463c631be477239ddd1f22c25b33ca267a710d687060842d07112c979993f1aa0c34b2b7ec8a11932a
|
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/Rakefile
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
require 'rake/testtask'
|
2
|
+
|
3
|
+
Rake::TestTask.new do |t|
|
4
|
+
t.test_files = FileList['test/**/*.rb']
|
5
|
+
end
|
6
|
+
|
7
|
+
task default: :test
|
8
|
+
|
1
9
|
begin
|
2
10
|
require 'buildar'
|
3
11
|
|
@@ -10,15 +18,3 @@ begin
|
|
10
18
|
rescue LoadError => e
|
11
19
|
warn "buildar failed to load: #{e}"
|
12
20
|
end
|
13
|
-
|
14
|
-
begin
|
15
|
-
require 'rake/testtask'
|
16
|
-
|
17
|
-
Rake::TestTask.new do |t|
|
18
|
-
t.test_files = FileList['test/**/*.rb']
|
19
|
-
end
|
20
|
-
|
21
|
-
task default: :test
|
22
|
-
rescue Exception => e
|
23
|
-
warn "rake/testtask error: #{e}"
|
24
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.2.1
|
data/buildar.gemspec
CHANGED
@@ -5,10 +5,9 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.author = 'Rick Hull'
|
6
6
|
s.homepage = 'https://github.com/rickhull/buildar'
|
7
7
|
s.license = 'MIT'
|
8
|
-
s.has_rdoc = true
|
9
8
|
s.description = 'Buildar helps automate the release process with versioning, building, packaging, and publishing. Optional git integration.'
|
10
9
|
|
11
|
-
s.required_ruby_version = "
|
10
|
+
s.required_ruby_version = ">= 2"
|
12
11
|
|
13
12
|
# dynamic assignments
|
14
13
|
s.version = File.read(File.join(__dir__, 'VERSION')).chomp
|
data/lib/buildar.rb
CHANGED
@@ -4,8 +4,7 @@ require 'rake/tasklib'
|
|
4
4
|
|
5
5
|
class Buildar < Rake::TaskLib
|
6
6
|
def self.version
|
7
|
-
|
8
|
-
File.read(file).chomp
|
7
|
+
File.read(File.join(__dir__, '..', 'VERSION')).chomp
|
9
8
|
end
|
10
9
|
|
11
10
|
# e.g. bump(:minor, '1.2.3') #=> '1.3.0'
|
@@ -160,7 +159,7 @@ EOF
|
|
160
159
|
|
161
160
|
# desc "used internally; make sure we have .gem for the current version"
|
162
161
|
task :built do
|
163
|
-
Rake::Task[:build].invoke unless File.
|
162
|
+
Rake::Task[:build].invoke unless File.exist? self.gem_file
|
164
163
|
end
|
165
164
|
|
166
165
|
desc "publish the current version to rubygems.org"
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Hull
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 1980-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Buildar helps automate the release process with versioning, building,
|
14
14
|
packaging, and publishing. Optional git integration.
|
15
|
-
email:
|
15
|
+
email:
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
@@ -27,13 +27,13 @@ homepage: https://github.com/rickhull/buildar
|
|
27
27
|
licenses:
|
28
28
|
- MIT
|
29
29
|
metadata: {}
|
30
|
-
post_install_message:
|
30
|
+
post_install_message:
|
31
31
|
rdoc_options: []
|
32
32
|
require_paths:
|
33
33
|
- lib
|
34
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- - "
|
36
|
+
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '2'
|
39
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -42,9 +42,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|
45
|
-
|
46
|
-
|
47
|
-
signing_key:
|
45
|
+
rubygems_version: 3.4.4
|
46
|
+
signing_key:
|
48
47
|
specification_version: 4
|
49
48
|
summary: Buildar adds rake tasks to assist with gem publishing
|
50
49
|
test_files: []
|