peak_flow_utils 0.1.22 → 0.1.24
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz: '
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09b4cc6c4746170bc4be78f58c447be7c24fb98fe4ab2616c1efe5e3199021be'
|
|
4
|
+
data.tar.gz: 9046266b37ad81f316ff7ea2b87c21518ad575dc12b62b0a4dc172cbf5e9775d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eabf75ca1e26aedf3b2e4a22e56513317a12160757f284ce80c8f65d54dd7cb41f9515616a9a1a07453eb99cf6457d2b5e17c5e9f0cf171ba6d850c209ddf34a
|
|
7
|
+
data.tar.gz: 752b031ddbe701f07a7360ee5342fe28ebf71b2d6aa3b9b0ea4b1c695766a1fbc8e529452c67c6367e0ff616d3ddaee0b96269e5c1da4eef989de836c2291557
|
data/Rakefile
CHANGED
|
@@ -4,6 +4,7 @@ rescue LoadError
|
|
|
4
4
|
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
+
require "logger"
|
|
7
8
|
require "rdoc/task"
|
|
8
9
|
|
|
9
10
|
RDoc::Task.new(:rdoc) do |rdoc|
|
|
@@ -21,6 +22,8 @@ load "rails/tasks/statistics.rake"
|
|
|
21
22
|
|
|
22
23
|
require "bundler/gem_tasks"
|
|
23
24
|
|
|
25
|
+
load File.expand_path("lib/tasks/release.rake", __dir__)
|
|
26
|
+
|
|
24
27
|
if Rails.env.development? || Rails.env.test?
|
|
25
28
|
require "best_practice_project"
|
|
26
29
|
BestPracticeProject.load_tasks
|
|
@@ -49,9 +49,7 @@ Thread.class_eval do
|
|
|
49
49
|
|
|
50
50
|
def self.inherited_local_vars_set(values)
|
|
51
51
|
inherited_local_vars_mutex.synchronize do
|
|
52
|
-
|
|
53
|
-
new_vars = PeakFlowUtils::DeepMerger.execute!(hashes: [current_vars, values])
|
|
54
|
-
Thread.current.instance_variable_set(:@_inherited_local_vars, new_vars)
|
|
52
|
+
_inherited_local_vars.merge!(values)
|
|
55
53
|
end
|
|
56
54
|
end
|
|
57
55
|
end
|
|
@@ -13,12 +13,18 @@ class PeakFlowUtils::Notifier
|
|
|
13
13
|
@current
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def self.notify(
|
|
17
|
-
|
|
16
|
+
def self.notify(*args, **kwargs)
|
|
17
|
+
if args.any?
|
|
18
|
+
raise ArgumentError, "unexpected positional arguments" unless args.first.is_a?(Hash) && args.length == 1
|
|
19
|
+
|
|
20
|
+
kwargs = args.first.merge(kwargs)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
PeakFlowUtils::Notifier.current&.notify(**kwargs)
|
|
18
24
|
end
|
|
19
25
|
|
|
20
|
-
def self.notify_message(
|
|
21
|
-
PeakFlowUtils::Notifier.current&.notify_message(
|
|
26
|
+
def self.notify_message(message, **)
|
|
27
|
+
PeakFlowUtils::Notifier.current&.notify_message(message, **)
|
|
22
28
|
end
|
|
23
29
|
|
|
24
30
|
def self.reset_parameters
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
require "English"
|
|
2
|
+
require "fileutils"
|
|
3
|
+
require "pathname"
|
|
4
|
+
require "rubygems/version"
|
|
5
|
+
require "shellwords"
|
|
6
|
+
|
|
7
|
+
class PeakFlowUtilsRubygemsRelease
|
|
8
|
+
VERSION_FILE = Pathname.new(File.expand_path("../peak_flow_utils/version.rb", __dir__)) unless const_defined?(:VERSION_FILE)
|
|
9
|
+
|
|
10
|
+
def call
|
|
11
|
+
ensure_clean_worktree!
|
|
12
|
+
checkout_master!
|
|
13
|
+
fetch!
|
|
14
|
+
merge!
|
|
15
|
+
|
|
16
|
+
next_version = determine_next_version
|
|
17
|
+
|
|
18
|
+
bump_version!(next_version)
|
|
19
|
+
commit!(next_version)
|
|
20
|
+
push!
|
|
21
|
+
gem_file = build_gem!(next_version)
|
|
22
|
+
push_gem!(gem_file)
|
|
23
|
+
delete_gem_file!(gem_file)
|
|
24
|
+
rescue StandardError
|
|
25
|
+
warn "Release failed."
|
|
26
|
+
raise
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
private
|
|
30
|
+
|
|
31
|
+
def ensure_clean_worktree!
|
|
32
|
+
dirty_entries = git_status_lines.grep_v(%r{\A\?\? peak_flow_utils-[^/]+\.gem\z})
|
|
33
|
+
return if dirty_entries.empty?
|
|
34
|
+
|
|
35
|
+
raise "Working tree must be clean before releasing:\n#{dirty_entries.join("\n")}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def checkout_master!
|
|
39
|
+
run!("git", "checkout", "master")
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def fetch!
|
|
43
|
+
run!("git", "fetch", remote_name)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def merge!
|
|
47
|
+
run!("git", "merge", "--ff-only", "#{remote_name}/master")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def determine_next_version
|
|
51
|
+
requested_version || bumped_version
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def requested_version
|
|
55
|
+
version = ENV["VERSION"]&.strip
|
|
56
|
+
return if version.to_s.empty?
|
|
57
|
+
|
|
58
|
+
Gem::Version.new(version)
|
|
59
|
+
version
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def bumped_version
|
|
63
|
+
case bump_type
|
|
64
|
+
when "major"
|
|
65
|
+
[version_segments[0] + 1, 0, 0].join(".")
|
|
66
|
+
when "minor"
|
|
67
|
+
[version_segments[0], version_segments[1] + 1, 0].join(".")
|
|
68
|
+
when "patch"
|
|
69
|
+
[version_segments[0], version_segments[1], version_segments[2] + 1].join(".")
|
|
70
|
+
else
|
|
71
|
+
raise "Unsupported BUMP=#{bump_type.inspect}. Use patch, minor, major, or VERSION=x.y.z."
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def version_segments
|
|
76
|
+
@version_segments ||= begin
|
|
77
|
+
segments = Gem::Version.new(current_version).segments
|
|
78
|
+
segments << 0 while segments.length < 3
|
|
79
|
+
segments
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def current_version
|
|
84
|
+
@current_version ||= VERSION_FILE.read[/VERSION = "([^"]+)"/, 1] || raise("Could not find current version")
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def bump_version!(next_version)
|
|
88
|
+
raise "Next version must differ from current version" if next_version == current_version
|
|
89
|
+
|
|
90
|
+
VERSION_FILE.write(
|
|
91
|
+
VERSION_FILE.read.sub(
|
|
92
|
+
/VERSION = "[^"]+"/,
|
|
93
|
+
%(VERSION = "#{next_version}")
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
run!("git", "add", VERSION_FILE.to_s)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
def commit!(next_version)
|
|
101
|
+
run!("git", "commit", "-m", "Release #{next_version}")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def push!
|
|
105
|
+
run!("git", "push", remote_name, "master")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def build_gem!(next_version)
|
|
109
|
+
gem_file = "peak_flow_utils-#{next_version}.gem"
|
|
110
|
+
run!("gem", "build", "peak_flow_utils.gemspec")
|
|
111
|
+
gem_file
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
def push_gem!(gem_file)
|
|
115
|
+
run!("gem", "push", gem_file)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def delete_gem_file!(gem_file)
|
|
119
|
+
FileUtils.rm_f(gem_file)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def git_status_lines
|
|
123
|
+
capture!("git", "status", "--porcelain").split("\n").reject(&:empty?)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def bump_type
|
|
127
|
+
ENV.fetch("BUMP", "patch")
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def remote_name
|
|
131
|
+
ENV.fetch("REMOTE", "origin")
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def capture!(*command)
|
|
135
|
+
output = `#{command.map { |part| Shellwords.escape(part) }.join(" ")}`
|
|
136
|
+
raise "Command failed: #{command.join(' ')}" unless $CHILD_STATUS&.success?
|
|
137
|
+
|
|
138
|
+
output
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
def run!(*command)
|
|
142
|
+
return if system(*command)
|
|
143
|
+
|
|
144
|
+
raise "Command failed: #{command.join(' ')}"
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
namespace :release do
|
|
149
|
+
desc "Release a patch version from master by fetching, fast-forward merging, bumping version, pushing, and publishing"
|
|
150
|
+
task patch: :environment do
|
|
151
|
+
ENV["BUMP"] = "patch"
|
|
152
|
+
PeakFlowUtilsRubygemsRelease.new.call
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
desc "Release a minor version from master by fetching, fast-forward merging, bumping version, pushing, and publishing"
|
|
156
|
+
task minor: :environment do
|
|
157
|
+
ENV["BUMP"] = "minor"
|
|
158
|
+
PeakFlowUtilsRubygemsRelease.new.call
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
desc "Release a major version from master by fetching, fast-forward merging, bumping version, pushing, and publishing"
|
|
162
|
+
task major: :environment do
|
|
163
|
+
ENV["BUMP"] = "major"
|
|
164
|
+
PeakFlowUtilsRubygemsRelease.new.call
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
desc "Release the gem from master by fetching, fast-forward merging, bumping version, pushing, and publishing"
|
|
168
|
+
task rubygems: :environment do
|
|
169
|
+
PeakFlowUtilsRubygemsRelease.new.call
|
|
170
|
+
end
|
|
171
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: peak_flow_utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.24
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kaspernj
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-03-30 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: rails
|
|
@@ -174,11 +175,13 @@ files:
|
|
|
174
175
|
- lib/peak_flow_utils/thread_callbacks_patch.rb
|
|
175
176
|
- lib/peak_flow_utils/version.rb
|
|
176
177
|
- lib/tasks/peak_flow_utils_tasks.rake
|
|
178
|
+
- lib/tasks/release.rake
|
|
177
179
|
homepage: https://github.com/kaspernj/peak_flow_utils
|
|
178
180
|
licenses:
|
|
179
181
|
- MIT
|
|
180
182
|
metadata:
|
|
181
183
|
rubygems_mfa_required: 'true'
|
|
184
|
+
post_install_message:
|
|
182
185
|
rdoc_options: []
|
|
183
186
|
require_paths:
|
|
184
187
|
- lib
|
|
@@ -186,14 +189,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
186
189
|
requirements:
|
|
187
190
|
- - ">="
|
|
188
191
|
- !ruby/object:Gem::Version
|
|
189
|
-
version: 3.
|
|
192
|
+
version: 3.2.9
|
|
190
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
194
|
requirements:
|
|
192
195
|
- - ">="
|
|
193
196
|
- !ruby/object:Gem::Version
|
|
194
197
|
version: '0'
|
|
195
198
|
requirements: []
|
|
196
|
-
rubygems_version: 3.
|
|
199
|
+
rubygems_version: 3.4.19
|
|
200
|
+
signing_key:
|
|
197
201
|
specification_version: 4
|
|
198
202
|
summary: Utilities to be used with PeakFlow.
|
|
199
203
|
test_files: []
|