tomo 1.13.0 → 1.14.1

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: 40ab6286952126707fe78f7d1168a02d2cc07593efdb9a62fb52dbd39ea7e816
4
- data.tar.gz: 6cd99a5981d14a4a1ea0e520533f87ff7e941293bb9f5a63fbe9f9718afe13db
3
+ metadata.gz: f16c0351ed9e2f276d92b392f009490cf225c94adf318836a6556b6e92ff913b
4
+ data.tar.gz: b10e3f521efba3854ce8985680023d1e0fd79fb6e6be3acfe46e6a37a45cbd45
5
5
  SHA512:
6
- metadata.gz: d23f6506248bbb3fb112ccd2a8225d670adee6ddeca7ef2906d15c16e367da065612d8f0a2087090eb96db9cafd79a5ced35bf0a9cfa137dceb020da09422180
7
- data.tar.gz: 02be70059d804b3184fbb4898f0bc50c74c4a216034271a888a4bf68fc81dbedb5c42617226c0ed9cd99e3bf7de285e9830712cbf989fcb5b4146473a0f6a54d
6
+ metadata.gz: 880d8a3505f6f5435b2e2af09d967b5121b906f001caf71bb5cf10f43f13f0dc6802b6fb1f4a0335f3ca06ab855b8bf4995f7105b52ea6bf0a277f7f79ffef1c
7
+ data.tar.gz: 17fdc0e24d0b08f638bbeeddee49221d77dbd8c7767f3c0a79ce9378bc8c20ac86c997e52ce98267463e015a3559323ee0ff1551225772f53071623f99c29c26
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
@@ -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
data/lib/tomo/cli.rb CHANGED
@@ -36,6 +36,10 @@ module Tomo
36
36
  "completion-script" => Tomo::Commands::CompletionScript
37
37
  }.freeze
38
38
 
39
+ COMMAND_ALIASES = {
40
+ "-T" => Tomo::Commands::Tasks
41
+ }.freeze
42
+
39
43
  def call(argv)
40
44
  prepare_completions(argv)
41
45
  command, command_name = lookup_command(argv)
@@ -56,12 +60,14 @@ module Tomo
56
60
  end
57
61
 
58
62
  def lookup_command(argv)
63
+ commands = COMMANDS.merge(COMMAND_ALIASES)
64
+
59
65
  command_name = argv.first unless Completions.active? && argv.length == 1
60
- command_name = Abbrev.abbrev(COMMANDS.keys)[command_name]
66
+ command_name = Abbrev.abbrev(commands.keys)[command_name]
61
67
  argv.shift if command_name
62
68
 
63
69
  command_name = "run" if command_name.nil? && task_format?(argv.first)
64
- command = COMMANDS[command_name] || Tomo::Commands::Default
70
+ command = commands[command_name] || Tomo::Commands::Default
65
71
  [command, command_name]
66
72
  end
67
73
 
data/lib/tomo/colors.rb CHANGED
@@ -23,7 +23,7 @@ module Tomo
23
23
  def determine_color_support
24
24
  if ENV["CLICOLOR_FORCE"] == "1"
25
25
  true
26
- elsif ENV["TERM"] == "dumb"
26
+ elsif ENV["TERM"] == "dumb" || !ENV["NO_COLOR"].to_s.empty?
27
27
  false
28
28
  else
29
29
  tty?($stdout) && tty?($stderr)
@@ -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
@@ -24,7 +24,7 @@ module Tomo
24
24
 
25
25
  groups = tasks.group_by { |task| task[/^([^:]+):/, 1].to_s }
26
26
  groups.keys.sort.each do |group|
27
- puts groups[group].sort.join("\n")
27
+ logger.info(groups[group].sort.join("\n"))
28
28
  end
29
29
  end
30
30
  end
@@ -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
@@ -16,5 +16,11 @@ module Tomo::Plugin::Rails
16
16
  result = rake(*args, **opts.merge(raise_on_error: false))
17
17
  result.success?
18
18
  end
19
+
20
+ def thor(*args, **opts)
21
+ prepend("exec", "thor") do
22
+ bundle(*args, **opts)
23
+ end
24
+ end
19
25
  end
20
26
  end
@@ -44,7 +44,7 @@ module Tomo::Plugin::Rbenv
44
44
 
45
45
  def ruby_installed?(version)
46
46
  versions = remote.capture("rbenv versions", raise_on_error: false)
47
- if versions.include?(version)
47
+ if versions.match?(/^\*?\s*#{Regexp.quote(version)}\s/)
48
48
  logger.info("Ruby #{version} is already installed.")
49
49
  return true
50
50
  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)
@@ -17,7 +17,8 @@ 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 build-essential pkg-config git-core curl locales \
21
+ libffi-dev libreadline-dev libsqlite3-dev libssl-dev libyaml-dev zlib1g-dev
21
22
 
22
23
  apt-get -y install tzdata \
23
24
  -o DPkg::options::="--force-confdef" \
data/lib/tomo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.13.0".freeze
2
+ VERSION = "1.14.1".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.13.0
4
+ version: 1.14.1
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-08-28 00:00:00.000000000 Z
11
+ date: 2023-01-01 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.1
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: A friendly CLI for deploying Rails apps ✨