bard 0.59.3 → 0.60.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bard/version.rb +1 -1
- data/lib/bard.rb +35 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c445b041aef13bee1cdf19f908b3466b0929c293e22203e8ed283e941466c58
|
4
|
+
data.tar.gz: 023d509790ce071eeaf444913491d68f804a6be8c537f3ffc6fb86f3e28122fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0620563e94221dad45f3858c54c1ae24ecd5e2bc58ef19f54b45a66f323b8aff6fad42a1283192e2594701badbfa0687a7859df89f5d61ee04aa8737996020ca
|
7
|
+
data.tar.gz: d431dff261d6fe7ee217e414e61f5534a20d4aaa8bbab7bddd14d263a371f4a7a916c91681ebc3fa0e7aaee4e8b5df79bce1b8193a18b603e1e7c8d57a9fd9a1
|
data/lib/bard/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|