tomo 1.1.2 → 1.2.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 +4 -4
- data/README.md +5 -5
- data/lib/tomo/cli.rb +1 -1
- data/lib/tomo/commands/init.rb +24 -1
- data/lib/tomo/configuration/plugin_resolver.rb +1 -1
- data/lib/tomo/configuration/plugins_registry/gem_resolver.rb +1 -1
- data/lib/tomo/plugin/bundler/tasks.rb +1 -1
- data/lib/tomo/plugin/git.rb +1 -1
- data/lib/tomo/plugin/rails/tasks.rb +4 -0
- data/lib/tomo/templates/config.rb.erb +7 -1
- data/lib/tomo/version.rb +1 -1
- metadata +4 -130
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 115894083bfa6e3a5bae19a6f13bcdecb64cafa048330a5983ff06c56c0a4afd
|
4
|
+
data.tar.gz: a56fd377d7af6322c87864993d84f63320d44684d61aa93e43b5b455f3831cef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a126544a598ca800627fb65602793ef52929f89d8fc4dd4efff32cae78e667a48987e8a1acea1541897125c6b3402ef57703f691db2b6d143044b6dc4433feb6
|
7
|
+
data.tar.gz: '0582041ef4e25413d349e9799335d0a9794e926a7bfe54b0a67f4287a0146cf91be246b1df118debf19cec53e5088eba474a8214dd9111b4dd4952480d7e37af'
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/tomo)
|
4
4
|
[](https://travis-ci.org/mattbrictson/tomo)
|
5
|
-
[](https://app.circleci.com/pipelines/github/mattbrictson/tomo?branch=
|
5
|
+
[](https://app.circleci.com/pipelines/github/mattbrictson/tomo?branch=main)
|
6
6
|
[](https://codeclimate.com/github/mattbrictson/tomo)
|
7
7
|
|
8
8
|
Tomo is a friendly command-line tool for deploying Rails apps. It is a new alternative to Capistrano, Mina, and Shipit that aims for simplicity and developer happiness.
|
@@ -64,7 +64,7 @@ host "user@hostname.or.ip.address"
|
|
64
64
|
set application: "my-rails-app"
|
65
65
|
set deploy_to: "/var/www/%{application}"
|
66
66
|
set git_url: "git@github.com:my-username/my-rails-app.git"
|
67
|
-
set git_branch: "
|
67
|
+
set git_branch: "main"
|
68
68
|
# ...
|
69
69
|
|
70
70
|
setup do
|
@@ -225,7 +225,7 @@ Next run `tomo setup` for _both_ apps; this will set everything up for both user
|
|
225
225
|
|
226
226
|
## Support
|
227
227
|
|
228
|
-
This project is a labor of love and I can only spend a few hours a week maintaining it, at most. If you'd like to help by submitting a pull request, or if you've discovered a bug that needs my attention, please let me know. Check out [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/
|
228
|
+
This project is a labor of love and I can only spend a few hours a week maintaining it, at most. If you'd like to help by submitting a pull request, or if you've discovered a bug that needs my attention, please let me know. Check out [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/main/CONTRIBUTING.md) to get started. Happy hacking! —Matt
|
229
229
|
|
230
230
|
## License
|
231
231
|
|
@@ -233,8 +233,8 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
233
233
|
|
234
234
|
## Code of conduct
|
235
235
|
|
236
|
-
Everyone interacting in the Tomo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattbrictson/tomo/blob/
|
236
|
+
Everyone interacting in the Tomo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mattbrictson/tomo/blob/main/CODE_OF_CONDUCT.md).
|
237
237
|
|
238
238
|
## Contribution guide
|
239
239
|
|
240
|
-
Interested in filing a bug report, feature request, or opening a PR? Excellent! Please read the short [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/
|
240
|
+
Interested in filing a bug report, feature request, or opening a PR? Excellent! Please read the short [CONTRIBUTING.md](https://github.com/mattbrictson/tomo/blob/main/CONTRIBUTING.md) guidelines before you dive in.
|
data/lib/tomo/cli.rb
CHANGED
@@ -55,7 +55,7 @@ module Tomo
|
|
55
55
|
argv << "" if argv.shift == "--complete"
|
56
56
|
end
|
57
57
|
|
58
|
-
def lookup_command(argv)
|
58
|
+
def lookup_command(argv)
|
59
59
|
command_name = argv.first unless Completions.active? && argv.length == 1
|
60
60
|
command_name = Abbrev.abbrev(COMMANDS.keys)[command_name]
|
61
61
|
argv.shift if command_name
|
data/lib/tomo/commands/init.rb
CHANGED
@@ -70,6 +70,14 @@ module Tomo
|
|
70
70
|
nil
|
71
71
|
end
|
72
72
|
|
73
|
+
def git_branch
|
74
|
+
return unless File.file?(".git/config")
|
75
|
+
|
76
|
+
`git rev-parse --abbrev-ref HEAD`.chomp
|
77
|
+
rescue SystemCallError
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
|
73
81
|
def node_version
|
74
82
|
`node --version`.chomp.sub(/^v/i, "")
|
75
83
|
rescue SystemCallError
|
@@ -82,10 +90,25 @@ module Tomo
|
|
82
90
|
nil
|
83
91
|
end
|
84
92
|
|
93
|
+
def rubocop?
|
94
|
+
File.exist?(".rubocop.yml")
|
95
|
+
end
|
96
|
+
|
97
|
+
def erb_2_2_or_later?
|
98
|
+
erb_version = Gem::Version.new(ERB.version[/\d[\d.]+/])
|
99
|
+
Gem::Requirement.new(">= 2.2").satisfied_by?(erb_version)
|
100
|
+
end
|
101
|
+
|
85
102
|
def config_rb_template(app)
|
86
103
|
path = File.expand_path("../templates/config.rb.erb", __dir__)
|
87
104
|
template = IO.read(path)
|
88
|
-
|
105
|
+
|
106
|
+
# TODO: remove once we drop Ruby 2.5 support?
|
107
|
+
if erb_2_2_or_later?
|
108
|
+
ERB.new(template, trim_mode: "-").result(binding)
|
109
|
+
else
|
110
|
+
ERB.new(template, nil, "-").result(binding)
|
111
|
+
end
|
89
112
|
end
|
90
113
|
end
|
91
114
|
end
|
@@ -39,7 +39,7 @@ module Tomo
|
|
39
39
|
def constantize(path)
|
40
40
|
parts = path.split("/")
|
41
41
|
parts.reduce(Object) do |parent, part|
|
42
|
-
child = part.gsub(/^[a-z]|_[a-z]/) { |str| str.
|
42
|
+
child = part.gsub(/^[a-z]|_[a-z]/) { |str| str[-1].upcase }
|
43
43
|
parent.const_get(child, false)
|
44
44
|
end
|
45
45
|
end
|
@@ -39,7 +39,7 @@ module Tomo
|
|
39
39
|
def constantize(path)
|
40
40
|
parts = path.split("/")
|
41
41
|
parts.reduce(Object) do |parent, part|
|
42
|
-
child = part.gsub(/^[a-z]|_[a-z]/) { |str| str.
|
42
|
+
child = part.gsub(/^[a-z]|_[a-z]/) { |str| str[-1].upcase }
|
43
43
|
parent.const_get(child, false)
|
44
44
|
end
|
45
45
|
end
|
data/lib/tomo/plugin/git.rb
CHANGED
@@ -7,7 +7,7 @@ module Tomo::Plugin
|
|
7
7
|
|
8
8
|
helpers Tomo::Plugin::Git::Helpers
|
9
9
|
tasks Tomo::Plugin::Git::Tasks
|
10
|
-
defaults git_branch:
|
10
|
+
defaults git_branch: nil,
|
11
11
|
git_repo_path: "%{deploy_to}/git_repo",
|
12
12
|
git_exclusions: [],
|
13
13
|
git_env: { GIT_SSH_COMMAND: "ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no" },
|
@@ -8,6 +8,10 @@ module Tomo::Plugin::Rails
|
|
8
8
|
remote.rails("console", settings[:run_args], attach: true)
|
9
9
|
end
|
10
10
|
|
11
|
+
def db_console
|
12
|
+
remote.rails("dbconsole", "--include-password", settings[:run_args], attach: true)
|
13
|
+
end
|
14
|
+
|
11
15
|
def db_migrate
|
12
16
|
remote.rake("db:migrate")
|
13
17
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
<% if rubocop? -%>
|
2
|
+
# rubocop:disable Style/FormatStringToken
|
3
|
+
<% end -%>
|
1
4
|
plugin "git"
|
2
5
|
plugin "env"
|
3
6
|
plugin "bundler"
|
@@ -15,7 +18,7 @@ set rbenv_ruby_version: <%= RUBY_VERSION.inspect %>
|
|
15
18
|
set nodenv_node_version: <%= node_version&.inspect || "nil # FIXME" %>
|
16
19
|
set nodenv_yarn_version: <%= yarn_version.inspect %>
|
17
20
|
set git_url: <%= git_origin_url&.inspect || "nil # FIXME" %>
|
18
|
-
set git_branch: "
|
21
|
+
set git_branch: <%= git_branch&.inspect || "nil # FIXME" %>
|
19
22
|
set git_exclusions: %w[
|
20
23
|
.tomo/
|
21
24
|
spec/
|
@@ -72,3 +75,6 @@ deploy do
|
|
72
75
|
run "bundler:clean"
|
73
76
|
run "core:log_revision"
|
74
77
|
end
|
78
|
+
<% if rubocop? -%>
|
79
|
+
# rubocop:enable Style/FormatStringToken
|
80
|
+
<% end -%>
|
data/lib/tomo/version.rb
CHANGED
metadata
CHANGED
@@ -1,141 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.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: 2020-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '2.0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '2.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: concurrent-ruby
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.1'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.1'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '5.11'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '5.11'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: minitest-ci
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.4'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3.4'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: minitest-reporters
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.3'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '1.3'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rake
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '13.0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '13.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rubocop
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.85.1
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.85.1
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rubocop-minitest
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - '='
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: 0.9.0
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - '='
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: 0.9.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rubocop-performance
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - '='
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 1.6.1
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - '='
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 1.6.1
|
11
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
139
13
|
description: Tomo is a feature-rich deployment tool that contains everything you need
|
140
14
|
to deploy a basic Rails app out of the box. It has an opinionated, production-tested
|
141
15
|
set of defaults, but is easily extensible via a well-documented plugin system. Unlike
|
@@ -298,7 +172,7 @@ metadata:
|
|
298
172
|
bug_tracker_uri: https://github.com/mattbrictson/tomo/issues
|
299
173
|
changelog_uri: https://github.com/mattbrictson/tomo/releases
|
300
174
|
source_code_uri: https://github.com/mattbrictson/tomo
|
301
|
-
homepage_uri: https://
|
175
|
+
homepage_uri: https://github.com/mattbrictson/tomo
|
302
176
|
documentation_uri: https://tomo-deploy.com/
|
303
177
|
post_install_message:
|
304
178
|
rdoc_options: []
|