ndr_dev_support 7.3.5 → 7.3.6

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: 5a9657d61fe9727e7023491944d7005896e9c4a41b47c5a79a017b6989a125a8
4
- data.tar.gz: 8175fd01914592c8ea9dfdb364a02de49622ca56a7fe85626f07318f5cf7377f
3
+ metadata.gz: 589fcf9c03c62ecbeecffbfe9020e87a7a1d5deec59506eef8129592504ae1c7
4
+ data.tar.gz: 8e99fb0d7c43f670c8684fdd11e570df00d69895e18f16194dd70a4f1afd6047
5
5
  SHA512:
6
- metadata.gz: 44f9c9ba5543eee3b9b506026eacdaf5f3a9a6513dde51629e457e9de489cb87bad909661891bd0eeb179e4e95fbc6b88c222661fc9c4ecd2c9a278493b486b3
7
- data.tar.gz: 274c6fe966a87ea07060aea1fef879b6c98d6644dfb7a740dfcdee417354379d77a31af5acfdfb0caff4b20ba144be13047126e80f04f7ca83b92ff1d417ab83
6
+ metadata.gz: 768b8c51a8653ce8866a322fcb2bcf7548bb42a4ce8d133b5e397f961bb143c0b8f2820eb9e5a67d211bb6304d125359ea8f210456604cc4d1d0e62374c50545
7
+ data.tar.gz: ff1eb7652b61497650afd78d9fb9bd0a8f366b6bcc972240f6c07f6e4529015e0fede07f4787eb965acd848348cbb966ddcd17c1566cc0fb57b9172cc10141f2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## [Unreleased]
2
2
  *no unreleased changes*
3
3
 
4
+ ## 7.3.6 / 2026-01-13
5
+ ### Added
6
+ * Support Rails 8.1, Ruby 4.0
7
+ * capistrano: Support bundler 4 with capistrano 2
8
+
4
9
  ## 7.3.5 / 2025-10-16
5
10
  ### Fixed
6
11
  * Capistrano: Do not include macOS extended attributes in tar files
@@ -0,0 +1,100 @@
1
+ # Support capistrano 2 with old (< 4) and new (>= 4) bundler versions
2
+ #
3
+ # Add "require 'ndr_dev_support/capistrano/ndr_model'" in your Capistrano deploy.rb,
4
+ # but remove calls to "require 'bundler/capistrano'", and
5
+ # Bundler will be activated after each new deployment.
6
+
7
+ unless defined?(Bundler::Deployment)
8
+ # Redefine deployment helpers for Capistrano 2, previously defined in bundler < 4
9
+ # cf. https://blog.rubygems.org/2025/12/03/upgrade-to-rubygems-bundler-4.html
10
+ # Code copied from bundler 2 source files bundler/deployment.rb and bundler/capistrano.rb
11
+ # then modified to support bundler >= 2
12
+ # rubocop:disable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
13
+ module Bundler
14
+ class Deployment
15
+ def self.define_task(context, task_method = :task, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity
16
+ if defined?(Capistrano) && context.is_a?(Capistrano::Configuration)
17
+ context_name = "capistrano"
18
+ role_default = "{:except => {:no_release => true}}"
19
+ error_type = ::Capistrano::CommandError
20
+ else
21
+ context_name = "vlad"
22
+ role_default = "[:app]"
23
+ error_type = ::Rake::CommandFailedError
24
+ end
25
+
26
+ roles = context.fetch(:bundle_roles, false)
27
+ opts[:roles] = roles if roles
28
+
29
+ context.send :namespace, :bundle do
30
+ send :desc, <<-DESC
31
+ Install the current Bundler environment. By default, gems will be \
32
+ installed to the shared/bundle path. Gems in the development and \
33
+ test group will not be installed. The install command is executed \
34
+ with the --deployment and --quiet flags. If the bundle cmd cannot \
35
+ be found then you can override the bundle_cmd variable to specify \
36
+ which one it should use. The base path to the app is fetched from \
37
+ the :latest_release variable. Set it for custom deploy layouts.
38
+
39
+ You can override any of these defaults by setting the variables shown below.
40
+
41
+ N.B. bundle_roles must be defined before you require 'bundler/#{context_name}' \
42
+ in your deploy.rb file.
43
+
44
+ set :bundle_gemfile, "Gemfile"
45
+ set :bundle_dir, File.join(fetch(:shared_path), 'bundle')
46
+ set :bundle_flags, "--deployment --quiet"
47
+ set :bundle_without, [:development, :test]
48
+ set :bundle_with, [:mysql]
49
+ set :bundle_cmd, "bundle" # e.g. "/opt/ruby/bin/bundle"
50
+ set :bundle_roles, #{role_default} # e.g. [:app, :batch]
51
+ DESC
52
+ send task_method, :install, opts do
53
+ bundle_cmd = context.fetch(:bundle_cmd, "bundle")
54
+ bundle_flags = context.fetch(:bundle_flags, "--deployment --quiet")
55
+ bundle_dir = context.fetch(:bundle_dir, File.join(context.fetch(:shared_path), "bundle"))
56
+ bundle_gemfile = context.fetch(:bundle_gemfile, "Gemfile")
57
+ bundle_without = [*context.fetch(:bundle_without, [:development, :test])].compact
58
+ bundle_with = [*context.fetch(:bundle_with, [])].compact
59
+ app_path = context.fetch(:latest_release)
60
+ if app_path.to_s.empty?
61
+ raise error_type.new("Cannot detect current release path - make sure you have deployed at least once.")
62
+ end
63
+ # Separate out flags that need to be sent to `bundle config` with Bundler 4
64
+ if bundle_flags.include?('--deployment')
65
+ bundle_flags = bundle_flags.split(/ /).grep_v('--deployment').join(' ')
66
+ config_settings = ['deployment true']
67
+ else
68
+ config_settings = []
69
+ end
70
+
71
+ args = ["--gemfile #{File.join(app_path, bundle_gemfile)}"]
72
+ config_settings << "path #{bundle_dir}" unless bundle_dir.to_s.empty?
73
+ args << bundle_flags.to_s
74
+ config_settings << "without #{bundle_without.join(" ")}" unless bundle_without.empty?
75
+ config_settings << "with #{bundle_with.join(" ")}" unless bundle_with.empty?
76
+
77
+ bundle_cmds = config_settings.collect do |settings|
78
+ "#{bundle_cmd} config set --local #{settings}"
79
+ end + ["#{bundle_cmd} install #{args.join(" ")}"]
80
+ run "cd #{app_path} && #{bundle_cmds.join(' && ')}"
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+
87
+ # Capistrano task for Bundler.
88
+ require "capistrano/version"
89
+
90
+ if defined?(Capistrano::Version) && Gem::Version.new(Capistrano::Version).release >= Gem::Version.new("3.0")
91
+ raise "For Capistrano 3.x integration, please use https://github.com/capistrano/bundler"
92
+ end
93
+
94
+ Capistrano::Configuration.instance(:must_exist).load do
95
+ before "deploy:finalize_update", "bundle:install"
96
+ Bundler::Deployment.define_task(self, :task, except: { no_release: true })
97
+ set :rake, lambda { "#{fetch(:bundle_cmd, "bundle")} exec rake" }
98
+ end
99
+ # rubocop:enable Style/Documentation, Metrics/AbcSize, Metrics/MethodLength, Style/StringLiterals, Style/SymbolArray, Style/RaiseArgs, Layout/EmptyLineAfterGuardClause, Style/StringLiteralsInInterpolation, Style/Lambda
100
+ end
@@ -2,6 +2,7 @@ require 'rainbow'
2
2
 
3
3
  # Discrete bits of functionality we use automatically:
4
4
  require_relative 'assets'
5
+ require_relative 'bundler_deployment'
5
6
  require_relative 'deploy_secrets'
6
7
  require_relative 'install_ruby'
7
8
  require_relative 'macos_bsdtar'
@@ -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.5'
5
+ VERSION = '7.3.6'
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', '>= 6.1', '< 8.1'
47
+ spec.add_dependency 'activesupport', '>= 7.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,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_dev_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.5
4
+ version: 7.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - NCRS Development Team
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-10-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: pry
@@ -212,20 +211,20 @@ dependencies:
212
211
  requirements:
213
212
  - - ">="
214
213
  - !ruby/object:Gem::Version
215
- version: '6.1'
214
+ version: '7.0'
216
215
  - - "<"
217
216
  - !ruby/object:Gem::Version
218
- version: '8.1'
217
+ version: '8.2'
219
218
  type: :runtime
220
219
  prerelease: false
221
220
  version_requirements: !ruby/object:Gem::Requirement
222
221
  requirements:
223
222
  - - ">="
224
223
  - !ruby/object:Gem::Version
225
- version: '6.1'
224
+ version: '7.0'
226
225
  - - "<"
227
226
  - !ruby/object:Gem::Version
228
- version: '8.1'
227
+ version: '8.2'
229
228
  - !ruby/object:Gem::Dependency
230
229
  name: brakeman
231
230
  requirement: !ruby/object:Gem::Requirement
@@ -409,6 +408,7 @@ files:
409
408
  - lib/minitest/rake_ci_plugin.rb
410
409
  - lib/ndr_dev_support.rb
411
410
  - lib/ndr_dev_support/capistrano/assets.rb
411
+ - lib/ndr_dev_support/capistrano/bundler_deployment.rb
412
412
  - lib/ndr_dev_support/capistrano/deploy_secrets.rb
413
413
  - lib/ndr_dev_support/capistrano/install_ruby.rb
414
414
  - lib/ndr_dev_support/capistrano/macos_bsdtar.rb
@@ -473,7 +473,6 @@ homepage: https://github.com/NHSDigital/ndr_dev_support
473
473
  licenses:
474
474
  - MIT
475
475
  metadata: {}
476
- post_install_message:
477
476
  rdoc_options: []
478
477
  require_paths:
479
478
  - lib
@@ -488,8 +487,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
488
487
  - !ruby/object:Gem::Version
489
488
  version: '0'
490
489
  requirements: []
491
- rubygems_version: 3.5.22
492
- signing_key:
490
+ rubygems_version: 3.6.9
493
491
  specification_version: 4
494
492
  summary: NDR Developer Support library
495
493
  test_files: []