better_batch 1.0.1 → 1.0.2
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
- data/.ruby-version +1 -0
- data/CHANGELOG.md +7 -5
- data/Rakefile +79 -0
- data/lib/better_batch/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13c31343ab529bbd8df1009f601778fb504897bdfdb8b4d77f7165bad88620a1
|
4
|
+
data.tar.gz: 571f51a6631cdac4d47aca08dba3964b281b8831fb5ec7820bcd97c669814116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38ccffb6de7831944d5c2eb7de2ea93f7ea56c7a9b392ee74fc148d4378795a3f33fdcb55e9e0f3912e7618fa6ecd26a561959c60a1d2fd4e1fd900eb59bd1f8
|
7
|
+
data.tar.gz: e2c9efca1a99bb78aabe321a5f5b5eb322743e5463e8925574512ebc2855a18572b3008570699b396ee99d6569e6ee2670fe9dd7cb5c38d41382e96c3e8145b1
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.4.2
|
data/CHANGELOG.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
-
## [
|
1
|
+
## [1.0.2] - 2025-04-15
|
2
2
|
|
3
|
-
|
3
|
+
- Test version to excercise deployment updates
|
4
4
|
|
5
|
-
-
|
5
|
+
## [1.0.1] - 2025-04-15
|
6
|
+
|
7
|
+
- Fix dependency definition
|
6
8
|
|
7
9
|
## [1.0.0] - 2025-04-15
|
8
10
|
|
9
11
|
- Initial feature set
|
10
12
|
|
11
|
-
## [1.0
|
13
|
+
## [0.1.0] - 2025-04-04
|
12
14
|
|
13
|
-
-
|
15
|
+
- Initial release
|
data/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'English'
|
3
4
|
require 'bundler/gem_tasks'
|
4
5
|
require 'rspec/core/rake_task'
|
5
6
|
|
@@ -10,3 +11,81 @@ require 'rubocop/rake_task'
|
|
10
11
|
RuboCop::RakeTask.new
|
11
12
|
|
12
13
|
task default: %i[spec rubocop]
|
14
|
+
|
15
|
+
module Tasks
|
16
|
+
BUILD_FILENAME = 'better_batch.gem'
|
17
|
+
|
18
|
+
class << self
|
19
|
+
include Rake::DSL
|
20
|
+
|
21
|
+
def install
|
22
|
+
install_release_if
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def install_release_if # rubocop:disable Metrics/MethodLength
|
28
|
+
namespace :release do
|
29
|
+
desc 'release if current version is later than last published version'
|
30
|
+
task if: :default do
|
31
|
+
assert_correct_branch!
|
32
|
+
if current_version > published_version
|
33
|
+
assert_ci!
|
34
|
+
# from bundler, asserts working directory is clean
|
35
|
+
Rake::Task['release'].invoke
|
36
|
+
end
|
37
|
+
assert_version_sane!
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def published_version
|
43
|
+
@published_version ||= build_published_version
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_published_version
|
47
|
+
raw = shr('gem search --remote --exact better_batch')
|
48
|
+
Gem::Version.new(raw.split('(').last.sub(')', ''))
|
49
|
+
end
|
50
|
+
|
51
|
+
def current_version
|
52
|
+
@current_version ||= Gem::Version.new(BetterBatch::VERSION)
|
53
|
+
end
|
54
|
+
|
55
|
+
def assert_version_sane!
|
56
|
+
return unless current_version < published_version
|
57
|
+
|
58
|
+
raise "BetterBatch::VERSION (#{current_version}) " \
|
59
|
+
"is less than the current published (#{published_version}). " \
|
60
|
+
'Was it edited incorrectly?'
|
61
|
+
end
|
62
|
+
|
63
|
+
def current_branch
|
64
|
+
@current_branch ||= shr('git rev-parse --abbrev-ref HEAD').chomp
|
65
|
+
end
|
66
|
+
|
67
|
+
def default_branch
|
68
|
+
@default_branch ||= shr('git remote show origin').match(/HEAD branch: (\S+)$/)[1]
|
69
|
+
end
|
70
|
+
|
71
|
+
def assert_correct_branch!
|
72
|
+
return unless current_branch != default_branch
|
73
|
+
|
74
|
+
raise "On branch (#{current_branch}) instead of default #{default_branch}."
|
75
|
+
end
|
76
|
+
|
77
|
+
def assert_ci!
|
78
|
+
raise 'Not in CI.' unless ENV['CI'] == 'true'
|
79
|
+
end
|
80
|
+
|
81
|
+
def shr(cmd)
|
82
|
+
puts cmd
|
83
|
+
result = `#{cmd}`
|
84
|
+
raise cmd unless $CHILD_STATUS == 0
|
85
|
+
|
86
|
+
result
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
Tasks.install
|
data/lib/better_batch/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_batch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Hartland
|
@@ -31,6 +31,7 @@ extra_rdoc_files: []
|
|
31
31
|
files:
|
32
32
|
- ".rspec"
|
33
33
|
- ".rubocop.yml"
|
34
|
+
- ".ruby-version"
|
34
35
|
- CHANGELOG.md
|
35
36
|
- CODE_OF_CONDUCT.md
|
36
37
|
- LICENSE.txt
|