bard 0.50.2 → 0.50.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6698258c4e115c0c417131b370472ddda9319280422472c92005e2a88b48460
|
4
|
+
data.tar.gz: 54e3c1d1897cdbb7a8338c47ec5edba11c2c18b67252d0ce99be8836591845b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5af008795ac9530ee1491a3c7adf05b0fe6fd83b579cd6d3104b00517d5e5b9d67bbab58408f637d028a560ec4cd8d611b3dc7522f8def13ad2c77b3d09ac80
|
7
|
+
data.tar.gz: 23dbfce0a6cfdf9f07cec3e48a29b714c95d587db0a9998b9aa126fe7ae81079d751bcbaeab8e72e631c576e10a020894681c4ca2d8757723a16c7125387b8ba
|
@@ -4,17 +4,17 @@ module AptDependencies
|
|
4
4
|
def self.ensure!
|
5
5
|
return "true" if deps_to_install.none?
|
6
6
|
if sudo_password_required? && ENV["RAILS_ENV"] != "development"
|
7
|
-
$stderr.puts "sudo requires password! cannot install #{deps_to_install.join}"
|
7
|
+
$stderr.puts "sudo requires password! cannot install #{deps_to_install.join(' ')}"
|
8
8
|
exit 1
|
9
9
|
else
|
10
|
-
"sudo apt install -y #{deps_to_install.join}"
|
10
|
+
"sudo apt install -y #{deps_to_install.join(' ')}"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
16
|
def deps_to_install
|
17
|
-
installed_deps = `apt list
|
17
|
+
installed_deps = `apt list #{deps.join(' ')} --installed 2>/dev/null`.chomp.split("\n")[1..]
|
18
18
|
.map { |line| line.split("/")[0] }
|
19
19
|
deps - installed_deps
|
20
20
|
end
|
@@ -8,7 +8,7 @@ class Bard::CLI < Thor
|
|
8
8
|
class GithubActions < Struct.new(:project_name, :branch, :sha)
|
9
9
|
def run
|
10
10
|
api = API.new(project_name)
|
11
|
-
last_time_elapsed = api.last_successful_run
|
11
|
+
last_time_elapsed = api.last_successful_run&.time_elapsed
|
12
12
|
@run = api.create_run!(branch)
|
13
13
|
|
14
14
|
start_time = Time.new.to_i
|
@@ -35,9 +35,10 @@ class Bard::CLI < Thor
|
|
35
35
|
|
36
36
|
class API < Struct.new(:project_name)
|
37
37
|
def last_successful_run
|
38
|
-
successful_runs = client.get("runs", status: "success", per_page: 1)
|
39
|
-
json = successful_runs["workflow_runs"][0]
|
40
|
-
|
38
|
+
successful_runs = client.get("runs", event: "workflow_dispatch", status: "success", per_page: 1)
|
39
|
+
if json = successful_runs["workflow_runs"][0]
|
40
|
+
Run.new(self, json)
|
41
|
+
end
|
41
42
|
end
|
42
43
|
|
43
44
|
def find_run id
|
@@ -150,12 +151,13 @@ class Bard::CLI < Thor
|
|
150
151
|
URI("https://api.github.com/repos/botandrosedesign/#{project_name}/actions/#{path}")
|
151
152
|
end
|
152
153
|
|
154
|
+
req = nil
|
153
155
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
http.request(
|
156
|
+
req = block.call(uri)
|
157
|
+
req["Accept"] = "application/vnd.github+json"
|
158
|
+
req["Authorization"] = "Bearer #{github_apikey}"
|
159
|
+
req["X-GitHub-Api-Version"] = "2022-11-28"
|
160
|
+
http.request(req)
|
159
161
|
end
|
160
162
|
|
161
163
|
case response
|
@@ -171,7 +173,7 @@ class Bard::CLI < Thor
|
|
171
173
|
response.body
|
172
174
|
end
|
173
175
|
else
|
174
|
-
raise response.inspect
|
176
|
+
raise [req.method, req.uri, req.to_hash, response].inspect
|
175
177
|
end
|
176
178
|
end
|
177
179
|
end
|
data/lib/bard/version.rb
CHANGED
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.50.
|
4
|
+
version: 0.50.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- features/support/env.rb
|
139
139
|
- features/support/grit_ext.rb
|
140
140
|
- features/support/io.rb
|
141
|
+
- install_files/.github/workflows/cache-ci.yml
|
141
142
|
- install_files/.github/workflows/ci.yml
|
142
143
|
- install_files/apt_dependencies.rb
|
143
144
|
- install_files/ci
|
@@ -178,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
179
|
- !ruby/object:Gem::Version
|
179
180
|
version: '0'
|
180
181
|
requirements: []
|
181
|
-
rubygems_version: 3.
|
182
|
+
rubygems_version: 3.3.26
|
182
183
|
signing_key:
|
183
184
|
specification_version: 4
|
184
185
|
summary: CLI to automate common development tasks.
|