ndr_dev_support 6.1.2 → 6.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a58e21dc2fa2f9a5fa7227b70cd0c6bdd769adb379df912c02e56675cea01b37
4
- data.tar.gz: 1b8d2ed30881f8e810ec995f32fbbf1db1528e43a8d983f34f2dd0c0afbdc6ad
3
+ metadata.gz: f9b372449b95e60ead7c4da7289b8d98de92a18c894fb79c14391fcf3d6370fe
4
+ data.tar.gz: 8847e9f85ba14c6268c49a1ee031411833674bcd506966b3a54aae03f283d95f
5
5
  SHA512:
6
- metadata.gz: f81704490c03a2075c031c1e428259083404cff81c9fce8c051bb80744a94a8e4a3b066ce09f88ce69e5e9cc0870f389e29b11223401977e626da0b4b061bac3
7
- data.tar.gz: 1cebef3b8ee8e41c38577b8639618300332cf77a87c937aa9e575c30d4305748143325f5f9a90674c921d6c6eb86fe5a5245fa7df8c61c97c22bcec96eff1172
6
+ metadata.gz: a5217032e0347fd837e0cf31f3dce1c173bf701a6c1f1b8f2c28762b37239c75bf01884e6c0de629c1668198aa978a278d4dc629fb8efdd070b60d84e0a6e230
7
+ data.tar.gz: 9b6f2ef06634b6fbe67cef8b196c55167456c8ab4cc513ab38c09ab0261c5ba13922da46bae3d3e4875c52ffa8396dcd1cbe204700ae63e0df49e38336eccca2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  ## [Unreleased]
2
2
  * No unreleased changes
3
3
 
4
+ ## 6.1.5 / 2022-06-24
5
+ ### Fixed
6
+ * audit:code should allow special characters in filenames
7
+
8
+ ## 6.1.4 / 2022-06-16
9
+ ### Added
10
+ * Add warning when upgrading webpacker
11
+
12
+ ## 6.1.3 / 2022-05-25
13
+ ### Fixed
14
+ * bundle:update should update secondary gem lock files
15
+
4
16
  ## 6.1.2 / 2022-05-24
5
17
  ### Fixed
6
18
  * bundle:update should fetch binary gems for all bundled platforms
@@ -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 = '6.1.2'
5
+ VERSION = '6.1.5'
6
6
  end
@@ -11,6 +11,10 @@ namespace :bundle do
11
11
  Updates the bundled gem (e.g. rails) version to e.g. 6.0.4.7
12
12
  and provides instructions for committing changes.
13
13
  It will attempt to modify a hardcoded version in the Gemfile if necessary.
14
+
15
+ If a secondary Gemfile is present in the same directory, e.g. Gemfile.monterey,
16
+ and it defines constants such as BUNDLER_OVERRIDE_PUMA=true, then this task
17
+ will attempt to update the secondary lock file, e.g. Gemfile.monterey.lock too.
14
18
  USAGE
15
19
  task(:update) do
16
20
  unless %w[git git-svn].include?(repository_type)
@@ -111,12 +115,39 @@ namespace :bundle do
111
115
  gem_list = Bundler.with_unbundled_env { `bundle exec gem list ^#{gem}$` }
112
116
  new_gem_version2 = gem_list.match(/ \(([0-9.]+)( [a-z0-9_-]*)?\)$/).to_a[1]
113
117
 
