buildar 2.0.2.2 → 3.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +22 -5
  3. data/VERSION +1 -1
  4. data/buildar.gemspec +5 -9
  5. data/lib/buildar.rb +20 -12
  6. metadata +7 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ece7fc84778bdf31f709d38114edf5e1fd7c82d6
4
- data.tar.gz: b4b5e3e7dabd824b0fc846876eff0d08e32d0e3a
3
+ metadata.gz: d66f1821b6fed8ae765cb0863bcc94d2e1d26e4f
4
+ data.tar.gz: 9abd4f6724a248baf196221945d443f630aa32b7
5
5
  SHA512:
6
- metadata.gz: 16daabbaf39f3269a30e421dc67b727df0d9f56e682a9e01a1277f87996755e93feb9e158a6dfcec5d1b78372bbf2fdb5ab69aafe3633da0ed6877045269a675
7
- data.tar.gz: fe03d3131bd60a32324268ce60c097cd7f972202ab028f58338a522a124994b3071a4228bdbfa0400b73e17126e8e3eedc3032feaeb09dd2bd946c2fab1e2531
6
+ metadata.gz: 7b675e519283d5a47c67a87e8709961f590febc2e64dad02e4406fc3ef29413cc99ecf57e8fb09b08cc9f84b9b4579fe9ffa880fd29cec0c695c287340fbe20e
7
+ data.tar.gz: 4ffdd5035cbf607a5b719e6c8f551575a5c9cf09da3892d48c0a92bcfb4e6d4c8ef5f5e6c12d90debde397b0bd5765342c7af60528c26a2e65cabae8824977bb
data/Rakefile CHANGED
@@ -1,7 +1,24 @@
1
- require 'buildar'
1
+ begin
2
+ require 'buildar'
2
3
 
3
- Buildar.new do |b|
4
- b.gemspec_file = 'buildar.gemspec'
5
- b.version_file = 'VERSION'
6
- b.use_git = true
4
+ Buildar.new do |b|
5
+ b.gemspec_file = 'buildar.gemspec'
6
+ b.version_file = 'VERSION'
7
+ b.use_git = true
8
+ end
9
+
10
+ rescue LoadError => e
11
+ warn "buildar failed to load: #{e}"
12
+ 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}"
7
24
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2.2
1
+ 3.0.0.1
@@ -1,21 +1,17 @@
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 adds rake tasks to assist with gem publishing'
5
5
  s.author = 'Rick Hull'
6
6
  s.homepage = 'https://github.com/rickhull/buildar'
7
7
  s.license = 'MIT'
8
8
  s.has_rdoc = true
9
9
  s.description = 'Buildar helps automate the release process with versioning, building, packaging, and publishing. Optional git integration.'
10
10
 
11
- s.add_runtime_dependency "rake"
12
-
13
- # dynamic setup
14
- this_dir = File.expand_path('..', __FILE__)
15
- version_file = File.join(this_dir, 'VERSION')
16
- manifest_file = File.join(this_dir, 'MANIFEST.txt')
11
+ s.required_ruby_version = "~> 2"
17
12
 
18
13
  # dynamic assignments
19
- s.version = File.read(version_file).chomp
20
- s.files = File.readlines(manifest_file).map { |f| f.chomp }
14
+ s.version = File.read(File.join(__dir__, 'VERSION')).chomp
15
+ s.files =
16
+ File.readlines(File.join(__dir__, 'MANIFEST.txt')).map { |f| f.chomp }
21
17
  end
@@ -14,7 +14,7 @@ class Buildar < Rake::TaskLib
14
14
  def self.bump(position, version)
15
15
  pos = [:major, :minor, :patch, :build].index(position) || position
16
16
  places = version.split('.')
17
- if pos >= places.length and pos <= places.length + 2
17
+ if places.length <= pos and pos <= places.length + 3
18
18
  # add zeroes to places up to pos
19
19
  # allows bump(:build, '0') #=> '0.0.0.1'
20
20
  places.length.upto(pos) { |i| places[i] = 0 }
@@ -85,9 +85,9 @@ class Buildar < Rake::TaskLib
85
85
  #
86
86
 
87
87
  desc "config check"
88
- task :buildar do
88
+ task buildar: :valid_gemspec do
89
89
  spacer = " " * 14
90
- gemspec = self.gemspec || raise("no valid gemspec")
90
+ gemspec = self.gemspec
91
91
  puts
