passify 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -23,7 +23,7 @@ To restart the application run
23
23
 
24
24
  To remove the application run
25
25
 
26
- passify remove
26
+ passify remove [name]
27
27
 
28
28
  To change the rack environment to e.g. production run
29
29
 
@@ -55,6 +55,10 @@ It makes sense to create a wrapper for `passify` if you are using multiple versi
55
55
  rvm wrapper 1.8.7 --no-prefix passify
56
56
 
57
57
  ## Changelog
58
+ ### 0.2.3 (25-11-2011)
59
+ * add possibility to remove hosts if the directory was already deleted
60
+ * show in `ls`-command if application has been removed
61
+
58
62
  ### 0.2.2 (25-11-2011)
59
63
  * added conf command to which opens the configuration file if $EDITOR is set, and shows the path otherwise
60
64
  * fixed small bug with `list`-command showing truncated paths for legacy apps
@@ -20,9 +20,7 @@ module Passify
20
20
  def add(name = nil)
21
21
  check_for_passify
22
22
  error("This directory can not be served with passify. It has to be either a Rack application, a Rails 2.x application or a legacy (PHP/HTML) application.") unless is_valid_app?
23
- name = File.basename(pwd) if name.nil? || name.empty?
24
- name = urlify(name)
25
- host = "#{name}.local"
23
+ host = get_host_from_name(name)
26
24
  if app_exists?(host)
27
25
  if is_same_app?(host, pwd)
28
26
  notice("This directory is already being served from http://#{host}. Run `passify open` to view it.")
@@ -41,10 +39,10 @@ module Passify
41
39
  say "The application was successfully set up and can be reached from http://#{host} . Run `passify open` to view it."
42
40
  end
43
41
 
44
- desc "remove", "Removes an existing link to the current working directory."
45
- def remove
42
+ desc "remove", "Removes an existing application."
43
+ def remove(name = nil)
46
44
  check_for_passify
47
- host = find_host
45
+ host = find_host(name)
48
46
 
49
47
  sudome
50
48
  remove_app(host)
@@ -114,7 +112,8 @@ module Passify
114
112
  Dir.foreach(VHOSTS_DIR) do |entry|
115
113
  if File.file?("#{VHOSTS_DIR}/#{entry}")
116
114
  host = entry[0..-12]
117
- say " #{host} --> #{directory_for_host(host)}"
115
+ dir = directory_for_host(host)
116
+ say " #{host} --> #{Dir.exists?(dir) ? dir : "[REMOVED]"}"
118
117
  end
119
118
  end
120
119
  end
@@ -207,13 +206,13 @@ module Passify
207
206
  File.exists?("#{path}/index.html") || File.exists?("#{path}/index.php")
208
207
  end
209
208
 
210
- def find_host
211
- if File.exists?('.passify')
209
+ def find_host(name = nil)
210
+ if name
211
+ host = get_host_from_name(name)
212
+ elsif File.exists?('.passify')
212
213
  host = File.open('.passify') {|f| f.readline}.strip
213
214
  else # support for passify 0.1.x
214
- name = File.basename(pwd)
215
- name = urlify(name)
216
- host = "#{name}.local"
215
+ host = get_host_from_name
217
216
  end
218
217
  notice("The current directory is not served via passify. Please run `passify add` first.") unless app_exists?(host)
219
218
  host
@@ -236,6 +235,12 @@ module Passify
236
235
  `grep -n '#{pattern}' #{APACHE_CONF}`.split(":").first
237
236
  end
238
237
 
238
+ def get_host_from_name(name = nil)
239
+ name = File.basename(pwd) if name.nil? || name.empty?
240
+ name = urlify(name)
241
+ "#{name}.local"
242
+ end
243
+
239
244
  def pwd
240
245
  @pwd ||= Dir.pwd
241
246
  end
@@ -1,3 +1,3 @@
1
1
  module Passify
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-25 00:00:00.000000000 Z
12
+ date: 2011-12-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &2156002500 !ruby/object:Gem::Requirement
16
+ requirement: &2152328040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156002500
24
+ version_requirements: *2152328040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &2156001520 !ruby/object:Gem::Requirement
27
+ requirement: &2152326380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2156001520
35
+ version_requirements: *2152326380
36
36
  description: passify is a command line interface (CLI) for Phusion Passenger, equivalent
37
37
  to what powder and powify are for pow. passify is compatible with PassengerPane.
38
38
  email:
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  segments:
67
67
  - 0
68
- hash: 4385306381277198046
68
+ hash: 1749710991611136340
69
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  none: false
71
71
  requirements:
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  segments:
76
76
  - 0
77
- hash: 4385306381277198046
77
+ hash: 1749710991611136340
78
78
  requirements: []
79
79
  rubyforge_project: passify
80
80
  rubygems_version: 1.8.11