118
+ # Update secondary Gemfile.lock to keep vendored gems in sync
119
+ secondary_gemfiles = `git ls-tree --name-only HEAD Gemfile.*`.split("\n").grep_v(/[.]lock$/)
120
+ secondary_gemfiles.each do |secondary_gemfile|
121
+ gem_re = /^BUNDLER_OVERRIDE_([^ =]*) *=/
122
+ secondary_gems = File.readlines(secondary_gemfile).grep(gem_re).
123
+ collect { |s| gem_re.match(s)[1].downcase }
124
+ if secondary_gems.empty?
125
+ puts "Warning: cannot update #{secondary_gemfile}.lock - no BUNDLER_OVERRIDE_... entries"
126
+ next
127
+ end
128
+ puts "Updating #{secondary_gemfile}.lock"
129
+ FileUtils.cp('Gemfile.lock', "#{secondary_gemfile}.lock")
130
+ Bundler.with_unbundled_env do
131
+ system("BUNDLE_GEMFILE=#{secondary_gemfile} bundle update --quiet \
132
+ --conservative --minor #{secondary_gems.join(' ')}")
133
+ end
134
+ system('git checkout -q vendor/cache/')
135
+ system('git clean -q -f vendor/cache')
136
+ Bundler.with_unbundled_env { system('bundle install --local --quiet 2> /dev/null') }
137
+ puts "Finished updating #{secondary_gemfile}.lock"
138
+ end
139
+
114
140
  # Retrieve binary gems for platforms listed in Gemfile.lock
115
141
  platforms = `bundle platform`.split("\n").grep(/^[*] x86_64-/).collect { |s| s[2..] }
116
142
  Dir.chdir('vendor/cache') do
117
143
  platforms.each do |platform|
118
144
  system("gem fetch #{gem} --version=#{new_gem_version2} --platform=#{platform}")
119
145
  end
146
+ end if Dir.exist?('vendor/cache')
147
+
148
+ if gem == 'webpacker'
149
+ puts 'TODO: update package.json and yarn.lock with bin/rails webpacker:install'
150
+ puts ' and git add / git remove files in vendor/npm-packages-offline-cache'
120
151
  end
121
152
 
122
153
  if File.exist?(SAFETY_FILE)
@@ -140,7 +171,9 @@ namespace :bundle do
140
171
  puts "Looking for changed files using git status\n\n"
141
172
  files_to_git_rm = `git status vendor/cache/|grep 'deleted: ' | \
142
173
  grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
143
- files_to_git_add = `git status Gemfile Gemfile.lock code_safety.yml config/code_safety.yml| \
174
+ secondary_lockfiles = secondary_gemfiles.collect { |s| "#{s}.lock" }
175
+ files_to_git_add = `git status Gemfile Gemfile.lock #{secondary_gemfiles.join(' ')} \
176
+ #{secondary_lockfiles.join(' ')} code_safety.yml config/code_safety.yml| \
144
177
  grep 'modified: ' | \
145
178
  grep -o ': .*' | sed -e 's/^: *//'`.split("\n")
146
179
  files_to_git_add += `git status vendor/cache|expand|grep '^\s*vendor/cache' | \
@@ -1,6 +1,7 @@
1
1
  require 'csv'
2
2
  require 'pathname'
3
3
  require 'yaml'
4
+ require 'shellwords'
4
5
 
5
6
  SAFETY_FILE =
6
7
  if File.exist?('code_safety.yml')
@@ -338,7 +339,8 @@ def get_last_changed_revision(repo, fname)
338
339
  %x[git log -n 1 -- "#{fname}"].split("\n").first[7..-1]
339
340
  when 'git-svn', 'svn'
340
341
  begin
341
- svn_info = %x[svn info -r head "#{repo}/#{fname}"]
342
+ dest = "#{repo}/#{fname}@"
343
+ svn_info = %x[svn info -r head #{Shellwords.escape(dest)}]
342
344
  rescue
343
345
  puts 'we have an error in the svn info line'
344
346
  end
@@ -376,9 +378,10 @@ def capture_file_diffs(repo, fname, safe_revision, repolatest)
376
378
  cmd =
377
379
  case repository_type
378
380
  when 'git'
379
- cmd = ['git', '--no-pager', 'diff', '--color', '-b', "#{safe_revision}..#{repolatest}", fname]
381
+ ['git', '--no-pager', 'diff', '--color', '-b', "#{safe_revision}..#{repolatest}", fname]
380
382
  when 'git-svn', 'svn'
381
- cmd = ['svn', 'diff', '-r', "#{safe_revision.to_i}:#{repolatest.to_i}", '-x', '-b', "#{repo}/#{fname}"]
383
+ ['svn', 'diff', '-r', "#{safe_revision.to_i}:#{repolatest.to_i}", '-x', '-b',
384
+ "#{repo}/#{fname}@"]
382
385
  end
383
386
 
384
387
  stdout_and_err_str, _status = Open3.capture2e(*cmd)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_dev_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.2
4
+ version: 6.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - NCRS Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
11
+ date: 2022-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry