tomo 1.6.0 → 1.7.0

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: c6e4c4920127adec0015456e7b666ecf2f58f7459c347d62b04ad337cdf8818c
4
- data.tar.gz: e153c6374dcd288ce08125c70c973fb60f4f9d389020f19261d63dba97b1e925
3
+ metadata.gz: e119875699293814b739fd1e11efef613df94aa2172c769180c83937f91ce384
4
+ data.tar.gz: 8674bc37cdede9eb970ce62c102f7f856cd74af5847a9f7563e653b59169be3b
5
5
  SHA512:
6
- metadata.gz: eb670d2ab71b34098caee98bf44d47cc6a6a7c2e857541d33b9394588b4b294375ab91dbd1c071080fc5f70d893acf80acca09b1a863e99ad7c7994f6e7c6991
7
- data.tar.gz: 14082e3582721a2816cfee25b8a613a8fc267e97e4b317b1cc87833f7150dd9ecee3af751ba123d4da06ea515d9d1913bda80cd9187311a9e9ab636a31b0b48e
6
+ metadata.gz: 0722d662a66bcb60cf8e4dbacf6fccfc3640db1720b6673819637cb6f82b35ff3a4b2f09a4e122d0979bad5f29e5fde82aacdb06fd505bc20d3cfb2aec5d1ec7
7
+ data.tar.gz: 0d62e317b89ad43736dc6d6500f4377d108752c2e332e9d04f27aabec30136195b5042ac55a06ab4779fa6c5bbbe33473eb11a7e1b5e3f3f1beeb77d54eba98a
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Matt Brictson
3
+ Copyright (c) 2021 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
@@ -100,8 +100,13 @@ module Tomo
100
100
  Gem::Requirement.new(">= 2.2").satisfied_by?(erb_version)
101
101
  end
102
102
 
103
- def ruby_version_file?
104
- File.exist?(".ruby-version")
103
+ # Does a .ruby-version file exist match the executing RUBY_VERSION?
104
+ def using_ruby_version_file?
105
+ return false unless File.exist?(".ruby-version")
106
+
107
+ IO.read(".ruby-version").rstrip == RUBY_VERSION
108
+ rescue IOError
109
+ false
105
110
  end
106
111
 
107
112
  def config_rb_template(app)
@@ -17,11 +17,22 @@ module Tomo
17
17
  private
18
18
 
19
19
  def gem_suggestion
20
- if Tomo.bundled?
21
- "\nYou may need to add #{yellow(gem_name)} to your Gemfile."
22
- else
23
- "\nYou may need to install the #{yellow(gem_name)} gem."
20
+ return "\nYou may need to add #{yellow(gem_name)} to your Gemfile." if Tomo.bundled?
21
+
22
+ messages = ["\nYou may need to install the #{yellow(gem_name)} gem."]
23
+ if present_in_gemfile?
24
+ messages << "\nTry prefixing the tomo command with #{blue('bundle exec')} to fix this error."
24
25
  end
26
+
27
+ messages.join
28
+ end
29
+
30
+ def present_in_gemfile?
31
+ return false unless File.file?("Gemfile")
32
+
33
+ IO.read("Gemfile").match?(/^\s*gem ['"]#{Regexp.quote(gem_name)}['"]/)
34
+ rescue IOError
35
+ false
25
36
  end
26
37
  end
27
38
  end
@@ -38,6 +38,10 @@ module Tomo::Plugin::Puma
38
38
  remote.attach "journalctl", "-q", raw("--user-unit=#{service.name.shellescape}"), *settings[:run_args]
39
39
  end
40
40
 
41
+ def tail_log
42
+ remote.attach "journalctl -q --user-unit=#{service.name.shellescape} -f"
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def port
@@ -14,7 +14,7 @@ host "user@hostname.or.ip.address"
14
14
 
15
15
  set application: <%= app.inspect %>
16
16
  set deploy_to: "/var/www/%{application}"
17
- <% unless ruby_version_file? -%>
17
+ <% unless using_ruby_version_file? -%>
18
18
  set rbenv_ruby_version: <%= RUBY_VERSION.inspect %>
19
19
  <% end -%>
20
20
  set nodenv_node_version: <%= node_version&.inspect || "nil # FIXME" %>
@@ -1,3 +1,3 @@
1
1
  module Tomo
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.7.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.6.0
4
+ version: 1.7.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: 2021-01-01 00:00:00.000000000 Z
11
+ date: 2021-01-31 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
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  - !ruby/object:Gem::Version
189
189
  version: '0'
190
190
  requirements: []
191
- rubygems_version: 3.2.3
191
+ rubygems_version: 3.2.7
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: A friendly CLI for deploying Rails apps ✨