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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae2aaf36ed328b519c7b21dde4613e2c5f9549477d032cb5208512a8a50c23fd
4
- data.tar.gz: a8d341af27fd88167618074ed12621a3cec1c14ed80abab8bb359f2678043de2
3
+ metadata.gz: 30db9f340faac772ea3260d4684fbe069eff20c418f81940070d087c22537881
4
+ data.tar.gz: 37a0849b559a8f53080fdff3dded230053d004440eb6b74276745b5578ddb3ba
5
5
  SHA512:
6
- metadata.gz: 2f5de7283881fd2d654fe4a9c4975c9d03c110520982a9cfbb828bf1c31eb66da9aab1fa86e44218899b0ec85483105aa7efe9ec61319facf9e05c0001c8fad4
7
- data.tar.gz: 4f52fd46c07b105ae5ee32c379296785a0c06c2ba78c69a0731b8379c3577afdd7eaaddad09cb0d91d4dc2b247c0a082e1e383f9b1253beb4c94073f6b47e13e
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
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.45.1"
2
+ VERSION = "0.47.0"
3
3
  end
4
4
 
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 master --name-only | grep -v sass$ | tac`"
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.45.1
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: 2021-12-21 00:00:00.000000000 Z
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.0.8
175
+ rubygems_version: 3.2.32
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: CLI to automate common development tasks.