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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +96 -69
  3. data/VERSION +1 -1
  4. data/lib/buildar.rb +1 -2
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d66f1821b6fed8ae765cb0863bcc94d2e1d26e4f
4
- data.tar.gz: 9abd4f6724a248baf196221945d443f630aa32b7
3
+ metadata.gz: a290c0a56acbb29c1c8afc792b47eca64966a483
4
+ data.tar.gz: 76fa4de94bf9708fbfb94a737965590f480235fa
5
5
  SHA512:
6
- metadata.gz: 7b675e519283d5a47c67a87e8709961f590febc2e64dad02e4406fc3ef29413cc99ecf57e8fb09b08cc9f84b9b4579fe9ffa880fd29cec0c695c287340fbe20e
7
- data.tar.gz: 4ffdd5035cbf607a5b719e6c8f551575a5c9cf09da3892d48c0a92bcfb4e6d4c8ef5f5e6c12d90debde397b0bd5765342c7af60528c26a2e65cabae8824977bb
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
- * `release` - `build` `publish` `tag`
18
- * `build` - `pre_build` gem build a pkg/.gem
19
- * `gem_package` - `pre_build` Gem::PackageTask builds a pkg/.gem
20
- * `publish` - `built` gem push
21
- * `buildar` - config check
22
-
23
- Aux
24
- * `pre_build` - invoke `test` and `bump:build` conditionally
25
- * `built` - `build` conditionally
26
- * `install` - `built` gem install .gem
27
- * `install_new` - `build` install built .gem
28
- * `version` - show the current project version
29
-
30
- With git integration
31
- * `tag` - `message` git tag current version, push to origin
32
- * `message` - capture a message from ENV['message'] or prompt STDIN
33
-
34
- With version file integration
35
- * `bump:build` - increment the 4th version number (1.2.3.4 -> 1.2.3.5)
36
- * `bump:patch` - increment the 3rd version number (1.2.3.4 -> 1.2.4.0)
37
- * `bump:minor` - increment the 2nd version number (1.2.3.4 -> 1.3.0.0)
38
- * `bump:major` - increment the 1st version number (1.2.3.4 -> 2.0.0.0)
39
- * `release:patch` - `bump:patch` `release`
40
- * `release:minor` - `bump:minor` `release`
41
- * `release:major` - `bump:major` `release`
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 you have a valid gemspec file named `example.gemspec`.
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
- require 'buildar'
109
+ begin
110
+ require 'buildar'
101
111
 
102
- Buildar.new do |b|
103
- b.gemspec_file = 'buildar.gemspec'
104
- b.version_file = 'VERSION'
105
- b.use_git = true
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
- With `b.version_file` and `b.use_git`
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 development, git SHAs vastly outclass version numbers.
141
- * "The right version number" for the next release is a function of the current release version and the magnitude (or breakiness) of the change
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 `bump:major` `bump:minor` `bump:patch` and `bump:build`. This helps with a repeatable, identifiable builds: `build` invokes `bump:build` etc.
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 potentially dirty working copy, and not some commit SHA, there is no guarantee that things haven't changed between builds, even if "nothing is supposed to have changed". This guarantees that you can't have 2 builds floating around with the same version number but different contents.
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 the major, minor, and patch numbers with:
156
- * `release:major` - `bump:major`
157
- * `release:minor` - `bump:minor`
158
- * `release:patch` - `bump:patch`
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
- File.read(file).chomp
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 your gemspec's version attribute updated.
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 the version_file. Here's [how Buildar does it](https://github.com/rickhull/buildar/blob/master/buildar.gemspec):
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
- # dynamic setup
189
- this_dir = File.expand_path('..', __FILE__)
190
- version_file = File.join(this_dir, 'VERSION')
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
- I also like to maintain a [MANIFEST.txt](https://github.com/rickhull/buildar/blob/master/MANIFEST.txt) -- the canonical list of files belonging to the project -- outside of the gemspec.
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
1
+ 3.0.0.2
@@ -4,8 +4,7 @@ require 'rake/tasklib'
4
4
 
5
5
  class Buildar < Rake::TaskLib
6
6
  def self.version
7
- file = File.expand_path('../../VERSION', __FILE__)
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.1
4
+ version: 3.0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull