bard 0.62.2 → 0.63.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: fb0639401698f2f8efedc908dec19e665c0c7e067446fa6a8e3c38e877c072c0
4
- data.tar.gz: '0510189b034d15caa908e1841f6223076a68ef429fa011dba4d6191e672d4bff'
3
+ metadata.gz: 3d7d5a0ea2e8612375c2cdff91db9018db99cbebd5c7b261eac8bd8cd759c56d
4
+ data.tar.gz: b92bf6109d27d6266ea4d5c600814fcc27c0cede6620a7cac3d2a1f829dc9604
5
5
  SHA512:
6
- metadata.gz: d99981c90eef79bf61b4fe0cda6b6ebae19baf426ec555e38209d9d60a7bebe67f83b8b991ab0ebbfec7df24d7fddf03eb1afe1085a18f63b71a2a43bff98e07
7
- data.tar.gz: 9b97be4d649e3d168327eeb63aab76bb2cf7a713540709a020dde53d143bf536c90292428636e063b7822481f06bd61046ba66593a29a6001b796d476f26d17c
6
+ metadata.gz: 78f9952dad75d7cd3b2bc3320b94101e184173edc10fab5c8d12a7c8ed1e87db17852715879fc18d446a1fa077ac9fae34b85c13ddce626ffd54bd87cc013476
7
+ data.tar.gz: 639bb68fe3c42d18d9c5709f4fae18707578496423c4982b37c97e00e981458a7dc3eee4bf7eae596c99c18efd39f0bee714c0fb47d2d721fad1b5acb0b7caa5
data/lib/bard/base.rb CHANGED
@@ -32,8 +32,8 @@ class Bard::CLI < Thor
32
32
  @project_name ||= File.expand_path(".").split("/").last
33
33
  end
34
34
 
35
- def ssh_command server, command, home: false
36
- server = @config.servers[server.to_sym]
35
+ def ssh_command server_name, command, home: false
36
+ server = @config.servers.fetch(server_name.to_sym)
37
37
  uri = URI.parse("ssh://#{server.ssh}")
38
38
  ssh_key = server.ssh_key ? "-i #{server.ssh_key} " : ""
39
39
  command = "#{server.env} #{command}" if server.env
@@ -46,8 +46,8 @@ class Bard::CLI < Thor
46
46
  command
47
47
  end
48
48
 
49
- def copy direction, server, path, verbose: false
50
- server = @config.servers[server.to_sym]
49
+ def copy direction, server_name, path, verbose: false
50
+ server = @config.servers.fetch(server_name.to_sym)
51
51
 
52
52
  uri = URI.parse("ssh://#{server.gateway}")
53
53
  port = uri.port ? "-p#{uri.port}" : ""
@@ -65,9 +65,9 @@ class Bard::CLI < Thor
65
65
  run_crucial command, verbose: verbose
66
66
  end
67
67
 
68
- def move from, to, path, verbose: false
69
- from = @config.servers[from.to_sym]
70
- to = @config.servers[to.to_sym]
68
+ def move from_name, to_name, path, verbose: false
69
+ from = @config.servers.fecth(from_name.to_sym)
70
+ to = @config.servers.fetch(to_name.to_sym)
71
71
  raise NotImplementedError if from.gateway || to.gateway || from.ssh_key || to.ssh_key
72
72
 
73
73
  from_uri = URI.parse("ssh://#{from.ssh}")
@@ -81,8 +81,8 @@ class Bard::CLI < Thor
81
81
  run_crucial command, verbose: verbose
82
82
  end
83
83
 
84
- def rsync direction, server, path, verbose: false
85
- server = @config.servers[server.to_sym]
84
+ def rsync direction, server_name, path, verbose: false
85
+ server = @config.servers.fetch(server_name.to_sym)
86
86
 
87
87
  uri = URI.parse("ssh://#{server.gateway}")
88
88
  port = uri.port ? "-p#{uri.port}" : ""
@@ -104,9 +104,9 @@ class Bard::CLI < Thor
104
104
  run_crucial command, verbose: verbose
105
105
  end
106
106
 
107
- def rsync_remote from, to, path, verbose: false
108
- from = @config.servers[from.to_sym]
109
- to = @config.servers[to.to_sym]
107
+ def rsync_remote from_name, to_name, path, verbose: false
108
+ from = @config.servers.fetch(from_name.to_sym)
109
+ to = @config.servers.fetch(to_name.to_sym)
110
110
  raise NotImplementedError if from.gateway || to.gateway || from.ssh_key || to.ssh_key
111
111
 
112
112
  dest_path = path.dup
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.62.2"
2
+ VERSION = "0.63.0"
3
3
  end
4
4
 
data/lib/bard.rb CHANGED
@@ -223,8 +223,12 @@ class Bard::CLI < Thor
223
223
  end
224
224
  end
225
225
 
226
- desc "master_key [FROM=production, TO=local]", "copy master key from FROM to TO"
227
- def master_key from="production", to="local"
226
+ desc "master_key --from=production --to=local", "copy master key from from to to"
227
+ method_options %w[from] => :string, %w[to] => :string
228
+ def master_key
229
+ default_from = @config.servers.key?(:production) ? "production" : "staging"
230
+ from = options.fetch(:from, default_from)
231
+ to = options.fetch(:to, "local")
228
232
  if to == "local"
229
233
  copy :from, from, "config/master.key"
230
234
  end
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.62.2
4
+ version: 0.63.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: 2024-08-03 00:00:00.000000000 Z
11
+ date: 2024-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor