passify 0.1.0 → 0.1.1

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.
data/README.md CHANGED
@@ -42,5 +42,12 @@ It makes sense to create a wrapper for `passify` if you are using multiple versi
42
42
 
43
43
  rvm wrapper 1.8.7 --no-prefix passify
44
44
 
45
+ ## Changelog
46
+ ### 0.1.1
47
+ * added support for legacy application
48
+
49
+ ### 0.1.0
50
+ * initial release
51
+
45
52
  ## License
46
53
  Released under the MIT License. See the LICENSE file for further details.
@@ -28,7 +28,7 @@ module Passify
28
28
  sudome
29
29
  create_vhost(host, pwd)
30
30
  register_host(host)
31
- system("apachectl graceful > /dev/null 2>&1")
31
+ restart_apache
32
32
  say "The application was successfully set up and can be reached from http://#{host} . Run `passify open #{name}` to view it."
33
33
  end
34
34
 
@@ -61,7 +61,7 @@ module Passify
61
61
  Include /private/etc/apache2/passenger_pane_vhosts/*.conf
62
62
  </IfModule>
63
63
  eos
64
- system("apachectl graceful > /dev/null 2>&1")
64
+ restart_apache
65
65
  FileUtils.mkdir_p(VHOSTS_DIR)
66
66
  say "The installation of passify is complete."
67
67
  end
@@ -81,7 +81,7 @@ module Passify
81
81
  FileUtils.mkdir_p('tmp')
82
82
  system "touch tmp/restart.txt"
83
83
  end
84
-
84
+
85
85
  desc "list", "Lists all applications served with passify."
86
86
  def list
87
87
  error("Passify is currently not installed. Please run `passify install` first.") unless passify_installed?
@@ -136,6 +136,8 @@ module Passify
136
136
  true
137
137
  elsif is_rails2_app?
138
138
  true
139
+ elsif is_legacy_app?
140
+ true
139
141
  else
140
142
  false
141
143
  end
@@ -149,6 +151,10 @@ module Passify
149
151
  system("grep 'RAILS_GEM_VERSION' config/environment.rb > /dev/null 2>&1")
150
152
  end
151
153
 
154
+ def is_legacy_app?
155
+ File.exists?('index.html') || File.exists?('index.php')
156
+ end
157
+
152
158
  def app_exists?(host)
153
159
  File.exists?(vhost_file(host))
154
160
  end
@@ -184,6 +190,14 @@ module Passify
184
190
  end
185
191
 
186
192
  def create_vhost(host, path)
193
+ if is_legacy_app?
194
+ create_legacy_vhost(host, path)
195
+ else
196
+ create_passenger_vhost(host, path)
197
+ end
198
+ end
199
+
200
+ def create_passenger_vhost(host, path)
187
201
  create_file vhost_file(host), <<-eos
188
202
  <VirtualHost *:80>
189
203
  ServerName #{host}
@@ -197,6 +211,22 @@ module Passify
197
211
  eos
198
212
  end
199
213
 
214
+ def create_legacy_vhost(host, path)
215
+ create_file vhost_file(host), <<-eos
216
+ <VirtualHost *:80>
217
+ ServerName #{host}
218
+ DocumentRoot "#{path}"
219
+
220
+ DirectoryIndex index.html index.php
221
+ <Directory "#{path}">
222
+ Allow from all
223
+ Options -MultiViews
224
+ </Directory>
225
+ PassengerEnabled off
226
+ </VirtualHost>
227
+ eos
228
+ end
229
+
200
230
  def vhost_file(host)
201
231
  "#{VHOSTS_DIR}/#{host}.vhost.conf"
202
232
  end
@@ -209,5 +239,9 @@ module Passify
209
239
  system("/usr/bin/dscl localhost -delete /Local/Default/Hosts/#{host} > /dev/null 2>&1")
210
240
  end
211
241
 
242
+ def restart_apache
243
+ system("apachectl graceful > /dev/null 2>&1")
244
+ end
245
+
212
246
  end
213
247
  end
@@ -1,3 +1,3 @@
1
1
  module Passify
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- # specify any dependencies here; for example:
22
21
  s.add_runtime_dependency "thor"
23
22
  s.add_development_dependency "rake"
24
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passify
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fabian Schwahn
@@ -15,12 +15,14 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-27 00:00:00 Z
18
+ date: 2011-10-12 00:00:00 +02:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
22
+ name: thor
21
23
  type: :runtime
22
24
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
25
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
26
  none: false
25
27
  requirements:
26
28
  - - ">="
@@ -29,12 +31,12 @@ dependencies:
29
31
  segments:
30
32
  - 0
31
33
  version: "0"
32
- version_requirements: *id001
33
- name: thor
34
+ requirement: *id001
34
35
  - !ruby/object:Gem::Dependency
36
+ name: rake
35
37
  type: :development
36
38
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
40
  none: false
39
41
  requirements:
40
42
  - - ">="
@@ -43,8 +45,7 @@ dependencies:
43
45
  segments:
44
46
  - 0
45
47
  version: "0"
46
- version_requirements: *id002
47
- name: rake
48
+ requirement: *id002
48
49
  description: passify is a command line interface (CLI) for Phusion Passenger, equivalent to what powder and powify are for pow. passify is compatible with PassengerPane.
49
50
  email:
50
51
  - fabian.schwahn@gmail.com
@@ -64,6 +65,7 @@ files:
64
65
  - lib/passify/cli.rb
65
66
  - lib/passify/version.rb
66
67
  - passify.gemspec
68
+ has_rdoc: true
67
69
  homepage: https://github.com/fschwahn/passify
68
70
  licenses: []
69
71
 
@@ -93,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
95
  requirements: []
94
96
 
95
97
  rubyforge_project: passify
96
- rubygems_version: 1.8.9
98
+ rubygems_version: 1.6.2
97
99
  signing_key:
98
100
  specification_version: 3
99
101
  summary: PassengerPane-compatible CLI for Phusion Passenger