vtk 0.9.4 → 1.0.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: 85418afc912bae589d63f1c49bb87e5b2b52c9ea55c22a109ac10353fd117dfa
4
- data.tar.gz: 79d0f75328fb01a56e2bee827438f1a0f507c6bdf778c5a0a3886c03d931f760
3
+ metadata.gz: 6acd180a7e7d3839aebff0617c306c092205492ab3c5ce124f3b5e957970e42b
4
+ data.tar.gz: c2c5fe18ee04efc2624eb092125c4c738d041e854173d1f934543cb5dbe8dcd2
5
5
  SHA512:
6
- metadata.gz: 2020a6dcb32f0140a4a256a4a1b22a12da93ff386b5cec61589bb8cc91d03d0e36fbe77c0eb0aa3c40d18a6d411e7cc24666795283c555e23fdb41887dd09ec7
7
- data.tar.gz: d36d1e80cf8a0a06943618203c5cf66e29413b227f516180007112ac2883fbc1151e1d7bb9e8c814182953637cc03b296ad232d3b393084e9dacafef11652f1f
6
+ metadata.gz: 06b298ec4d35bb31e1472913c305377649ef70399cc87eb2818fae5c5f4f6395be90516df1cfb16aa2cdd4ba9ae8bccb9caec475654fa2c98b26e17be5a070fd
7
+ data.tar.gz: 793f7811c57a9167f17704a14105a4b8d1624974f910295088a3d72c29528e84f2d57921ff073a7d59fee357953b3972d31f5fc5cc19876b66dcd20b2effe5fa
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-08-06 20:18:41 UTC using RuboCop version 1.8.1.
3
+ # on 2023-12-15 17:05:02 UTC using RuboCop version 1.59.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -9,4 +9,9 @@
9
9
  # Offense count: 1
10
10
  # Configuration parameters: CountComments, CountAsOne.
11
11
  Metrics/ClassLength:
12
- Max: 405
12
+ Max: 403
13
+
14
+ # Offense count: 2
15
+ Style/OpenStructUse:
16
+ Exclude:
17
+ - 'lib/vtk/commands/socks/setup.rb'
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.4
1
+ ruby 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.9.4](https://github.com/department-of-veterans-affairs/vtk/tree/v0.9.4) (2022-04-11)
4
+
5
+ [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v0.9.3...v0.9.4)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Bump version to 0.9.4 [\#30](https://github.com/department-of-veterans-affairs/vtk/pull/30) ([rmtolmach](https://github.com/rmtolmach))
10
+ - Update SOCKS request url [\#29](https://github.com/department-of-veterans-affairs/vtk/pull/29) ([rmtolmach](https://github.com/rmtolmach))
11
+
12
+ ## [v0.9.3](https://github.com/department-of-veterans-affairs/vtk/tree/v0.9.3) (2021-09-23)
13
+
14
+ [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v0.9.2...v0.9.3)
15
+
3
16
  ## [v0.9.2](https://github.com/department-of-veterans-affairs/vtk/tree/v0.9.2) (2021-08-11)
4
17
 
5
18
  [Full Changelog](https://github.com/department-of-veterans-affairs/vtk/compare/v0.9.1...v0.9.2)
@@ -7,6 +20,7 @@
7
20
  **Merged pull requests:**
8
21
 
9
22
  - Case insensitively check for Microsoft in /proc/version [\#21](https://github.com/department-of-veterans-affairs/vtk/pull/21) ([ericboehs](https://github.com/ericboehs))
23
+ - VTK Socks Setup for Windows \(via WSL\) [\#19](https://github.com/department-of-veterans-affairs/vtk/pull/19) ([ericboehs](https://github.com/ericboehs))
10
24
 
11
25
  ## [v0.9.1](https://github.com/department-of-veterans-affairs/vtk/tree/v0.9.1) (2021-08-06)
12
26
 
@@ -14,7 +28,6 @@
14
28
 
15
29
  **Merged pull requests:**
16
30
 
17
- - VTK Socks Setup for Windows \(via WSL\) [\#19](https://github.com/department-of-veterans-affairs/vtk/pull/19) ([ericboehs](https://github.com/ericboehs))
18
31
  - Add ops-access-request label to new issue [\#18](https://github.com/department-of-veterans-affairs/vtk/pull/18) ([jeff2d2](https://github.com/jeff2d2))
19
32
 
20
33
  ## [v0.9.0](https://github.com/department-of-veterans-affairs/vtk/tree/v0.9.0) (2021-08-02)
data/Gemfile CHANGED
@@ -4,3 +4,13 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in vtk.gemspec
6
6
  gemspec
7
+
8
+ group :development do
9
+ gem 'github_changelog_generator', '~> 1.15.0'
10
+ gem 'pry', '~> 0.13.0'
11
+ gem 'rake', '~> 13.0.0'
12
+ gem 'rspec', '~> 3.10.0'
13
+ gem 'rubocop', '~> 1.59'
14
+ gem 'rubocop-rake', '~> 0.5.0'
15
+ gem 'rubocop-rspec', '~> 2.0.0'
16
+ end
@@ -30,14 +30,14 @@ module Vtk
30
30
 
31
31
  def connected?
32
32
  system "curl --max-time 2 -sL --proxy socks5h://127.0.0.1:#{port} sentry.vfs.va.gov 2> /dev/null | " \
33
- 'grep -q sentry-logo'
33
+ 'grep -q sentry-logo'
34
34
  end
35
35
 
36
36
  def connect_to_socks
37
37
  exit if system "lsof -Pi :#{port} -sTCP:LISTEN -t > /dev/null"
38
38
 
39
39
  Process.spawn "nohup ssh -vvv -o ServerAliveInterval=60 -o ConnectTimeout=5 socks -D #{port} -N" \
40
- '> /tmp/socks.log 2>&1 &'
40
+ '> /tmp/socks.log 2>&1 &'
41
41
  end
42
42
 
43
43
  def ensure_connection
@@ -4,6 +4,7 @@ require_relative '../../command'
4
4
  require 'tty-prompt'
5
5
  require 'fileutils'
6
6
  require 'erb'
7
+ require 'ostruct'
7
8
 
8
9
  module Vtk
9
10
  module Commands
@@ -11,7 +12,7 @@ module Vtk
11
12
  # Sets up socks access to the VA network
12
13
  class Setup < Vtk::Command
13
14
  PROXY_URL = 'https://raw.githubusercontent.com/department-of-veterans-affairs/va.gov-team/master/' \
14
- 'scripts/socks/proxy.pac'
15
+ 'scripts/socks/proxy.pac'
15
16
 
16
17
  attr_reader :ssh_config_path, :input, :output, :boot_script_path, :ssh_key_path, :prompt, :port, :skip_test
17
18
 
@@ -19,9 +20,9 @@ module Vtk
19
20
  @options = options
20
21
  @prompt = TTY::Prompt.new interrupt: :exit
21
22
  @port = options['port'] || '2001'
22
- @boot_script_path = options['boot_script_path'] || "#{ENV['HOME']}/Library"
23
- @ssh_key_path = options['ssh_key_path'] || "#{ENV['HOME']}/.ssh/id_rsa_vagov"
24
- @ssh_config_path = options['ssh_config_path'] || "#{ENV['HOME']}/.ssh/config"
23
+ @boot_script_path = options['boot_script_path'] || "#{Dir.home}/Library"
24
+ @ssh_key_path = options['ssh_key_path'] || "#{Dir.home}/.ssh/id_rsa_vagov"
25
+ @ssh_config_path = options['ssh_config_path'] || "#{Dir.home}/.ssh/config"
25
26
  @skip_test = options['skip_test'] || false
26
27
 
27
28
  super()
@@ -170,7 +171,7 @@ module Vtk
170
171
 
171
172
  ssh_agent_add
172
173
  system 'git config --global credential.helper > /dev/null || ' \
173
- "git config --global credential.helper 'cache --timeout=600'"
174
+ "git config --global credential.helper 'cache --timeout=600'"
174
175
  cloned = system(
175
176
  "git clone --quiet#{' --depth 1' if macos?} --no-checkout --filter=blob:none #{repo_url} '/tmp/dova-devops'"
176
177
  )
@@ -230,7 +231,7 @@ module Vtk
230
231
 
231
232
  if File.exist? "#{ssh_config_path}.bak"
232
233
  log "!!! ERROR: Could not make backup of #{pretty_ssh_config_path} as #{pretty_ssh_config_path}.bak " \
233
- 'exists. Aborting.'
234
+ 'exists. Aborting.'
234
235
  exit 1
235
236
  end
236
237
 
@@ -256,7 +257,7 @@ module Vtk
256
257
  IdentityFile #{pretty_ssh_key_path}
257
258
  CFG
258
259
 
259
- IO.write ssh_config_path, keychain_config, mode: 'a'
260
+ File.write ssh_config_path, keychain_config, mode: 'a'
260
261
  end
261
262
 
262
263
  def ssh_config_configured_with_keychain?
@@ -330,7 +331,7 @@ module Vtk
330
331
  def wsl_configure_system_boot
331
332
  return true if File.exist? socks_bat
332
333
 
333
- IO.write socks_bat, 'wsl nohup bash -c "/usr/bin/ssh socks -N &" < nul > nul 2>&1', mode: 'a'
334
+ File.write socks_bat, 'wsl nohup bash -c "/usr/bin/ssh socks -N &" < nul > nul 2>&1', mode: 'a'
334
335
  end
335
336
 
336
337
  def socks_bat
@@ -400,7 +401,7 @@ module Vtk
400
401
  autossh_path: `which autossh`.chomp,
401
402
  port: @port,
402
403
  boot_script_path: File.realpath(boot_script_path),
403
- user: ENV['USER']
404
+ user: ENV.fetch('USER', nil)
404
405
  )
405
406
  end
406
407
 
@@ -429,7 +430,7 @@ module Vtk
429
430
  autossh_path: `which autossh`.chomp,
430
431
  port: @port,
431
432
  ssh_key_path: ssh_key_path,
432
- user: ENV['USER']
433
+ user: ENV.fetch('USER', nil)
433
434
  )
434
435
  end
435
436
 
@@ -450,7 +451,7 @@ module Vtk
450
451
 
451
452
  log 'Configuring system proxy to use SOCKS tunnel...' do
452
453
  network_interfaces.map do |network_interface|
453
- system %(networksetup -setautoproxyurl "#{network_interface}" "#{PROXY_URL}")
454
+ system %(sudo networksetup -setautoproxyurl "#{network_interface}" "#{PROXY_URL}")
454
455
  end.all?
455
456
  end
456
457
  end
@@ -479,10 +480,8 @@ module Vtk
479
480
  end
480
481
 
481
482
  def network_interfaces
482
- @network_interfaces ||= begin
483
- `networksetup -listallnetworkservices`.split("\n").drop(1).select do |network_interface|
484
- `networksetup -getautoproxyurl "#{network_interface}"`.start_with?('URL: (null)')
485
- end
483
+ @network_interfaces ||= `networksetup -listallnetworkservices`.split("\n").drop(1).select do |interface|
484
+ `networksetup -getautoproxyurl "#{interface}"`.start_with?('URL: (null)')
486
485
  end
487
486
  end
488
487
 
@@ -509,7 +508,7 @@ module Vtk
509
508
  end
510
509
 
511
510
  def pretty_path(path)
512
- path.gsub ENV['HOME'], '~'
511
+ path.gsub Dir.home, '~'
513
512
  end
514
513
 
515
514
  def log(message)
data/lib/vtk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vtk
4
- VERSION = '0.9.4'
4
+ VERSION = '1.0.0'
5
5
  end
data/vtk.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.metadata['documentation_uri'] = spec.homepage
19
19
  spec.metadata['source_code_uri'] = spec.homepage
20
20
  spec.metadata['changelog_uri'] = 'https://github.com/department-of-veterans-affairs/vtk/blob/master/CHANGELOG.md'
21
+ spec.metadata['rubygems_mfa_required'] = 'true'
21
22
 
22
23
  # Specify which files should be added to the gem when it is released.
23
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -31,15 +32,4 @@ Gem::Specification.new do |spec|
31
32
  spec.add_dependency 'thor', '> 0.20.3'
32
33
  spec.add_dependency 'tty-command', '~> 0.10.0'
33
34
  spec.add_dependency 'tty-prompt', '~> 0.23.0'
34
-
35
- spec.add_development_dependency 'github_changelog_generator', '~> 1.15.0'
36
- spec.add_development_dependency 'pry', '~> 0.13.0'
37
- spec.add_development_dependency 'rake', '~> 13.0.0'
38
- spec.add_development_dependency 'rspec', '~> 3.10.0'
39
- spec.add_development_dependency 'rubocop', '~> 1.8.0'
40
- spec.add_development_dependency 'rubocop-rake', '~> 0.5.0'
41
- spec.add_development_dependency 'rubocop-rspec', '~> 2.0.0'
42
-
43
- # For more information and examples about making a new gem, checkout our
44
- # guide at: https://bundler.io/guides/creating_gem.html
45
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Boehs
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-04-11 00:00:00.000000000 Z
13
+ date: 2024-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -54,104 +54,6 @@ dependencies:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 0.23.0
57
- - !ruby/object:Gem::Dependency
58
- name: github_changelog_generator
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: 1.15.0
64
- type: :development
65
- prerelease: false
66
- version_requirements: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - "~>"
69
- - !ruby/object:Gem::Version
70
- version: 1.15.0
71
- - !ruby/object:Gem::Dependency
72
- name: pry
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: 0.13.0
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: 0.13.0
85
- - !ruby/object:Gem::Dependency
86
- name: rake
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - "~>"
90
- - !ruby/object:Gem::Version
91
- version: 13.0.0
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - "~>"
97
- - !ruby/object:Gem::Version
98
- version: 13.0.0
99
- - !ruby/object:Gem::Dependency
100
- name: rspec
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - "~>"
104
- - !ruby/object:Gem::Version
105
- version: 3.10.0
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - "~>"
111
- - !ruby/object:Gem::Version
112
- version: 3.10.0
113
- - !ruby/object:Gem::Dependency
114
- name: rubocop
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - "~>"
118
- - !ruby/object:Gem::Version
119
- version: 1.8.0
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - "~>"
125
- - !ruby/object:Gem::Version
126
- version: 1.8.0
127
- - !ruby/object:Gem::Dependency
128
- name: rubocop-rake
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - "~>"
132
- - !ruby/object:Gem::Version
133
- version: 0.5.0
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - "~>"
139
- - !ruby/object:Gem::Version
140
- version: 0.5.0
141
- - !ruby/object:Gem::Dependency
142
- name: rubocop-rspec
143
- requirement: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - "~>"
146
- - !ruby/object:Gem::Version
147
- version: 2.0.0
148
- type: :development
149
- prerelease: false
150
- version_requirements: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - "~>"
153
- - !ruby/object:Gem::Version
154
- version: 2.0.0
155
57
  description: This is a platform CLI tool for VFS developer usage.
156
58
  email:
157
59
  - eric.boehs@oddball.io
@@ -208,6 +110,7 @@ metadata:
208
110
  documentation_uri: https://github.com/department-of-veterans-affairs/vtk
209
111
  source_code_uri: https://github.com/department-of-veterans-affairs/vtk
210
112
  changelog_uri: https://github.com/department-of-veterans-affairs/vtk/blob/master/CHANGELOG.md
113
+ rubygems_mfa_required: 'true'
211
114
  post_install_message:
212
115
  rdoc_options: []
213
116
  require_paths:
@@ -223,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
126
  - !ruby/object:Gem::Version
224
127
  version: '0'
225
128
  requirements: []
226
- rubygems_version: 3.1.6
129
+ rubygems_version: 3.4.14
227
130
  signing_key:
228
131
  specification_version: 4
229
132
  summary: A CLI for the platform