bard 0.64.1 → 0.65.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: c9d061d17e01a9c194b56cbc5c86ed626e390048c939453f6af87a7b9a136f24
4
- data.tar.gz: 89cbc27d550599e4a8c2eb5287969d19dafdb2176f37d0f65c606966d77542a8
3
+ metadata.gz: 846754c2ad0d14dc0df687db107e05ecad69a9122540fba07b2362b83ff7b4a0
4
+ data.tar.gz: 04da3c9f2faa9d2d698d6d08442360a69bbe114e0333b6730257bc9b3ff18e35
5
5
  SHA512:
6
- metadata.gz: 468913ca2b377d72a317fa44c73a7602445f4a9479d260326be1044598feb727aa13a2d35bebd65d06120eb50ade5960e767ff292f664e602ad394f96a996130
7
- data.tar.gz: d322765c29287237823708b6cb71887d8662445826e61d726c0acfd819526062ffec20a5e79a33f404f959969d8b45ecc9d70f21506f2f9312027c16eab85111
6
+ metadata.gz: e742ede7bf2afc73dd8e68e60991ef1b13a819df55b0adea253b58ba70e5102a0139bdb26fcd10e2fe51574cd7a69262224484f6b6855794d930e57bd6739ab1
7
+ data.tar.gz: 17de7f6f053b646ccdf948197846f0890c2d765e86098a8b41b23d9063bfb376e16dd42bb912b7ad7ce65fc0fcfb84514b43fcac67dd187750f49d280f5c992e
data/lib/bard/config.rb CHANGED
@@ -81,12 +81,10 @@ module Bard
81
81
  setting :ssh, :path, :ping, :gateway, :ssh_key, :env
82
82
 
83
83
  def ping(*args)
84
- if args.length == 1
85
- self.ping = args.first
86
- elsif args.length == 0
87
- normalize_ping(super())
84
+ if args.length == 0
85
+ (super() || [nil]).map(&method(:normalize_ping))
88
86
  else
89
- raise ArgumentError
87
+ self.ping = args
90
88
  end
91
89
  end
92
90
 
data/lib/bard/data.rb CHANGED
@@ -3,7 +3,7 @@ class Bard::CLI < Thor
3
3
  def call
4
4
  if to == "production"
5
5
  server = bard.instance_variable_get(:@config).servers[to.to_sym]
6
- url = server.ping
6
+ url = server.ping.first
7
7
  puts bard.yellow("WARNING: You are about to push data to production, overwriting everything that is there!")
8
8
  answer = bard.ask("If you really want to do this, please type in the full HTTPS url of the production server:")
9
9
  if answer != url
data/lib/bard/ping.rb CHANGED
@@ -8,9 +8,11 @@ module Bard
8
8
  end
9
9
 
10
10
  def call
11
- return true if server.ping == false
12
- response = get_response_with_redirect(server.ping)
13
- response.is_a?(Net::HTTPSuccess)
11
+ server.ping.reject do |url|
12
+ next true if url == false
13
+ response = get_response_with_redirect(url) rescue nil
14
+ response.is_a?(Net::HTTPSuccess)
15
+ end
14
16
  end
15
17
 
16
18
  private
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.64.1"
2
+ VERSION = "0.65.0"
3
3
  end
4
4
 
data/lib/bard.rb CHANGED
@@ -138,7 +138,7 @@ class Bard::CLI < Thor
138
138
  def open server=nil
139
139
  server ||= @config.servers.key?(:production) ? :production : :staging
140
140
  server = @config.servers[server.to_sym]
141
- exec "xdg-open #{server.default_ping}"
141
+ exec "xdg-open #{server.ping.first}"
142
142
  end
143
143
 
144
144
  desc "hurt", "reruns a command until it fails"
@@ -208,10 +208,9 @@ class Bard::CLI < Thor
208
208
  desc "ping [SERVER=production]", "hits the server over http to verify that its up."
209
209
  def ping server=:production
210
210
  server = @config.servers[server.to_sym]
211
- unless Bard::Ping.call(server)
212
- puts "#{server.key.to_s.capitalize} is down!"
213
- exit 1
214
- end
211
+ down_urls = Bard::Ping.call(server)
212
+ down_urls.each { |url| puts "#{url} is down!" }
213
+ exit 1 if down_urls.any?
215
214
  end
216
215
 
217
216
  desc "master_key --from=production --to=local", "copy master key from from to to"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.1
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel