nginx-osx 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/HELP +1 -1
- data/VERSION +1 -1
- data/lib/nginx-osx.rb +16 -4
- data/nginx-osx.gemspec +1 -1
- metadata +1 -1
data/HELP
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/nginx-osx.rb
CHANGED
@@ -86,8 +86,20 @@ CMD
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def current_config
|
89
|
-
|
90
|
-
|
89
|
+
current_path = current_config_path
|
90
|
+
vhost_path = current_config_path(true)
|
91
|
+
|
92
|
+
path = if File.exists? current_path
|
93
|
+
current_path
|
94
|
+
elsif File.exists? vhost_path
|
95
|
+
vhost_path
|
96
|
+
end
|
97
|
+
if path
|
98
|
+
puts path
|
99
|
+
exec "cat #{path}"
|
100
|
+
else
|
101
|
+
puts "no config found have you run 'nginx-osx add' ?"
|
102
|
+
end
|
91
103
|
end
|
92
104
|
|
93
105
|
def tail_error_log
|
@@ -99,8 +111,8 @@ CMD
|
|
99
111
|
Dir.pwd.downcase.gsub(/^\//, '').gsub(/\.|\/|\s/, '-')
|
100
112
|
end
|
101
113
|
|
102
|
-
def current_config_path
|
103
|
-
host ? "/opt/local/etc/nginx/vhosts/#{current_config_name}.conf" : "/opt/local/etc/nginx/configs/#{current_config_name}.conf"
|
114
|
+
def current_config_path(vhost=false)
|
115
|
+
host || vhost ? "/opt/local/etc/nginx/vhosts/#{current_config_name}.conf" : "/opt/local/etc/nginx/configs/#{current_config_name}.conf"
|
104
116
|
end
|
105
117
|
|
106
118
|
def usage
|
data/nginx-osx.gemspec
CHANGED