bard 0.59.3 → 0.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bard/version.rb +1 -1
  3. data/lib/bard.rb +35 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38956ca84edead7bc46197a53aff83f1684eae930e8fed10d230091b4ec3af50
4
- data.tar.gz: '095c71e86c3eb768809b37702dc5e45639ca8697677dfbb3941d1a7cb6e28fbe'
3
+ metadata.gz: 3c445b041aef13bee1cdf19f908b3466b0929c293e22203e8ed283e941466c58
4
+ data.tar.gz: 023d509790ce071eeaf444913491d68f804a6be8c537f3ffc6fb86f3e28122fe
5
5
  SHA512:
6
- metadata.gz: b3f6f485712f5a5cc6343fcadfd989041da32f303d87291af7b093f8d5a6238ec0e71ae117e6993a635222abcfe2e2b1b1261d948bd0a4fed1905cf6649369ca
7
- data.tar.gz: 3002ddf4ce77835ef490f623090ed3ce249d90825f41f45428d49f0cabad1b51ecc5815d86ce84c857950dfdc641522ff7d0814c43d6a2bb2394f5de30ec780c
6
+ metadata.gz: 0620563e94221dad45f3858c54c1ae24ecd5e2bc58ef19f54b45a66f323b8aff6fad42a1283192e2594701badbfa0687a7859df89f5d61ee04aa8737996020ca
7
+ data.tar.gz: d431dff261d6fe7ee217e414e61f5534a20d4aaa8bbab7bddd14d263a371f4a7a916c91681ebc3fa0e7aaee4e8b5df79bce1b8193a18b603e1e7c8d57a9fd9a1
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.59.3"
2
+ VERSION = "0.60.0"
3
3
  end
4
4
 
data/lib/bard.rb CHANGED
@@ -8,6 +8,8 @@ require "bard/data"
8
8
  require "bard/config"
9
9
 
10
10
  class Bard::CLI < Thor
11
+ include Thor::Actions
12
+
11
13
  def initialize(*args, **kwargs, &block)
12
14
  super
13
15
  @config = Config.new(project_name, "bard.rb")
@@ -171,6 +173,37 @@ class Bard::CLI < Thor
171
173
  system "cp -R #{github_files_path} ./"
172
174
  end
173
175
 
176
+ desc "setup", "installs app in nginx"
177
+ def setup
178
+ path = "/etc/nginx/sites-available/#{project_name}"
179
+ dest_path = path.sub("sites-available", "sites-enabled")
180
+ server_name = "#{project_name}.localhost"
181
+
182
+ create_file path, <<~NGINX
183
+ server {
184
+ listen 80;
185
+ server_name #{server_name};
186
+
187
+ root #{Dir.pwd}/public;
188
+ passenger_enabled on;
189
+
190
+ location ~* \\.(ico|css|js|gif|jp?g|png|webp) {
191
+ access_log off;
192
+ if ($request_filename ~ "-[0-9a-f]{32}\\.") {
193
+ expires max;
194
+ add_header Cache-Control public;
195
+ }
196
+ }
197
+ gzip_static on;
198
+ }
199
+ NGINX
200
+
201
+ FileUtils.ln_sf(path, dest_path) if !File.exist?(dest_path)
202
+ run "service nginx restart"
203
+ rescue Errno::EACCES
204
+ raise InvocationError.new("please re-run with sudo")
205
+ end
206
+
174
207
  desc "ping [SERVER=production]", "hits the server over http to verify that its up."
175
208
  def ping server=:production
176
209
  server = @config.servers[server.to_sym]
@@ -209,5 +242,7 @@ class Bard::CLI < Thor
209
242
  def vim branch="master"
210
243
  exec "vim -p `git diff #{branch} --name-only | grep -v sass$ | tac`"
211
244
  end
245
+
246
+ def self.exit_on_failure? = true
212
247
  end
213
248
 
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.59.3
4
+ version: 0.60.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: 2024-04-01 00:00:00.000000000 Z
11
+ date: 2024-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor