tomo 1.15.0 → 1.16.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: 70027859367ad910607a0d7329b50405c0a243e52ff650dc82d5c34ad5162990
4
- data.tar.gz: 5dd2fe0c7b879d7cf6ef04301437e22fdd34412830fd4ecbd0958241643066a0
3
+ metadata.gz: ade686d10590812c28e8c6ea27b66eb75f2759f0d39515100984f2eec6c12f37
4
+ data.tar.gz: 9eb4a7a504cab2c6f540ef813b29a81c9dc6dedc7ceff227aea6d6006c6cf996
5
5
  SHA512:
6
- metadata.gz: b336aeb0e8ccffdc3dbe5e4842a297a8e18527f37ea7c523ceb27f76191433448c85b0d71a937c135712cf71eff996822535a3f6257344315cb5805eb2c93a92
7
- data.tar.gz: 2fdac86683f454707c033a5a93cf0f1cb1bc7e4cfdd2d3566088de39f54e9757cc6ab29bbf73f309832f3d733f440aefaf500139758039b2543500d485911ab1
6
+ metadata.gz: 235cca86edf1fa5433549351e83bff44ad75370ef1bec4ade503b9472607c81150d1599b721ddd143c150c5bf2a1c9669fccdf1a7ce84eb3ef7e3b418faf4ab6
7
+ data.tar.gz: 29481cc1c0e71bdc6e6c81036506733a96da12323ff931aae4d11d62959041b2b437c58f03f0b38d954523cc15c8943342943519928ae5101c9575824ff84c75
data/lib/tomo/host.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Tomo
2
2
  class Host
3
- PATTERN = /^(?:(\S+)@)?(\S*?)$/.freeze
3
+ PATTERN = /^(?:(\S+)@)?(\S*?)$/
4
4
  private_constant :PATTERN
5
5
 
6
6
  attr_reader :address, :log_prefix, :user, :port, :roles, :as_privileged
@@ -3,7 +3,7 @@ require "securerandom"
3
3
 
4
4
  module Tomo::Plugin::Core
5
5
  class Tasks < Tomo::TaskLibrary
6
- RELEASE_REGEXP = /\d{14}/.freeze
6
+ RELEASE_REGEXP = /\d{14}/
7
7
  private_constant :RELEASE_REGEXP
8
8
 
9
9
  def setup_directories
@@ -62,6 +62,7 @@ module Tomo::Plugin::Env
62
62
 
63
63
  remote.mkdir_p(paths.env.dirname) if original.empty?
64
64
  remote.write(text: env, to: paths.env)
65
+ remote.run("chmod", "600", paths.env) if original.empty?
65
66
  end
66
67
 
67
68
  def read_existing
@@ -62,6 +62,8 @@ module Tomo::Plugin::Nodenv
62
62
  version = remote.capture("cat", path, raise_on_error: false).strip
63
63
  return version unless version.empty?
64
64
 
65
+ return "DRY_RUN_PLACEHOLDER" if dry_run?
66
+
65
67
  die <<~REASON
66
68
  Could not guess node version from .node-version file.
67
69
  Use the :nodenv_node_version setting to specify the version of node to install.
data/lib/tomo/ssh.rb CHANGED
@@ -17,13 +17,17 @@ module Tomo
17
17
  options = Options.new(options) unless options.is_a?(Options)
18
18
 
19
19
  Tomo.logger.connect(host)
20
- return Connection.dry_run(host, options) if Tomo.dry_run?
20
+ return build_dry_run_connection(host, options) if Tomo.dry_run?
21
21
 
22
22
  build_connection(host, options)
23
23
  end
24
24
 
25
25
  private
26
26
 
27
+ def build_dry_run_connection(host, options)
28
+ Connection.dry_run(host, options)
29
+ end
30
+
27
31
  def build_connection(host, options)
28
32
  conn = Connection.new(host, options)
29
33
  validator = ConnectionValidator.new(options.executable, conn)
@@ -20,6 +20,8 @@ module Tomo
20
20
 
21
21
  def result_for(script)
22
22
  match = mocks.find { |regexp, _| regexp.match?(script.to_s) }
23
+ raise "Scripts cannot be mocked during dry_run" if match && Tomo.dry_run?
24
+
23
25
  match&.last || Result.empty_success
24
26
  end
25
27
  end
@@ -3,6 +3,12 @@ module Tomo
3
3
  module SSHExtensions
4
4
  private
5
5
 
6
+ def build_dry_run_connection(host, options)
7
+ return super if Testing.ssh_enabled
8
+
9
+ Testing::Connection.new(host, options)
10
+ end
11
+
6
12
  def build_connection(host, options)
7
13
  return super if Testing.ssh_enabled
8
14
 
data/lib/tomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.15.0".freeze
2
+ VERSION = "1.16.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-07 00:00:00.000000000 Z
11
+ date: 2023-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tomo is a feature-rich deployment tool that contains everything you need
14
14
  to deploy a basic Rails app out of the box. It has an opinionated, production-tested
@@ -182,14 +182,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
182
  requirements:
183
183
  - - ">="
184
184
  - !ruby/object:Gem::Version
185
- version: '2.6'
185
+ version: '3.0'
186
186
  required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  requirements:
188
188
  - - ">="
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.4.3
192
+ rubygems_version: 3.4.10
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: A friendly CLI for deploying Rails apps ✨