tomo 1.14.0 → 1.15.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: 2da243b8f639993407cdb09d1bd13a5fadfa783e05b341432769149e4121a9d4
4
- data.tar.gz: c194f68b4700a9b1ed3883e20c75ea36c5353a2a19b3db92644af1fdbbba7860
3
+ metadata.gz: 70027859367ad910607a0d7329b50405c0a243e52ff650dc82d5c34ad5162990
4
+ data.tar.gz: 5dd2fe0c7b879d7cf6ef04301437e22fdd34412830fd4ecbd0958241643066a0
5
5
  SHA512:
6
- metadata.gz: 9c547b318e37b40b47737a097a15b7bbacda5bfcb446c285f91045a87f234ab8a7a3033cf1433cb8a99ce564a4463b3445be298d721dd6c8734c1e2cd8a26c97
7
- data.tar.gz: 7342081977edf2ae5f98fe9f0b1cd39b9451a5a4ce870f2f713541041427088c830ae1ed3d975dab1eeb688362540369b1d550958b50ab91a7d9f2b4a62e776f
6
+ metadata.gz: b336aeb0e8ccffdc3dbe5e4842a297a8e18527f37ea7c523ceb27f76191433448c85b0d71a937c135712cf71eff996822535a3f6257344315cb5805eb2c93a92
7
+ data.tar.gz: 2fdac86683f454707c033a5a93cf0f1cb1bc7e4cfdd2d3566088de39f54e9757cc6ab29bbf73f309832f3d733f440aefaf500139758039b2543500d485911ab1
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022 Matt Brictson
3
+ Copyright (c) 2023 Matt Brictson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Tomo
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/tomo.svg)](https://rubygems.org/gems/tomo)
4
- [![Circle](https://circleci.com/gh/mattbrictson/tomo/tree/main.svg?style=shield)](https://app.circleci.com/pipelines/github/mattbrictson/tomo?branch=main)
4
+ [![Build Status](https://mattbrictson.semaphoreci.com/badges/tomo/branches/main.svg?style=shields)](https://mattbrictson.semaphoreci.com/projects/tomo)
5
5
  [![Code Climate](https://codeclimate.com/github/mattbrictson/tomo/badges/gpa.svg)](https://codeclimate.com/github/mattbrictson/tomo)
6
6
 
7
7
  Tomo is a friendly command-line tool for deploying Rails apps.
@@ -12,9 +12,9 @@ module Tomo
12
12
  }.freeze
13
13
 
14
14
  OPTION_PATTERNS = {
15
- /\A--\[no-\]([\-a-z]+)\z/ => :on_off_switch_rule,
16
- /\A(-[a-z]), (--[\-a-z]+)\z/ => :basic_switch_rule,
17
- /\A(-[a-z]), (--[\-a-z]+) [A-Z=_\-]+\z/ => :value_switch_rule
15
+ /\A--\[no-\]([-a-z]+)\z/ => :on_off_switch_rule,
16
+ /\A(-[a-z]), (--[-a-z]+)\z/ => :basic_switch_rule,
17
+ /\A(-[a-z]), (--[-a-z]+) [A-Z=_-]+\z/ => :value_switch_rule
18
18
  }.freeze
19
19
 
20
20
  private_constant :ARG_PATTERNS, :OPTION_PATTERNS
@@ -29,7 +29,7 @@ module Tomo
29
29
  assert_no_tomo_project!
30
30
 
31
31
  app = args.first || current_dir_name || "default"
32
- app = app.gsub(/([^\w\-]|_)+/, "_").downcase
32
+ app = app.gsub(/([^\w-]|_)+/, "_").downcase
33
33
  FileUtils.mkdir_p(".tomo/plugins")
34
34
 
35
35
  # TODO: use a template for this file
@@ -86,7 +86,7 @@ module Tomo
86
86
  end
87
87
 
88
88
  def clear
89
- height = 2 + visible_options.length
89
+ height = visible_options.length + 2
90
90
  esc_codes = Array.new(height) { "\e[2K\e[1G" }.join("\e[1A")
91
91
  print esc_codes
92
92
  end
@@ -34,17 +34,15 @@ module Tomo::Plugin::Rbenv
34
34
  ruby_version = version_setting || extract_ruby_ver_from_version_file
35
35
 
36
36
  unless ruby_installed?(ruby_version)
37
- logger.info(
38
- "Installing ruby #{ruby_version} -- this may take several minutes"
39
- )
40
- remote.run "CFLAGS=-O3 rbenv install #{ruby_version.shellescape}"
37
+ logger.info("Installing ruby #{ruby_version} -- this may take several minutes")
38
+ remote.run "CFLAGS=-O3 rbenv install #{ruby_version.shellescape} --verbose"
41
39
  end
42
40
  remote.run "rbenv global #{ruby_version.shellescape}"
43
41
  end
44
42
 
45
43
  def ruby_installed?(version)
46
44
  versions = remote.capture("rbenv versions", raise_on_error: false)
47
- if versions.include?(version)
45
+ if versions.match?(/^\*?\s*#{Regexp.quote(version)}\s/)
48
46
  logger.info("Ruby #{version} is already installed.")
49
47
  return true
50
48
  end
@@ -70,7 +70,7 @@ module Tomo
70
70
  thread_pool.run_to_completion
71
71
  yield(remotes)
72
72
  ensure
73
- (remotes || {}).values.each(&:close)
73
+ (remotes || {}).each_value(&:close)
74
74
  end
75
75
 
76
76
  def build_plan(tasks, task_filter)
@@ -33,6 +33,7 @@ set env_vars: {
33
33
  RAILS_ENV: "production",
34
34
  RAILS_LOG_TO_STDOUT: "1",
35
35
  RAILS_SERVE_STATIC_FILES: "1",
36
+ RUBY_YJIT_ENABLE: "1",
36
37
  BOOTSNAP_CACHE_DIR: "tmp/bootsnap-cache",
37
38
  DATABASE_URL: :prompt,
38
39
  SECRET_KEY_BASE: :prompt
@@ -44,8 +44,6 @@ module Tomo
44
44
  end
45
45
 
46
46
  def puma_port
47
- return 3000 if ENV["_TOMO_CONTAINER"]
48
-
49
47
  Local.capture("docker port #{container_id} 3000")[/:(\d+)/, 1].to_i
50
48
  end
51
49
 
@@ -88,13 +86,7 @@ module Tomo
88
86
  end
89
87
 
90
88
  def start_container
91
- host_container = ENV["_TOMO_CONTAINER"]
92
- args = "--detach --init #{image_id}"
93
- if host_container
94
- args.prepend("--network=container:#{host_container} ")
95
- else
96
- args.prepend("--publish-all ")
97
- end
89
+ args = "--publish-all --detach --init #{image_id}"
98
90
  Local.capture("docker run #{args}")[/\S+/].tap do
99
91
  # Allow some time for the container to finish booting
100
92
  sleep 0.1
@@ -102,8 +94,6 @@ module Tomo
102
94
  end
103
95
 
104
96
  def find_ssh_port
105
- return 22 if ENV["_TOMO_CONTAINER"]
106
-
107
97
  Local.capture("docker port #{container_id} 22")[/:(\d+)/, 1].to_i
108
98
  end
109
99
 
@@ -78,7 +78,7 @@ module Tomo
78
78
  end
79
79
 
80
80
  def interactive?
81
- Tomo::Console.interactive? && !ENV["_TOMO_CONTAINER"]
81
+ Tomo::Console.interactive?
82
82
  end
83
83
 
84
84
  def wait_for_exit(thread, seconds=nil)
@@ -17,7 +17,27 @@ touch /var/lib/systemd/linger/deployer
17
17
 
18
18
  # Packages needed for ruby, etc.
19
19
  apt-get -y update
20
- apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev git-core curl locales libsqlite3-dev
20
+ apt-get -y install autoconf \
21
+ bison \
22
+ build-essential \
23
+ curl \
24
+ git-core \
25
+ libdb-dev \
26
+ libffi-dev \
27
+ libgdbm-dev \
28
+ libgdbm6 \
29
+ libgmp-dev \
30
+ libncurses5-dev \
31
+ libreadline6-dev \
32
+ libsqlite3-dev \
33
+ libssl-dev \
34
+ libyaml-dev \
35
+ locales \
36
+ patch \
37
+ pkg-config \
38
+ rustc \
39
+ uuid-dev \
40
+ zlib1g-dev
21
41
 
22
42
  apt-get -y install tzdata \
23
43
  -o DPkg::options::="--force-confdef" \
data/lib/tomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.14.0".freeze
2
+ VERSION = "1.15.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.14.0
4
+ version: 1.15.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: 2022-10-01 00:00:00.000000000 Z
11
+ date: 2023-02-07 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
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.3.21
192
+ rubygems_version: 3.4.3
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: A friendly CLI for deploying Rails apps ✨