buildar 2.0.1.1 → 2.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7159f298473d67c99917653ce4f01ccebce8e974
4
+ data.tar.gz: a93ff135b37d1c84458f3181fc01f3e4c334bfbe
5
+ SHA512:
6
+ metadata.gz: a71a3632bc33993caf133f50b1a7f80b9fe27602a7f40fcdd7f6805bbb0ee16eb63f85359aedd0eea885af33b366a3476f9153f7a23ebe8e0432599941bbab52
7
+ data.tar.gz: 863ed9cbbd1a3461d41c3efec012b3911466f9054f518848367e72dc634cecb921a253c10de4a2040ec4213bdb75e187336b67dde5a9bc774bf715243f24e5b6
@@ -2,5 +2,5 @@ buildar.gemspec
2
2
  MANIFEST.txt
3
3
  VERSION
4
4
  README.md
5
- rakefile.rb
5
+ Rakefile
6
6
  lib/buildar.rb
data/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ [![Gem Version](https://badge.fury.io/rb/buildar.svg)](http://badge.fury.io/rb/buildar)
2
+ [![Dependency Status](https://gemnasium.com/rickhull/buildar.svg)](https://gemnasium.com/rickhull/buildar)
3
+ [![Security Status](https://hakiri.io/github/rickhull/buildar/master.svg)](https://hakiri.io/github/rickhull/buildar/master/shield)
4
+
1
5
  Buildar
2
6
  =======
3
7
  Buildar provides a set of rake tasks to help automate releasing your gem:
@@ -36,8 +40,6 @@ With version file integration
36
40
  * `release:minor` - `bump:minor` `release`
37
41
  * `release:major` - `bump:major` `release`
38
42
 
39
- Tasks which depend on optional functionality will not fail if the option is disabled. They are effectively skipped.
40
-
41
43
  [Just show me the tasks](https://github.com/rickhull/buildar/blob/master/lib/buildar.rb#L73)
42
44
 
43
45
  Install
@@ -51,86 +53,102 @@ Usage
51
53
  Edit your Rakefile. Add to the top:
52
54
 
53
55
  ```ruby
54
- require 'buildar/tasks'
56
+ require 'buildar'
55
57
 
56
- Buildar.conf(__FILE__) do |b|
57
- b.name = 'Example' # optional, inferred from directory
58
- # ...
59
- end
60
-
61
- # make sure you have a task named :test, even if it's empty
62
- task :test do
63
- # ...
58
+ Buildar.new do |b|
59
+ b.gemspec_file = 'example.gemspec'
64
60
  end
65
61
  ```
66
62
 
67
- That is basically the minimal Rakefile needed for Buildar to operate, assuming you have a valid gemspec file named `Example.gemspec`.
63
+ That is basically the minimal Rakefile needed for Buildar to operate, assuming you have a valid gemspec file named `example.gemspec`.
64
+
65
+ ```
66
+ $ rake release
67
+ gem build example.gemspec
68
+ WARNING: no email specified
69
+ Successfully built RubyGem
70
+ Name: example
71
+ Version: 1.2.3
72
+ File: example-1.2.3.gem
73
+ mv example-1.2.3.gem pkg/example-2.0.1.1.gem
74
+ gem push pkg/example-1.2.3.gem
75
+ Pushing gem to https://rubygems.org...
76
+ Successfully registered gem: example (1.2.3)
77
+ ```
68
78
 
69
79
  Without a gemspec file
70
80
  ----------------------
71
81
  ```ruby
72
- Buildar.conf(__FILE__) do |b|
73
- b.name = 'Example'
74
- b.use_gemspec_file = false
75
- b.use_version_file = false
76
- b.use_git = false
77
- b.publish[:rubygems] = false
78
-
82
+ Buildar.new do |b|
83
+ b.gemspec.name = 'example'
79
84
  b.gemspec.summary = 'Example of foo lorem ipsum'
80
85
  b.gemspec.author = 'Buildar'
81
86
  b.gemspec.license = 'MIT'
82
87
  b.gemspec.description = 'Foo bar baz quux'
83
88
  b.gemspec.files = ['Rakefile']
84
- b.gemspec.version = 2.0
89
+ b.gemspec.version = '1.2.3'
85
90
  end
86
91
  ```
87
- From [examples/no_gemspec_file.rb](https://github.com/rickhull/buildar/blob/master/examples/no_gemspec_file.rb)
88
92
 
89
- Someone told me this breaks [Bundler](https://github.com/bundler/bundler), so maybe just use a gemspec file, k?
93
+ From [examples/no_gemspec_file.rb](https://github.com/rickhull/buildar/blob/master/examples/no_gemspec_file.rb)
90
94
 
91
95
  Dogfood
92
96
  -------
93
- Here is Buildar's [rakefile.rb](https://github.com/rickhull/buildar/blob/master/rakefile.rb):
97
+ Here is Buildar's [Rakefile](https://github.com/rickhull/buildar/blob/master/Rakefile):
94
98
 
95
99
  ```ruby
96
- require 'buildar/tasks'
97
- require 'rake/testtask'
98
-
99
- Buildar.conf(__FILE__) do |b|
100
- b.name = 'buildar'
101
- b.use_version_file = true
102
- b.version_filename = 'VERSION'
103
- b.use_git = true
104
- b.publish[:rubygems] = true
105
- end
100
+ require 'buildar'
106
101
 
107
- Rake::TestTask.new :test do |t|
108
- t.pattern = 'test/*.rb'
102
+ Buildar.new do |b|
103
+ b.gemspec_file = 'buildar.gemspec'
104
+ b.version_file = 'VERSION'
105
+ b.use_git = true
109
106
  end
110
107
  ```
111
108
 
112
- You can use it as a starting point.
109
+ With `b.version_file` and `b.use_git`
110
+
111
+ ```
112
+ $ rake release:patch message="added version task; demonstrating Usage"
113
+ bumping 2.0.0.9 to 2.0.1.0
114
+ git commit VERSION -m "Buildar version:bump_patch to 2.0.1.0"
115
+ [master 5df1ff8] Buildar version:bump_patch to 2.0.1.0
116
+ 1 file changed, 1 insertion(+), 1 deletion(-)
117
+ bumping 2.0.1.0 to 2.0.1.1
118
+ git commit VERSION -m "Buildar version:bump_build to 2.0.1.1"
119
+ [master 73d9bdb] Buildar version:bump_build to 2.0.1.1
120
+ 1 file changed, 1 insertion(+), 1 deletion(-)
121
+ gem build buildar.gemspec
122
+ WARNING: no email specified
123
+ Successfully built RubyGem
124
+ Name: buildar
125
+ Version: 2.0.1.1
126
+ File: buildar-2.0.1.1.gem
127
+ mv buildar-2.0.1.1.gem pkg/buildar-2.0.1.1.gem
128
+ gem push pkg/buildar-2.0.1.1.gem
129
+ Pushing gem to https://rubygems.org...
130
+ Successfully registered gem: buildar (2.0.1.1)
131
+ git tag -a "v2.0.1.1" -m "added version task; demonstrating Usage"
132
+ git push origin --tags
133
+ To https://github.com/rickhull/buildar.git
134
+ * [new tag] v2.0.1.1 -> v2.0.1.1
135
+ ```
113
136
 
114
137
  Use a VERSION file
115
138
  ------------------
116
- * Buildar can manage your version numbers with `b.use_version_file = true`
139
+ * Buildar can manage your version numbers with `b.version_file`
117
140
  * The version only matters in the context of a release. For internal development, git SHAs vastly outclass version numbers.
118
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
142
+ * http://guides.rubygems.org/patterns/#semantic-versioning
119
143
  * http://semver.org/
120
144
  * Automate everything
121
145
 
122
- Enable and configure a version file:
123
- ```ruby
124
- b.use_version_file = true
125
- b.version_filename = 'VERSION'
126
- ```
127
-
128
- The VERSION file should look something like
146
+ The [VERSION](https://github.com/rickhull/buildar/blob/master/VERSION) file at your project root should look something like
129
147
  ```
130
148
  1.2.3.4
131
149
  ```
132
150
 
133
- Buildar will be able to `bump:major` `bump:minor` `bump:patch` and `bump:build`. This helps with a repeatable, identifiable builds: `build` depends on `bump:build` etc.
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.
134
152
 
135
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.
136
154
 
@@ -145,11 +163,6 @@ To make your app or lib aware of its version via this file, simply:
145
163
  # e.g. lib/foo.rb
146
164
  #################
147
165
  module Foo
148
- # use a method, not a constant like VERSION
149
- # if you use a constant, then you're doing an extra file read at requiretime
150
- # and that hurts production. This method should not be called in production.
151
- # It's here more for deployment and sysadmin purposes. Memoize as needed.
152
- #
153
166
  def self.version
154
167
  file = File.expand_path('../../VERSION', __FILE__)
155
168
  File.read(file).chomp
@@ -157,17 +170,15 @@ module Foo
157
170
  end
158
171
  ```
159
172
 
160
- If you stick with the default `b.use_version_file = false` then you need to make sure to keep your gemspec's version attribute updated.
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.
161
174
 
162
175
  Gemspec file tricks
163
176
  -------------------
164
- I like to let Buildar manage my [VERSION](https://github.com/rickhull/buildar/blob/master/VERSION) file, and I also like to maintain my [MANIFEST.txt](https://github.com/rickhull/buildar/blob/master/MANIFEST.txt) -- the canonical list of files belonging to the project -- outside of [buildar.gemspec](https://github.com/rickhull/buildar/blob/master/buildar.gemspec).
165
-
166
177
  With
167
178
  ```ruby
168
- Buildar.conf(__FILE__) do |b|
169
- b.use_gemspec_file = true
170
- b.use_version_file = true
179
+ Buildar.new do |b|
180
+ b.gemspec_file = 'example.gemspec'
181
+ b.version_file = 'VERSION'
171
182
  ```
172
183
 
173
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):
@@ -184,24 +195,4 @@ You'll need to keep your gemspec file in synch with the version_file. Here's [h
184
195
  s.files = File.readlines(manifest_file).map { |f| f.chomp }
185
196
  ```
186
197
 
187
- Integrate with git
188
- ------------------
189
- Enable git integration with `b.use_git = true`. This empowers `tag` and `bump`:
190
- * `tag` is a `release` dependency. It depends on `test` git tag -a $tagname -m $message
191
- * `bump` and friends will commit VERSION changes
192
-
193
- Publish to rubygems.org
194
- -----------------------
195
- Enable `publish` to rubygems.org with `b.publish[:rubygems] = true`.
196
-
197
- Testing it out
198
- --------------
199
- ```shell
200
- rake buildar # print Buildar's config / smoketest
201
- rake version # print the Buildar's understanding of the version
202
- rake build # build a .gem file in pkg/
203
- rake install # build, uninstall, install
204
- rake release # build the .gem and push it rubygems.org
205
- ```
206
-
207
- `release` depends on `publish` which depends on `verify_publish_credentials` which will fail if you don't have `~/.gem/credentials`. In that case, sign up for an account at http://rubygems.org/ and follow the instructions to get your credentials file setup.
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.
@@ -4,5 +4,4 @@ Buildar.new do |b|
4
4
  b.gemspec_file = 'buildar.gemspec'
5
5
  b.version_file = 'VERSION'
6
6
  b.use_git = true
7
- # b.ns = 'gem'
8
7
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1.1
1
+ 2.0.2.1
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  # static stuff
3
3
  s.name = 'buildar'
4
- s.summary = 'Buildar crept inside your rakefile and scratched upon the tasking post'
4
+ s.summary = 'Buildar crept inside your Rakefile and scratched upon the tasking post'
5
5
  s.author = 'Rick Hull'
6
6
  s.homepage = 'https://github.com/rickhull/buildar'
7
7
  s.license = 'MIT'
@@ -75,9 +75,7 @@ class Buildar < Rake::TaskLib
75
75
  CLOBBER.include @pkg_dir
76
76
 
77
77
  if @ns and !@ns.empty?
78
- namespace @ns do
79
- define_tasks
80
- end
78
+ namespace(@ns) { define_tasks }
81
79
  else
82
80
  define_tasks
83
81
  end
@@ -91,9 +89,9 @@ class Buildar < Rake::TaskLib
91
89
  spacer = " " * 14
92
90
  gemspec = self.gemspec
93
91
  puts
92
+ puts " Project: #{gemspec.name} #{gemspec.version}"
93
+ puts "Gemspec file: #{@gemspec_file}" if @gemspec_file
94
94
  puts <<EOF
95
- Project: #{gemspec.name} #{gemspec.version}
96
- Gemspec file: #{@gemspec_file}
97
95
  Version file: #{@version_file}
98
96
  Use git: #{@use_git}
99
97
  Package dir: #{@pkg_dir}
@@ -118,7 +116,7 @@ EOF
118
116
  puts "bumping #{old_version} to #{new_version}"
119
117
  self.write_version new_version
120
118
 
121
- if @use_git
119
+ if @use_git and v != :build
122
120
  msg = "Buildar version:bump_#{v} to #{new_version}"
123
121
  sh "git commit #{@version_file} -m #{msg.inspect}"
124
122
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1.1
5
- prerelease:
4
+ version: 2.0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Rick Hull
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-12 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '8'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '8'
30
27
  description: Buildar helps automate the release process with versioning, building,
@@ -34,35 +31,34 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - buildar.gemspec
38
34
  - MANIFEST.txt
39
- - VERSION
40
35
  - README.md
41
- - rakefile.rb
36
+ - Rakefile
37
+ - VERSION
38
+ - buildar.gemspec
42
39
  - lib/buildar.rb
43
40
  homepage: https://github.com/rickhull/buildar
44
41
  licenses:
45
42
  - MIT
43
+ metadata: {}
46
44
  post_install_message:
47
45
  rdoc_options: []
48
46
  require_paths:
49
47
  - lib
50
48
  required_ruby_version: !ruby/object:Gem::Requirement
51
- none: false
52
49
  requirements:
53
- - - ! '>='
50
+ - - ">="
54
51
  - !ruby/object:Gem::Version
55
52
  version: '0'
56
53
  required_rubygems_version: !ruby/object:Gem::Requirement
57
- none: false
58
54
  requirements:
59
- - - ! '>='
55
+ - - ">="
60
56
  - !ruby/object:Gem::Version
61
57
  version: '0'
62
58
  requirements: []
63
59
  rubyforge_project:
64
- rubygems_version: 1.8.23
60
+ rubygems_version: 2.4.5
65
61
  signing_key:
66
- specification_version: 3
67
- summary: Buildar crept inside your rakefile and scratched upon the tasking post
62
+ specification_version: 4
63
+ summary: Buildar crept inside your Rakefile and scratched upon the tasking post
68
64
  test_files: []