bard 1.4.5 → 1.4.6

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: 10a46ca0d1145fbdce208fd3b3040088058a49605688d5833f04cfd220bb7235
4
- data.tar.gz: '01861cceb218abe6a962a8b0ba2a5449ec4d6d75f40dff607957a0c833cdb6a8'
3
+ metadata.gz: 45cfd2dba5d72da5661cef49002a9289ed15572ef14c7a55d4d47ecd2bf51b39
4
+ data.tar.gz: 5c731db865870f9beea50d63ec2af8461210fb0f5a0f6892554334990135273a
5
5
  SHA512:
6
- metadata.gz: b4dd3b9800cc0e172f34b52ff852189f550d1cfa3e749ca7edd1e9e6fa427155cf714c3618c422de97c37060fa97c80580cad02fc1bd13506c5ced7d67700d98
7
- data.tar.gz: '00920b1fb15c5b698d36f58d4993172be6ee5614a2668be17c7d0bd0800dd5c2150242b63e73344fc6fc37b7d7e6b67c7f7cab52c97abedebbbe9fd2a018ff55'
6
+ metadata.gz: d3524e8700422a66bc5675851297a6382eb19c1eb715c94b73be009d077b5319c186f7ff82a9ed30155c80cfcba63ddc2d64bd7c5a1d520a40603130204a36bd
7
+ data.tar.gz: ae3462ce1eda70232b466cbb06790c062d217110bcd3aa8f7848f81431700fc10ec30ff99694ae3b1616957cb258d3907d0c610430b66dde739cf15c8f5aad0b
data/lib/bard/cli/new.rb CHANGED
@@ -26,7 +26,7 @@ class Bard::CLI::New < Bard::CLI::Command
26
26
  end
27
27
 
28
28
  def create_project
29
- run! <<~BASH
29
+ run! <<~SH
30
30
  env -i bash -lc '
31
31
  export HOME=~
32
32
  cd ..
@@ -36,30 +36,30 @@ class Bard::CLI::New < Bard::CLI::Command
36
36
  gem list rails -i || gem install rails --no-document
37
37
  rails new #{project_name} --skip-git --skip-kamal --skip-test -m #{template_path}
38
38
  '
39
- BASH
39
+ SH
40
40
  end
41
41
 
42
42
  def push_to_github
43
43
  api = Bard::Github.new(project_name)
44
44
  api.create_repo
45
- run! <<~BASH
45
+ run! <<~SH
46
46
  cd ../#{project_name}
47
47
  git init -b master
48
48
  git add -A
49
49
  git commit -m"initial commit."
50
50
  git remote add origin git@github.com:botandrosedesign/#{project_name}
51
51
  git push -u origin master
52
- BASH
52
+ SH
53
53
  api.add_master_key File.read("../#{project_name}/config/master.key")
54
54
  api.add_master_branch_protection
55
55
  api.patch(nil, allow_auto_merge: true)
56
56
  end
57
57
 
58
58
  def stage
59
- run! <<~BASH
59
+ run! <<~SH
60
60
  cd ../#{project_name}
61
61
  bard deploy --clone
62
- BASH
62
+ SH
63
63
  end
64
64
 
65
65
  def ruby_version
@@ -23,10 +23,10 @@ module Bard
23
23
 
24
24
  def build_site
25
25
  system "rm -rf #{@build_dir.sub(@sha, "*")}"
26
- run! <<~BASH
26
+ run! <<~SH
27
27
  set -e
28
28
  RAILS_ENV=production bundle exec rails s -p 3000 -d --pid tmp/pids/server.pid
29
- bundle exec rake assets:clean assets:precompile
29
+ OUTPUT=$(bundle exec rake assets:clean assets:precompile 2>&1) || echo "$OUTPUT"
30
30
 
31
31
  # Create the output directory and enter it
32
32
  BUILD=#{@build_dir}
@@ -37,18 +37,19 @@ module Bard
37
37
 
38
38
  # wait until server responds
39
39
  echo waiting...
40
- curl --retry 5 --retry-delay 2 http://localhost:3000
40
+ curl -s --retry 5 --retry-delay 2 http://localhost:3000 >/dev/null 2>&1
41
41
 
42
42
  echo copying...
43
43
  # Mirror the site to the build folder, ignoring links with query params
44
- wget --reject-regex "(.*)\\?(.*)" -FEmnH http://localhost:3000/
44
+ bash -c 'set -o pipefail; wget -nv -r -l inf --no-remove-listing -FEnH --reject-regex "(\\.*)\\?(.*)" http://localhost:3000/ 2>&1 | grep -v -E "URL:|FINISHED|Total wall clock time:|Downloaded:"'
45
+
45
46
  echo #{@domain} > CNAME
46
- BASH
47
+ SH
47
48
  ensure # cleanup
48
- run! <<~BASH
49
+ run! <<~SH
49
50
  cat tmp/pids/server.pid | xargs -I {} kill {}
50
51
  rm -rf public/assets
51
- BASH
52
+ SH
52
53
  end
53
54
 
54
55
  def create_tree_from_build
@@ -6,11 +6,11 @@ class Bard::Provision::AuthorizedKeys < Bard::Provision
6
6
 
7
7
  KEYS.each do |search_text, full_key|
8
8
  file = "~/.ssh/authorized_keys"
9
- provision_server.run! <<~BASH, home: true
9
+ provision_server.run! <<~SH, home: true
10
10
  if ! grep -F -q "#{search_text}" #{file}; then
11
11
  echo "#{full_key}" >> #{file}
12
12
  fi
13
- BASH
13
+ SH
14
14
  end
15
15
 
16
16
  puts " ✓"
@@ -4,7 +4,7 @@ class Bard::Provision::LogRotation < Bard::Provision
4
4
  def call
5
5
  print "Log Rotation:"
6
6
 
7
- provision_server.run! <<~BASH, quiet: true
7
+ provision_server.run! <<~SH, quiet: true
8
8
  file=/etc/logrotate.d/#{server.project_name}
9
9
  if [ ! -f $file ]; then
10
10
  sudo tee $file > /dev/null <<EOF
@@ -20,7 +20,7 @@ class Bard::Provision::LogRotation < Bard::Provision
20
20
  }
21
21
  EOF
22
22
  fi
23
- BASH
23
+ SH
24
24
 
25
25
  puts " ✓"
26
26
  end
@@ -4,7 +4,7 @@ class Bard::Provision::Swapfile < Bard::Provision
4
4
  def call
5
5
  print "Swapfile:"
6
6
 
7
- provision_server.run! <<~BASH
7
+ provision_server.run! <<~SH
8
8
  if [ ! -f /swapfile ]; then
9
9
  sudo fallocate -l $(grep MemTotal /proc/meminfo | awk '{print $2}')K /swapfile
10
10
  fi
@@ -12,7 +12,7 @@ class Bard::Provision::Swapfile < Bard::Provision
12
12
  sudo swapon --show | grep -q '/swapfile' || sudo mkswap /swapfile
13
13
  sudo swapon --show | grep -q '/swapfile' || sudo swapon /swapfile
14
14
  grep -q '/swapfile none swap sw 0 0' /etc/fstab || echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
15
- BASH
15
+ SH
16
16
 
17
17
  puts " ✓"
18
18
  end
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.6"
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: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-30 00:00:00.000000000 Z
11
+ date: 2025-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor