gvarela-nginx-osx 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/lib/nginx-osx.rb CHANGED
@@ -34,12 +34,16 @@ USAGE:
34
34
  - restart and check the config for errors
35
35
  reload
36
36
  - reload the config and check for errors
37
+ current_config
38
+ - show vhost config of current directory
39
+ tail_error_log
40
+ - tail the main nginx error log
37
41
  USAGE
38
42
  puts usage
39
43
  end
40
44
 
41
45
  def install
42
- `sudo port install nginx`
46
+ exec "sudo port install nginx"
43
47
  end
44
48
 
45
49
  def setup
@@ -52,6 +56,8 @@ USAGE:
52
56
  end
53
57
  `mkdir -p /opt/local/etc/nginx/vhosts`
54
58
  `mkdir -p /opt/local/etc/nginx/configs`
59
+ `mkdir -p /var/log/nginx`
60
+ `sudo cp /opt/local/etc/nginx/mime.types.example /opt/local/etc/nginx/mime.types`
55
61
  `sudo /opt/local/sbin/nginx -t`
56
62
  end
57
63
 
@@ -69,27 +75,27 @@ USAGE:
69
75
  def run
70
76
  `sudo ln -fs #{current_config_path} /opt/local/etc/nginx/vhosts/current.conf`
71
77
  `sudo /opt/local/sbin/nginx -t`
72
- `sudo /opt/local/sbin/nginx`
78
+ puts `sudo /opt/local/sbin/nginx`
73
79
  end
74
80
 
75
81
  def start
76
- `sudo /opt/local/sbin/nginx`
82
+ puts `sudo /opt/local/sbin/nginx`
77
83
  end
78
84
 
79
85
  def stop
80
- `sudo killall nginx`
86
+ puts `sudo killall nginx`
81
87
  end
82
88
 
83
89
  def restart
84
90
  `sudo killall nginx`
85
91
  `sudo /opt/local/sbin/nginx -t`
86
- `sudo /opt/local/sbin/nginx`
92
+ puts `sudo /opt/local/sbin/nginx`
87
93
  end
88
94
 
89
95
  def reload
90
96
  `sudo /opt/local/sbin/nginx -t`
91
97
  pid = `ps ax | grep 'nginx: master' | grep -v grep | awk '{print $1}'`
92
- `sudo kill -HUP #{pid}` if pid
98
+ puts `sudo kill -HUP #{pid}` if pid
93
99
  end
94
100
 
95
101
  def current_config
data/nginx-osx.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{nginx-osx}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Gabe Varela"]
9
- s.date = %q{2009-07-09}
9
+ s.date = %q{2009-07-13}
10
10
  s.default_executable = %q{nginx-osx}
11
11
  s.email = %q{gvarela@gmail.com}
12
12
  s.executables = ["nginx-osx"]
@@ -20,7 +20,7 @@ events {
20
20
  http {
21
21
  # pull in mime-types. You can break out your config
22
22
  # into as many include's as you want.
23
- include /opt/local/conf/mime.types;
23
+ include /opt/local/etc/nginx/mime.types;
24
24
  # set a default type for the rare situation that nothing matches.
25
25
  default_type application/octet-stream;
26
26
  # configure log format
@@ -40,9 +40,9 @@ server {
40
40
  }
41
41
 
42
42
  # hack to prevent image 404s from getting to rails
43
- if ($request_filename ~ '(/images|\.ico|\.gif|\.jpg|\.png)') {
44
- return 404;
45
- }
43
+ #if ($request_filename ~ '(/images|\.ico|\.gif|\.jpg|\.png)') {
44
+ # return 404;
45
+ #}
46
46
 
47
47
  # Rails page caching, if file path plus index.html exists break execution and serve up file
48
48
  if (-f $request_filename/index.html) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gvarela-nginx-osx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Varela
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-09 00:00:00 -07:00
12
+ date: 2009-07-13 00:00:00 -07:00
13
13
  default_executable: nginx-osx
14
14
  dependencies: []
15
15