ndr_dev_support 7.3.8 → 7.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bceb17903631013fce3438cf82287cab07bf06575f109345676e45e5e4df28b3
4
- data.tar.gz: 0e6f918d2614fbb08f8540b3329314d31dc81533994a68bb9429ab747e7e8717
3
+ metadata.gz: a8c7389deaf9048730fd52e00aca7491de646c95d4acd98f722e41790b534a53
4
+ data.tar.gz: 399136453039e29e1f98a374f000e52df7bc5f6d74687cf79ed7a47aaa07f5d4
5
5
  SHA512:
6
- metadata.gz: f4940867633068addac74dc3e357f4c9eafd361489c52616c044b79a8d3d7a29e01afd1a4b658f6a158cbb9e22a938823ac2dbc191637d8de0bec64a46ae2156
7
- data.tar.gz: ed344310df1814ff4304a13514c733a09543e4053d944bc56af4f6533654d6e0a7f7403076951d23916292f01a4f387d3c521bf1371ea874eefb422f959c9340
6
+ metadata.gz: 5441cc3b8b03af8cc70b23f828ff609bfe7b6163375da538c58aadbc168013138b90ad871d0f75e838f9b2035a4a71494d3761c06f8ad59802c989e3ac3eb6fb
7
+ data.tar.gz: 57e225abe451ed18b7f368a47f766242e5ee542db5fd382a8036401159d9db413926a24cefe3b23bf43a73a54255e36a69c289cac2cb34716abb2d3fecbe865d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ## [Unreleased]
2
2
  * no unreleased changes
3
3
 
4
+ ## 7.4.0 / 2026-11-25
5
+ ### Fixed
6
+ * Fix ruby 3.4 frozen string literal warnings
7
+ * Drop support for Rails 7.1 and 7.2
8
+
9
+ ### Added
10
+ * Capistrano: remove old unused ruby versions, allow forced removal
11
+
4
12
  ## 7.3.8 / 2026-09-16
5
13
  ### Fixed
6
14
  * Do not include macOS extended attributes in rbenv tar files
@@ -103,10 +103,13 @@ Capistrano::Configuration.instance(:must_exist).load do
103
103
 
104
104
  Deletes shared bundle files that no longer match any installed releases.
105
105
 
106
+ To force deletion of specific ruby version(s), use:
107
+ set :delete_ruby_versions, %w[3.4.7]
108
+
106
109
  This interacts reasonably with deploy:preinstall:
107
110
  When deploy:preinstall installs new .rbenv and new shared bundled gems, this
108
111
  will not delete them. If an older ruby version is then deployed, this removes
109
- the new version's installed bundle, but leaves the .rbenv installation.
112
+ the new version's installed bundle, but leaves the .rbenv install for 7 days.
110
113
  DESC
111
114
  task :cleanup_unused_bundles do
112
115
  # For ruby X.Y.Z, bundled gems are in .../shared/bundle/ruby/X.Y.0
@@ -117,6 +120,24 @@ Capistrano::Configuration.instance(:must_exist).load do
117
120
  "#{releases_path}/*/.ruby-version | sed -e 's/.*/-or -name &.0/'` ) \"; " \
118
121
  "find #{File.join(shared_path, 'bundle/ruby/*')} -maxdepth 0 $find_options " \
119
122
  "-exec echo rm -rf '{}' ';' -exec rm -rf '{}' ';'"
123
+
124
+ # Remove old ruby installations
125
+ # (excluding any released .ruby_version and any version modified in the last 7 days)
126
+ # Note: we need to consider all ndr_model capistrano deployments for the user,
127
+ # e.g. biobank_request + extra
128
+ run "find_options=\"-not ( -name DUMMY `grep -ho '^[0-9]*[.][0-9]*[.][0-9]*' " \
129
+ "#{application_home}/*/releases/*/.ruby-version " \
130
+ "#{releases_path}/*/.ruby-version | sed -e 's/.*/-or -name &/'` ) -mtime +7 \"; " \
131
+ "find #{File.join(application_home, '.rbenv/versions/*')} -maxdepth 0 $find_options " \
132
+ "-exec echo rm -rf '{}' ';' -exec sudo -i -n -u #{fetch(:application_user)} rm -rf '{}' ';'"
133
+
134
+ # Allow forced removal of specific ruby versions, e.g. for known security vulnerabilities
135
+ # Note that there are no checks on whether these versions are still in use.
136
+ if fetch(:delete_ruby_versions, []).any?
137
+ find_options = delete_ruby_versions.collect { |ver| "-name #{ver}" }.join(' -or ')
138
+ run "find #{File.join(application_home, '.rbenv/versions/*')} -maxdepth 0 #{find_options} " \
139
+ "-exec echo rm -rf '{}' ';' -exec sudo -i -n -u #{fetch(:application_user)} rm -rf '{}' ';'"
140
+ end
120
141
  end
121
142
  end
122
143
 
@@ -30,16 +30,16 @@ module NdrDevSupport
30
30
 
31
31
  def git_diff(args)
32
32
  diff_cmd = 'git diff --no-prefix --unified=0 '
33
- diff_cmd << Shellwords.escape(args) unless args.empty?
33
+ diff_cmd += Shellwords.escape(args) unless args.empty?
34
34
  stdout, stderr, status = Open3.capture3(diff_cmd)
35
35
 
36
36
  return stdout if status.success?
37
37
 
38
- fail Rainbow(<<-MSG).red
39
- Failed to generate diff from:
40
- #{diff_cmd}
38
+ raise Rainbow(<<~MSG).red
39
+ Failed to generate diff from:
40
+ #{diff_cmd}
41
41
 
42
- #{stderr}
42
+ #{stderr}
43
43
  MSG
44
44
  end
45
45
 
@@ -2,5 +2,5 @@
2
2
  # This defines the NdrDevSupport version. If you change it, rebuild and commit the gem.
3
3
  # Use "rake build" to build the gem, see rake -T for all bundler rake tasks (and our own).
4
4
  module NdrDevSupport
5
- VERSION = '7.3.8'
5
+ VERSION = '7.4.0'
6
6
  end
@@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
44
44
  spec.add_dependency 'show_me_the_cookies'
45
45
 
46
46
  # CI server dependencies:
47
- spec.add_dependency 'activesupport', '>= 7.1', '< 8.2'
47
+ spec.add_dependency 'activesupport', '>= 8.0', '< 8.2'
48
48
  spec.add_dependency 'brakeman', '>= 4.7.1'
49
49
  spec.add_dependency 'bundler-audit'
50
50
  spec.add_dependency 'github-linguist'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_dev_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.8
4
+ version: 7.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NCRS Development Team
@@ -217,7 +217,7 @@ dependencies:
217
217
  requirements:
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: '7.1'
220
+ version: '8.0'
221
221
  - - "<"
222
222
  - !ruby/object:Gem::Version
223
223
  version: '8.2'
@@ -227,7 +227,7 @@ dependencies:
227
227
  requirements:
228
228
  - - ">="
229
229
  - !ruby/object:Gem::Version
230
- version: '7.1'
230
+ version: '8.0'
231
231
  - - "<"
232
232
  - !ruby/object:Gem::Version
233
233
  version: '8.2'