bard 0.43.0 → 0.45.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d2474f2bb81c20829b7ca09fff60ecfce5591b079eabc5b278f84264a85af47
4
- data.tar.gz: a2a64f425e92a13bd2fb13a8e31cf26c6515eb382612b5bb805e626be2df7447
3
+ metadata.gz: af285a9be6fd5c94ebc93568595c84d702ff20c607231434842ef65410a7058c
4
+ data.tar.gz: 9166e03611d5bae5fe322d91cb2e857b66f944eee1e44927c840efc5a5d96517
5
5
  SHA512:
6
- metadata.gz: e6d10bdee8db0cd11175325e41ae74f34543f20be0b5dd6f37ef52e51c67ffad1690d7a608df746d811846044c3627efee8328ae2b6c6cea5db45122db8e58fd
7
- data.tar.gz: 05e02cc97bc25bb51a6794effd9a29ad466fab9909193028b3d6151c51cb0e20224639a40d6732c86b0307084743a9a113aae5a6f61eff6ff954d8779edf9b2e
6
+ metadata.gz: c2e69c58d3420fd97ccb7c10c77cb6054397ce00559001ba396d6ac271b6dd2d352e7dee6ba39b1ebf945e1e03499225c51a0ed222d01dedc6cc6d495b70acb4
7
+ data.tar.gz: ef11a564213ff3aee0c355ef2812d26e473efe625dece190dea86ac1aea5a8e158bb34571d7b5f005e2affa79f56904cf0776756a8be69457fab7ab94177a440
data/lib/bard.rb CHANGED
@@ -14,7 +14,8 @@ class Bard::CLI < Thor
14
14
  end
15
15
 
16
16
  desc "data [FROM=production, TO=local]", "copy database and assets from FROM to TO"
17
- def data(from="production", to="local")
17
+ def data(from=nil, to="local")
18
+ from ||= @config.servers.key?(:production) ? "production" : "staging"
18
19
  Data.new(self, from, to).call
19
20
  end
20
21
 
@@ -125,6 +126,13 @@ class Bard::CLI < Thor
125
126
  end
126
127
  end
127
128
 
129
+ desc "open [SERVER=production]", "opens the url in the web browser."
130
+ def open server=nil
131
+ server ||= @config.servers.key?(:production) ? :production : :staging
132
+ server = @config.servers[server.to_sym]
133
+ exec "xdg-open #{server.default_ping}"
134
+ end
135
+
128
136
  desc "hurt", "reruns a command until it fails"
129
137
  def hurt *args
130
138
  1.upto(Float::INFINITY) do |count|
@@ -170,7 +178,7 @@ class Bard::CLI < Thor
170
178
 
171
179
  command = "curl -sfL #{url} 2>&1 1>/dev/null"
172
180
  unless system command
173
- puts "#{server.to_s.capitalize} is down!"
181
+ puts "#{server.key.to_s.capitalize} is down!"
174
182
  exit 1
175
183
  end
176
184
  end
@@ -189,5 +197,10 @@ class Bard::CLI < Thor
189
197
  def download_ci_test_coverage
190
198
  rsync :from, :ci, "coverage"
191
199
  end
200
+
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`"
204
+ end
192
205
  end
193
206
 
data/lib/bard/ci.rb CHANGED
@@ -38,11 +38,11 @@ class Bard::CLI < Thor
38
38
  end
39
39
 
40
40
  def exists?
41
- `curl -s -I #{ci_host}/?token=botandrose` =~ /\b200 OK\b/
41
+ `curl -s -I #{ci_host}/` =~ /\b200 OK\b/
42
42
  end
43
43
 
44
44
  def console
45
- raw = `curl -s #{ci_host}/lastBuild/console?token=botandrose`
45
+ raw = `curl -s #{ci_host}/lastBuild/console`
46
46
  raw[%r{<pre.*?>(.+)</pre>}m, 1]
47
47
  end
48
48
 
@@ -51,17 +51,21 @@ class Bard::CLI < Thor
51
51
  private
52
52
 
53
53
  def get_last_time_elapsed
54
- response = `curl -s #{ci_host}/lastStableBuild/api/xml?token=botandrose`
54
+ response = `curl -s #{ci_host}/lastStableBuild/api/xml`
55
55
  response.match(/<duration>(\d+)<\/duration>/)
56
56
  $1 ? $1.to_i / 1000 : nil
57
57
  end
58
58
 
59
+ def auth
60
+ "botandrose:11cc2ba6ef2e43fbfbedc1f466724f6290"
61
+ end
62
+
59
63
  def ci_host
60
- "http://botandrose:thecakeisalie!@ci.botandrose.com/job/#{project_name}"
64
+ "http://#{auth}@ci.botandrose.com/job/#{project_name}"
61
65
  end
62
66
 
63
67
  def start
64
- command = "curl -s -I -X POST '#{ci_host}/buildWithParameters?token=botandrose&GIT_REF=#{sha}'"
68
+ command = "curl -s -I -X POST -L '#{ci_host}/buildWithParameters?GIT_REF=#{sha}'"
65
69
  output = `#{command}`
66
70
  @queueId = output[%r{Location: .+/queue/item/(\d+)/}, 1].to_i
67
71
  end
data/lib/bard/config.rb CHANGED
@@ -77,8 +77,14 @@ class Bard::CLI < Thor
77
77
  "http://#{uri.host}"
78
78
  end
79
79
 
80
- def path
81
- super || project_name
80
+ def path(*args)
81
+ if args.length == 1
82
+ self.path = args.first
83
+ elsif args.length == 0
84
+ super() || project_name
85
+ else
86
+ raise ArgumentError
87
+ end
82
88
  end
83
89
  end
84
90
  end
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.43.0"
2
+ VERSION = "0.45.0"
3
3
  end
4
4
 
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.43.0
4
+ version: 0.45.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: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2021-06-05 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.3
175
+ rubygems_version: 3.0.8
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: CLI to automate common development tasks.