rake-deveiate 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.md +9 -0
- data/lib/rake/deveiate/gemspec.rb +1 -1
- data/lib/rake/deveiate/generate.rb +17 -0
- data/lib/rake/deveiate/hg.rb +30 -12
- data/lib/rake/deveiate.rb +18 -6
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 411dba3c0a85a488b5cc196c1cc431914baa1e8a361a338518a7c6d90997a86e
|
4
|
+
data.tar.gz: 6261595cce321454eb95f6ecd775ca294b732cde735997a17ed4e7d436701033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1862a49ef4b0966deaddaec18e4ac0b2b217a9ece1f06129e5e26b374c34ba09f0416f596d76e3eb2c52fbebee933033816e13fb98f60afe706e9cba63b8028c
|
7
|
+
data.tar.gz: 4e6bf0717bf50f656709890b2e50ad8b761a7c768549365c36cb88675dc72a9e4201c5d09e909f4a4cbc0ed2e0d59c3b9fae4316931acc4dbfc5934a4da03b03
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
---
|
4
4
|
|
5
|
+
## v0.3.0 [2019-10-14] Michael Granger <ged@FaerieMUD.org>
|
6
|
+
|
7
|
+
Improvements:
|
8
|
+
|
9
|
+
- Add a `diff_manifest` task
|
10
|
+
- Run checkin tasks in an order that makes more sense
|
11
|
+
- Fix the sign/tag sequence in `release` to allow `sigcheck`ing the tag.
|
12
|
+
|
13
|
+
|
5
14
|
## v0.2.0 [2019-10-12] Michael Granger <ged@FaerieMUD.org>
|
6
15
|
|
7
16
|
Improvements:
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
require 'tempfile'
|
4
5
|
require 'erb'
|
5
6
|
|
6
7
|
require 'rake/deveiate' unless defined?( Rake::DevEiate )
|
@@ -38,6 +39,7 @@ module Rake::DevEiate::Generate
|
|
38
39
|
task( RUBY_VERSION_FILE, &method(:do_generate_ruby_version_file) )
|
39
40
|
task( GEMSET_FILE, &method(:do_generate_gemset_file) )
|
40
41
|
|
42
|
+
desc "Generate any missing project files."
|
41
43
|
task :generate => [
|
42
44
|
self.readme_file,
|
43
45
|
self.history_file,
|
@@ -45,6 +47,9 @@ module Rake::DevEiate::Generate
|
|
45
47
|
RUBY_VERSION_FILE,
|
46
48
|
GEMSET_FILE,
|
47
49
|
]
|
50
|
+
|
51
|
+
desc "Diff the manifest file against the default set of project files."
|
52
|
+
task( :diff_manifest, &method(:do_diff_manifest) )
|
48
53
|
end
|
49
54
|
|
50
55
|
|
@@ -89,6 +94,18 @@ module Rake::DevEiate::Generate
|
|
89
94
|
end
|
90
95
|
|
91
96
|
|
97
|
+
### Task body for the `diff_manifest` task
|
98
|
+
def do_diff_manifest( task, args )
|
99
|
+
Tempfile.open( ['Manifest','.txt'], Rake::DevEiate::PROJECT_DIR ) do |io|
|
100
|
+
file_list = self.default_manifest.to_a
|
101
|
+
io.puts( *file_list )
|
102
|
+
io.flush
|
103
|
+
|
104
|
+
sh 'diff', '-ub', self.manifest_file.to_s, io.path
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
|
92
109
|
### Generate the given +filename+ from the template filed at +template_path+.
|
93
110
|
def generate_from_template( filename, template_path )
|
94
111
|
self.prompt.ok "Generating #{filename}..."
|
data/lib/rake/deveiate/hg.rb
CHANGED
@@ -61,7 +61,14 @@ module Rake::DevEiate::Hg
|
|
61
61
|
return unless File.directory?( '.hg' )
|
62
62
|
|
63
63
|
file COMMIT_MSG_FILE.to_s do |task|
|
64
|
-
|
64
|
+
commit_log = Pathname( task.name )
|
65
|
+
|
66
|
+
edit_commit_log( commit_log )
|
67
|
+
unless commit_log.size?
|
68
|
+
self.prompt.error "Empty commit message; aborting."
|
69
|
+
commit_log.unlink if commit_log.exist?
|
70
|
+
abort
|
71
|
+
end
|
65
72
|
end
|
66
73
|
|
67
74
|
CLEAN.include( COMMIT_MSG_FILE.to_s )
|
@@ -88,14 +95,14 @@ module Rake::DevEiate::Hg
|
|
88
95
|
task( :update_and_clobber, &method(:do_hg_update_and_clobber) )
|
89
96
|
|
90
97
|
desc "Mercurial-specific pre-checkin hook"
|
91
|
-
task :precheckin
|
98
|
+
task :precheckin => [ :pull, :newfiles, :check_for_changes ]
|
99
|
+
|
100
|
+
desc "Check the current code in if tests pass"
|
101
|
+
task( :checkin => COMMIT_MSG_FILE.to_s, &method(:do_hg_checkin) )
|
92
102
|
|
93
103
|
desc "Mercurial-specific pre-release hook"
|
94
104
|
task :prerelease => 'hg:check_history'
|
95
105
|
|
96
|
-
desc "Check the current code in if tests pass"
|
97
|
-
task( :checkin => [:pull, :newfiles, :precheckin, COMMIT_MSG_FILE.to_s], &method(:do_hg_checkin) )
|
98
|
-
|
99
106
|
desc "Mercurial-specific post-release hook"
|
100
107
|
task( :postrelease, &method(:do_hg_postrelease) )
|
101
108
|
|
@@ -113,21 +120,22 @@ module Rake::DevEiate::Hg
|
|
113
120
|
desc "Generate and edit a new version entry in the history file"
|
114
121
|
task( :update_history, &method(:do_hg_update_history) )
|
115
122
|
|
123
|
+
task( :check_for_changes, &method(:do_hg_check_for_changes) )
|
116
124
|
task( :debug, &method(:do_hg_debug) )
|
117
125
|
end
|
118
126
|
|
119
127
|
|
120
128
|
# Hook some generic tasks to the mercurial-specific ones
|
121
|
-
task :
|
129
|
+
task :checkin => 'hg:checkin'
|
130
|
+
task :precheckin => 'hg:precheckin'
|
122
131
|
|
123
132
|
task :prerelease => 'hg:prerelease'
|
124
|
-
task :precheckin => 'hg:precheckin'
|
125
|
-
task :debug => 'hg:debug'
|
126
133
|
task :postrelease => 'hg:postrelease'
|
127
134
|
|
128
135
|
desc "Update the history file with the changes since the last version tag."
|
129
136
|
task :update_history => 'hg:update_history'
|
130
137
|
|
138
|
+
task :debug => 'hg:debug'
|
131
139
|
rescue ::Exception => err
|
132
140
|
$stderr.puts "%s while defining Mercurial tasks: %s" % [ err.class.name, err.message ]
|
133
141
|
raise
|
@@ -148,6 +156,7 @@ module Rake::DevEiate::Hg
|
|
148
156
|
end
|
149
157
|
|
150
158
|
pkg_version_tag = self.current_version_tag
|
159
|
+
rev = self.hg.identity.id
|
151
160
|
|
152
161
|
# Look for a tag for the current release version, and if it exists abort
|
153
162
|
if self.hg.tags.find {|tag| tag.name == pkg_version_tag }
|
@@ -156,15 +165,14 @@ module Rake::DevEiate::Hg
|
|
156
165
|
end
|
157
166
|
|
158
167
|
if self.sign_tags
|
159
|
-
message = "Signing %s" % [
|
168
|
+
message = "Signing %s" % [ rev ]
|
160
169
|
self.prompt.ok( message )
|
161
|
-
self.hg.sign( message: message )
|
170
|
+
self.hg.sign( rev, message: message )
|
162
171
|
end
|
163
172
|
|
164
173
|
# Tag the current rev
|
165
|
-
rev = self.hg.identify
|
166
174
|
self.prompt.ok "Tagging rev %s as %s" % [ rev, pkg_version_tag ]
|
167
|
-
self.hg.tag( pkg_version_tag )
|
175
|
+
self.hg.tag( pkg_version_tag, rev: rev )
|
168
176
|
end
|
169
177
|
|
170
178
|
|
@@ -310,6 +318,16 @@ module Rake::DevEiate::Hg
|
|
310
318
|
end
|
311
319
|
|
312
320
|
|
321
|
+
### Check the status of the repo and ensure there are outstanding changes. If there
|
322
|
+
### are no changes, abort.
|
323
|
+
def do_hg_check_for_changes( task, args )
|
324
|
+
unless self.hg.dirty?
|
325
|
+
self.prompt.error "Working copy is clean."
|
326
|
+
abort
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
|
313
331
|
### Generate a new history file entry for the current version.
|
314
332
|
def do_hg_update_history( task, args ) # Needs refactoring
|
315
333
|
unless self.history_file.readable?
|
data/lib/rake/deveiate.rb
CHANGED
@@ -34,7 +34,7 @@ class Rake::DevEiate < Rake::TaskLib
|
|
34
34
|
VERSION_PATTERN = /VERSION\s*=\s*(?<quote>['"])(?<version>\d+(\.\d+){2}.*)\k<quote>/
|
35
35
|
|
36
36
|
# The version of this library
|
37
|
-
VERSION = '0.
|
37
|
+
VERSION = '0.3.0'
|
38
38
|
|
39
39
|
# The server to release to by default
|
40
40
|
DEFAULT_GEMSERVER = 'https://rubygems.org/'
|
@@ -61,13 +61,18 @@ class Rake::DevEiate < Rake::TaskLib
|
|
61
61
|
DEFAULT_MANIFEST_FILE = PROJECT_DIR + 'Manifest.txt'
|
62
62
|
DEFAULT_README_FILE = PROJECT_DIR + 'README.md'
|
63
63
|
DEFAULT_HISTORY_FILE = PROJECT_DIR + 'History.md'
|
64
|
+
|
64
65
|
DEFAULT_PROJECT_FILES = Rake::FileList[
|
65
66
|
'*.{rdoc,md,txt}',
|
66
67
|
'bin/*',
|
67
|
-
'lib
|
68
|
+
'lib/**/*.rb',
|
68
69
|
'ext/*.[ch]', 'ext/**/*.[ch]',
|
69
|
-
'data/**/*'
|
70
|
+
'data/**/*',
|
71
|
+
'spec/**/*.rb',
|
70
72
|
]
|
73
|
+
DEFAULT_PROJECT_FILES.exclude( 'Manifest*.txt' )
|
74
|
+
|
75
|
+
|
71
76
|
|
72
77
|
# The default license for the project in SPDX form: https://spdx.org/licenses
|
73
78
|
DEFAULT_LICENSE = 'BSD-3-Clause'
|
@@ -291,10 +296,10 @@ class Rake::DevEiate < Rake::TaskLib
|
|
291
296
|
task( :default => :spec )
|
292
297
|
|
293
298
|
desc "Check in the current changes"
|
294
|
-
task :checkin => :precheckin
|
299
|
+
task :checkin => [ :precheckin, :check, :test ]
|
295
300
|
task :commit => :checkin
|
296
301
|
task :ci => :checkin
|
297
|
-
task :precheckin
|
302
|
+
task :precheckin
|
298
303
|
|
299
304
|
desc "Sanity-check the project"
|
300
305
|
task :check
|
@@ -463,11 +468,18 @@ class Rake::DevEiate < Rake::TaskLib
|
|
463
468
|
else
|
464
469
|
self.prompt.warn "No manifest (%s): falling back to a default list" %
|
465
470
|
[ self.manifest_file ]
|
466
|
-
return
|
471
|
+
return self.default_manifest
|
467
472
|
end
|
468
473
|
end
|
469
474
|
|
470
475
|
|
476
|
+
### Return the Rake::FileList that's used in lieu of the manifest file if it
|
477
|
+
### isn't present.
|
478
|
+
def default_manifest
|
479
|
+
return DEFAULT_PROJECT_FILES.dup
|
480
|
+
end
|
481
|
+
|
482
|
+
|
471
483
|
### Make a Rake::FileList of the files that should be used to generate
|
472
484
|
### documentation.
|
473
485
|
def make_rdoc_filelist
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-deveiate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Granger
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
jBZSA+N+xUTgUWpXjjwsLZjzJkhWATJWq+krNXcqpwXo6HsjmdUxoFMt63RBb+sI
|
35
35
|
XrxOxp8o0uOkU7FdLSGsyqJ2LzsR4obN
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2019-10-
|
37
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rake
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '0.
|
87
|
+
version: '0.5'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '0.
|
94
|
+
version: '0.5'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: tty-prompt
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.0.
|
209
|
+
rubygems_version: 3.0.3
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: This is a collection of Rake tasks I use for development.
|
metadata.gz.sig
CHANGED
Binary file
|