bard 0.45.1 → 0.47.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bard/base.rb +8 -3
- data/lib/bard/config.rb +2 -2
- data/lib/bard/version.rb +1 -1
- data/lib/bard.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30db9f340faac772ea3260d4684fbe069eff20c418f81940070d087c22537881
|
4
|
+
data.tar.gz: 37a0849b559a8f53080fdff3dded230053d004440eb6b74276745b5578ddb3ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6b419ea8c5cf37c5a51c3f89abec27c7505a9a973ce05bcffaddb2a5f43d4307d640a280b74b418e2cc9119b84669d9b1cf358b786006f82ad06e5f282a6136
|
7
|
+
data.tar.gz: 483be73924429a4e788efcc833ccd9aba2229bb7be2cd9e46d9b5147be366dee6b6d137b7753fc8c6c90f25644596064a7fd6e8d6e94d37ecc1f11947ee9d6cd
|
data/lib/bard/base.rb
CHANGED
@@ -29,8 +29,10 @@ class Bard::CLI < Thor
|
|
29
29
|
def ssh_command server, command, home: false
|
30
30
|
server = @config.servers[server.to_sym]
|
31
31
|
uri = URI.parse("ssh://#{server.ssh}")
|
32
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key} " : ""
|
33
|
+
command = "#{server.env} #{command}" if server.env
|
32
34
|
command = "cd #{server.path} && #{command}" unless home
|
33
|
-
command = "ssh -tt #{"-p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} '#{command}'"
|
35
|
+
command = "ssh -tt #{ssh_key}#{"-p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} '#{command}'"
|
34
36
|
if server.gateway
|
35
37
|
uri = URI.parse("ssh://#{server.gateway}")
|
36
38
|
command = "ssh -tt #{" -p#{uri.port} " if uri.port}#{uri.user}@#{uri.host} \"#{command}\""
|
@@ -45,12 +47,14 @@ class Bard::CLI < Thor
|
|
45
47
|
port = uri.port ? "-p#{uri.port}" : ""
|
46
48
|
gateway = server.gateway ? "-oProxyCommand='ssh #{port} #{uri.user}@#{uri.host} -W %h:%p'" : ""
|
47
49
|
|
50
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key}" : ""
|
51
|
+
|
48
52
|
uri = URI.parse("ssh://#{server.ssh}")
|
49
53
|
port = uri.port ? "-P#{uri.port}" : ""
|
50
54
|
from_and_to = [path, "#{uri.user}@#{uri.host}:#{server.path}/#{path}"]
|
51
55
|
|
52
56
|
from_and_to.reverse! if direction == :from
|
53
|
-
command = "scp #{gateway} #{port} #{from_and_to.join(" ")}"
|
57
|
+
command = "scp #{gateway} #{ssh_key} #{port} #{from_and_to.join(" ")}"
|
54
58
|
|
55
59
|
run_crucial command
|
56
60
|
end
|
@@ -62,9 +66,10 @@ class Bard::CLI < Thor
|
|
62
66
|
port = uri.port ? "-p#{uri.port}" : ""
|
63
67
|
gateway = server.gateway ? "-oProxyCommand=\"ssh #{port} #{uri.user}@#{uri.host} -W %h:%p\"" : ""
|
64
68
|
|
69
|
+
ssh_key = server.ssh_key ? "-i #{server.ssh_key}" : ""
|
65
70
|
uri = URI.parse("ssh://#{server.ssh}")
|
66
71
|
port = uri.port ? "-p#{uri.port}" : ""
|
67
|
-
ssh = "-e'ssh #{port} #{gateway}'"
|
72
|
+
ssh = "-e'ssh #{ssh_key} #{port} #{gateway}'"
|
68
73
|
|
69
74
|
dest_path = path.dup
|
70
75
|
dest_path = "./#{dest_path}"
|
data/lib/bard/config.rb
CHANGED
@@ -57,7 +57,7 @@ class Bard::CLI < Thor
|
|
57
57
|
instance_eval File.read(File.expand_path(path)) if File.exist?(path)
|
58
58
|
end
|
59
59
|
|
60
|
-
class Server < Struct.new(:project_name, :key, :ssh, :path, :ping, :gateway)
|
60
|
+
class Server < Struct.new(:project_name, :key, :ssh, :path, :ping, :gateway, :ssh_key, :env)
|
61
61
|
def self.setting *fields
|
62
62
|
fields.each do |field|
|
63
63
|
define_method field do |*args|
|
@@ -72,7 +72,7 @@ class Bard::CLI < Thor
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
setting :ssh, :path, :ping, :gateway
|
75
|
+
setting :ssh, :path, :ping, :gateway, :ssh_key, :env
|
76
76
|
|
77
77
|
def default_ping
|
78
78
|
uri = URI.parse("ssh://#{ssh}")
|
data/lib/bard/version.rb
CHANGED
data/lib/bard.rb
CHANGED
@@ -199,8 +199,8 @@ class Bard::CLI < Thor
|
|
199
199
|
end
|
200
200
|
|
201
201
|
desc "vim", "open all files that have changed since master"
|
202
|
-
def vim
|
203
|
-
exec "vim -p `git diff
|
202
|
+
def vim branch="master"
|
203
|
+
exec "vim -p `git diff #{branch} --name-only | grep -v sass$ | tac`"
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.47.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
|
-
rubygems_version: 3.
|
175
|
+
rubygems_version: 3.2.32
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: CLI to automate common development tasks.
|