92
92
  puts " Project: #{gemspec.name} #{gemspec.version}"
93
93
  puts "Gemspec file: #{@gemspec_file}" if @gemspec_file
@@ -128,7 +128,7 @@ EOF
128
128
 
129
129
  def define_tasks
130
130
  desc "invoke :test and :bump_build conditionally"
131
- task :pre_build => @pkg_dir do
131
+ task pre_build: @pkg_dir do
132
132
  Rake::Task[:test].invoke if Rake::Task.task_defined? :test
133
133
  Rake::Task['bump:build'].invoke if @version_file
134
134
  end
@@ -137,7 +137,7 @@ EOF
137
137
  # as a dependency, changing the target file
138
138
  #
139
139
  desc "build a .gem in #{@pkg_dir}/ using `gem build`"
140
- task :build => :pre_build do
140
+ task build: :pre_build do
141
141
  if @gemspec_file
142
142
  sh "gem build #{@gemspec_file}"
143
143
  mv File.basename(self.gem_file), self.gem_file
@@ -150,7 +150,7 @@ EOF
150
150
  # operates with a hard or soft gemspec
151
151
  #
152
152
  desc "build a .gem in #{@pkg_dir}/ using Gem::PackageTask"
153
- task :gem_package => :pre_build do
153
+ task gem_package: :pre_build do
154
154
  # definine the task at runtime, rather than requiretime
155
155
  # so that the gemspec will reflect any version bumping since requiretime
156
156
  require 'rubygems/package_task'
@@ -164,28 +164,36 @@ EOF
164
164
  end
165
165
 
166
166
  desc "publish the current version to rubygems.org"
167
- task :publish => :built do
167
+ task publish: :built do
168
168
  sh "gem push #{self.gem_file}"
169
169
  end
170
170
 
171
171
  desc "build, publish" << (@use_git ? ", tag " : '')
172
- task :release => [:build, :publish] do
172
+ task release: [:build, :publish] do
173
173
  Rake::Task[:tag].invoke if @use_git
174
174
  end
175
175
 
176
176
  desc "install the current version"
177
- task :install => :built do
177
+ task install: :built do
178
178
  sh "gem install #{self.gem_file}"
179
179
  end
180
180
 
181
181
  desc "build a new version and install"
182
- task :install_new => [:build, :install]
182
+ task install_new: [:build, :install]
183
183
 
184
184
  desc "display current version"
185
- task :version do
185
+ task version: :valid_gemspec do
186
186
  puts self.gemspec.version
187
187
  end
188
188
 
189
+ task :valid_gemspec do
190
+ unless self.gemspec
191
+ msg = "gemspec required"
192
+ msg += "; checked #{self.gemspec_file}" if self.gemspec_file
193
+ raise msg
194
+ end
195
+ end
196
+
189
197
  #
190
198
  # Optional tasks
191
199
  #
@@ -201,7 +209,7 @@ EOF
201
209
 
202
210
  if @use_git
203
211
  desc "annotated git tag with version and message"
204
- task :tag => :message do
212
+ task tag: :message do
205
213
  Rake::Task[:test].invoke if Rake::Task.task_defined? :test
206
214
  tagname = "v#{self.gemspec.version}"
207
215
  message = ENV['message'] || "auto-tagged #{tagname} by Buildar"
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2.2
4
+ version: 3.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Hull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rake
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
11
+ date: 2017-09-27 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: Buildar helps automate the release process with versioning, building,
28
14
  packaging, and publishing. Optional git integration.
29
15
  email:
@@ -47,9 +33,9 @@ require_paths:
47
33
  - lib
48
34
  required_ruby_version: !ruby/object:Gem::Requirement
49
35
  requirements:
50
- - - ">="
36
+ - - "~>"
51
37
  - !ruby/object:Gem::Version
52
- version: '0'
38
+ version: '2'
53
39
  required_rubygems_version: !ruby/object:Gem::Requirement
54
40
  requirements:
55
41
  - - ">="
@@ -57,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
43
  version: '0'
58
44
  requirements: []
59
45
  rubyforge_project:
60
- rubygems_version: 2.5.2
46
+ rubygems_version: 2.6.8
61
47
  signing_key:
62
48
  specification_version: 4
63
- summary: Buildar crept inside your Rakefile and scratched upon the tasking post
49
+ summary: Buildar adds rake tasks to assist with gem publishing
64
50
  test_files: []