nginx-osx 0.2.1 → 0.2.2

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.
Files changed (5) hide show
  1. data/HELP +1 -1
  2. data/VERSION +1 -1
  3. data/lib/nginx-osx.rb +16 -4
  4. data/nginx-osx.gemspec +1 -1
  5. metadata +1 -1
data/HELP CHANGED
@@ -1,7 +1,7 @@
1
1
  USAGE:
2
2
  nginx-osx [cmd]
3
3
 
4
- install [--passenger]
4
+ install
5
5
  - install nginx via custom macports port file from crigor
6
6
  setup
7
7
  - setup the basic nginx.conf file and the vhost directories
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
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
- puts current_config_path
90
- exec "cat #{current_config_path}"
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{nginx-osx}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gabe Varela"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nginx-osx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Varela