vhost 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vhost +15 -0
- data/lib/vhost.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a27db3605a2ab07093455c7ae95a39bc60e38372
|
4
|
+
data.tar.gz: 4ba7454add6f822ae2f3595c6ac84da9fc8e098d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573f1531bc2120cd63e7b559d86927e74df8827ea8348b3655b89381c4d712b763ea7adb3d6af4aa0456c1ded0738ff484dc1f71d6a71f5e3a7eacdfac479a82
|
7
|
+
data.tar.gz: d809941d1581fe2392abc43641fd00122f295e310f1b1c494d20b2063c86c7d2eb2c8e9279cbfb848e37f88e5a7362802f0d43160a65749b27be500efd314ccf
|
data/bin/vhost
CHANGED
@@ -22,6 +22,7 @@ OptionParser.new do |opts|
|
|
22
22
|
opts.on "--list-enabled", "List sites enabled" do |o| options[:liste] = o end
|
23
23
|
opts.on "-i", "--info", "Show vhost info" do |o| options[:info] = o end
|
24
24
|
opts.on "-f", "--folder", "Show folder" do |o| options[:show] = o end
|
25
|
+
opts.on "-t FILE", "--template FILE", "Use template" do |o| options[:temp] = o end
|
25
26
|
|
26
27
|
# ==========================
|
27
28
|
# = Configuration Options: =
|
@@ -74,6 +75,20 @@ def puts(*args)
|
|
74
75
|
super(*args) unless @options[:quiet]
|
75
76
|
end
|
76
77
|
|
78
|
+
if options[:temp]
|
79
|
+
|
80
|
+
template = Dir[File.join(Vhost.conf_path, 'templates', "#{options[:temp]}*")].first
|
81
|
+
abort "Can't find that template" unless template
|
82
|
+
|
83
|
+
if options[:modify]
|
84
|
+
system Vhost.conf['editor'], template
|
85
|
+
exit
|
86
|
+
end
|
87
|
+
|
88
|
+
Vhost.conf['default_template'] = File.basename(template)
|
89
|
+
|
90
|
+
end
|
91
|
+
|
77
92
|
if options[:create]
|
78
93
|
vhost = Vhost.find(ARGV[0])
|
79
94
|
abort "#{vhost.basename} exists!" if Vhost.find(ARGV[0])
|
data/lib/vhost.rb
CHANGED
@@ -9,7 +9,7 @@ class Vhost
|
|
9
9
|
require 'erubis'
|
10
10
|
require 'yaml'
|
11
11
|
|
12
|
-
VERSION = "1.1.
|
12
|
+
VERSION = "1.1.4"
|
13
13
|
CONF_NAME = "vhosts.yml"
|
14
14
|
CONFIG_PATHS = [
|
15
15
|
'vhosts-conf',
|
@@ -65,6 +65,10 @@ class Vhost
|
|
65
65
|
@@config_file
|
66
66
|
end
|
67
67
|
|
68
|
+
def self.conf_path
|
69
|
+
@@config_path
|
70
|
+
end
|
71
|
+
|
68
72
|
def self.save_conf
|
69
73
|
File.open @@config_file, "w" do |file|
|
70
74
|
file.write @@conf.to_yaml
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vhost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Clink
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.7'
|
41
|
-
description: Create,
|
41
|
+
description: Create, enable, disable, and delete virtual hosts with ease.
|
42
42
|
email: code@alexclink.com
|
43
43
|
executables:
|
44
44
|
- vhost
|
@@ -57,7 +57,7 @@ metadata: {}
|
|
57
57
|
post_install_message:
|
58
58
|
rdoc_options: []
|
59
59
|
require_paths:
|
60
|
-
-
|
60
|
+
- vhosts-conf
|
61
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
62
|
requirements:
|
63
63
|
- - ">="
|