bard 0.50.1 → 0.50.2

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: 50b30edc1cf6bd3e0466016d60120717c823055e507c495dce8c4a93b1241a86
4
- data.tar.gz: bbfe0e77025193301cc4f815af8c87cd19f37c26add1796e8b852502601f5b57
3
+ metadata.gz: 805a92390c2917eeada517a6bc16b6e2e05269d203d7865a1fa6eecd67100026
4
+ data.tar.gz: d90481a4f76a4aeaf82368c391c30e525e29565cfefbe5517aa7e88c98476031
5
5
  SHA512:
6
- metadata.gz: 12a357ad8dfac7acc1d671c85be867aea6f04e0ff3b667c313c803499959e0746addde399990e45fe1b27189bba48d4a3f1fde85e123bab4117e21d301819d11
7
- data.tar.gz: f766e6e7c93238665cfcea3a9fc006aac3cefd6d245873852fb25e7eb2c99e8c7835cfe4303e625a7ad4c7839176f94a3e1308c2a2898806c1e4918fda842b94
6
+ metadata.gz: 1863f7bf1bf5336de2227dee80ef71fb7792b11dd3c31b4102f66b898a770f860b260cec73680ea50fe1516d9aa19360130e2a12950ec0bb7d5ed3d58aaacd07
7
+ data.tar.gz: 00650d41d9add6bdffe44701a21b7649868bdf9948e84d8490a341bbb4252257171288715bd2535649f384cf8e2171460f976b70d8840278e2aa61b03c085fda
@@ -1,10 +1,32 @@
1
1
  module AptDependencies
2
+ extend self
3
+
2
4
  def self.ensure!
3
- deps = File.readlines("Aptfile", chomp: true)
4
- deps.map do |dep|
5
- "apt list #{dep} | grep '\\[installed\\]' || sudo apt install -y #{dep}"
6
- end.join(" && ")
5
+ return "true" if deps_to_install.none?
6
+ if sudo_password_required? && ENV["RAILS_ENV"] != "development"
7
+ $stderr.puts "sudo requires password! cannot install #{deps_to_install.join}"
8
+ exit 1
9
+ else
10
+ "sudo apt install -y #{deps_to_install.join}"
11
+ end
12
+ end
13
+
14
+ private
15
+
16
+ def deps_to_install
17
+ installed_deps = `apt list imagemagick thunderbird --installed 2>/dev/null`.chomp.split("\n")[1..]
18
+ .map { |line| line.split("/")[0] }
19
+ deps - installed_deps
20
+ end
21
+
22
+ def deps
23
+ @deps ||= File.readlines("Aptfile", chomp: true).select { |line| line.length > 0 }
7
24
  rescue Errno::ENOENT
8
- "true"
25
+ @deps = []
26
+ end
27
+
28
+ def sudo_password_required?
29
+ !system("sudo -n true 2>/dev/null")
9
30
  end
10
31
  end
32
+
@@ -147,7 +147,7 @@ class Bard::CLI < Thor
147
147
  uri = if path =~ /^http/
148
148
  URI(path)
149
149
  else
150
- URI("https://api.github.com/repos/botandrose/#{project_name}/actions/#{path}")
150
+ URI("https://api.github.com/repos/botandrosedesign/#{project_name}/actions/#{path}")
151
151
  end
152
152
 
153
153
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.50.1"
2
+ VERSION = "0.50.2"
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.50.1
4
+ version: 0.50.2
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-02-28 00:00:00.000000000 Z
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor