powder 0.1.8 → 0.2.0
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 +36 -4
- data/bin/powder +114 -10
- data/lib/powder.rb +10 -0
- data/lib/powder/version.rb +1 -1
- data/man/powder.1 +28 -1
- data/man/powder.1.html +39 -1
- data/man/powder.1.ronn +39 -1
- metadata +18 -13
data/Readme.md
CHANGED
@@ -64,6 +64,9 @@ powder manages [pow](http://pow.cx/)
|
|
64
64
|
# Not the application log, but the pow log, available at
|
65
65
|
# ~/Library/Logs/Pow/apps/#{app-directory}.log
|
66
66
|
|
67
|
+
$ powder debug
|
68
|
+
=> Opens a debug shell with your application environment
|
69
|
+
|
67
70
|
$ powder open
|
68
71
|
=> Opens the pow link in a browser
|
69
72
|
# aliased as powder -o
|
@@ -77,6 +80,18 @@ powder manages [pow](http://pow.cx/)
|
|
77
80
|
# if you have set up alternative top level domains in .powconfig,
|
78
81
|
# then the first listed domain will be opened.
|
79
82
|
|
83
|
+
$ powder open --browser Safari
|
84
|
+
=> Opens the pow link in a specific browser (in this case, Safari)
|
85
|
+
# Also aliased as -b
|
86
|
+
|
87
|
+
$ powder open -b 'Google Chrome'
|
88
|
+
=> Opens the pow link with browsers with more than one word
|
89
|
+
|
90
|
+
# Should also works with all the other 'open' options:
|
91
|
+
$ powder open bacon -b Safari
|
92
|
+
$ powder open --xip -b Firefox
|
93
|
+
$ powder -o -x -b 'Google Chrome'
|
94
|
+
|
80
95
|
$ powder restart
|
81
96
|
=> Restart the current app
|
82
97
|
# aliased as powder -r
|
@@ -95,6 +110,24 @@ powder manages [pow](http://pow.cx/)
|
|
95
110
|
=> Returns the current powder version
|
96
111
|
# aliased as powder -v
|
97
112
|
|
113
|
+
$ powder env
|
114
|
+
=> Displays your current custom pow environment variables
|
115
|
+
# Pow reads environment varialbles from .powenv
|
116
|
+
|
117
|
+
$ powder env_reset
|
118
|
+
=> Deletes your .powevn, removing all custom environment variables.
|
119
|
+
|
120
|
+
$ powder env BACON chunky
|
121
|
+
=> Pass an arbitrary environment variable to pow, eg, ENV["BACON"] = "chunky"
|
122
|
+
# Remove an ENV by passing in no value, eg: powder env BACON
|
123
|
+
# If you already have a .gitignore, the newly created .powenv will also be ignored automatically.
|
124
|
+
|
125
|
+
$ powder [production|development|test]
|
126
|
+
=> Run your Rails app as Production
|
127
|
+
# aliased as powder [prod|dev]
|
128
|
+
# This is a wrapper for powder env RAILS_ENV ...
|
129
|
+
|
130
|
+
|
98
131
|
### Install and uninstall Pow ###
|
99
132
|
|
100
133
|
$ powder install
|
@@ -113,12 +146,11 @@ powder manages [pow](http://pow.cx/)
|
|
113
146
|
|
114
147
|
$ powder up
|
115
148
|
=> Enable Pow
|
116
|
-
|
149
|
+
# aliased as powder start
|
150
|
+
|
117
151
|
$ powder down
|
118
152
|
=> Disable Pow
|
119
|
-
|
120
|
-
$ powder debug
|
121
|
-
=> Opens a debug shell with your application environment
|
153
|
+
# aliased as powder stop
|
122
154
|
|
123
155
|
# Contributors #
|
124
156
|
|
data/bin/powder
CHANGED
@@ -4,11 +4,13 @@ require 'rubygems'
|
|
4
4
|
require 'thor'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'net/https'
|
7
|
+
require 'powder'
|
7
8
|
require 'powder/version'
|
8
9
|
|
9
10
|
module Powder
|
10
11
|
class CLI < Thor
|
11
12
|
include Thor::Actions
|
13
|
+
include Powder
|
12
14
|
default_task :help
|
13
15
|
|
14
16
|
map '-r' => 'restart'
|
@@ -21,10 +23,47 @@ module Powder
|
|
21
23
|
map 'update' => 'install'
|
22
24
|
|
23
25
|
POWDER_CONFIG = ".powder"
|
26
|
+
POW_ENV = ".powenv"
|
24
27
|
POW_PATH = "#{ENV['HOME']}/.pow"
|
28
|
+
POW_CONFIG = "#{ENV['HOME']}/.powconfig"
|
25
29
|
POW_DAEMON_PLIST_PATH="#{ENV['HOME']}/Library/LaunchAgents/cx.pow.powd.plist"
|
26
30
|
POW_FIREWALL_PLIST_PATH = "/Library/LaunchDaemons/cx.pow.firewall.plist"
|
27
31
|
|
32
|
+
desc "env", "Pass an arbitrary environment variable to pow"
|
33
|
+
def env(key = nil, value = nil)
|
34
|
+
if key.nil?
|
35
|
+
show_env
|
36
|
+
else
|
37
|
+
value.nil? ? remove_env(key) : create_or_update_env(key, value)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "env_reset", "Remove all custom environment variables"
|
42
|
+
def env_reset
|
43
|
+
%x{rm .powenv && touch .powenv} if powenv_exists?
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "test", "Run pow with RAILS_ENV=test"
|
47
|
+
def test
|
48
|
+
env("RAILS_ENV", "test")
|
49
|
+
end
|
50
|
+
|
51
|
+
desc "dev", "Run pow with RAILS_ENV=development"
|
52
|
+
def development
|
53
|
+
env("RAILS_ENV", "development")
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "dev", "An alias to development"
|
57
|
+
alias :dev :development
|
58
|
+
|
59
|
+
desc "production", "Run pow with RAILS_ENV=production"
|
60
|
+
def production
|
61
|
+
env("RAILS_ENV", "production")
|
62
|
+
end
|
63
|
+
|
64
|
+
desc "prod", "An alias to production"
|
65
|
+
alias :prod :production
|
66
|
+
|
28
67
|
desc "up", "Enable pow"
|
29
68
|
def up
|
30
69
|
if File.exists? POW_FIREWALL_PLIST_PATH
|
@@ -39,6 +78,9 @@ module Powder
|
|
39
78
|
end
|
40
79
|
end
|
41
80
|
|
81
|
+
desc "start", "An alias to up"
|
82
|
+
alias :start :up
|
83
|
+
|
42
84
|
desc "down", "Disable pow"
|
43
85
|
def down
|
44
86
|
if File.exists? POW_FIREWALL_PLIST_PATH
|
@@ -62,6 +104,9 @@ module Powder
|
|
62
104
|
end
|
63
105
|
end
|
64
106
|
|
107
|
+
desc "stop", "An alias to down"
|
108
|
+
alias :stop :down
|
109
|
+
|
65
110
|
desc "link", "Link a pow"
|
66
111
|
method_option :force, :type => :boolean, :default => false, :alias => '-f', :desc => "remove the old configuration, overwrite .powder"
|
67
112
|
method_option :"no-config", :type => :boolean, :default => false, :alias => '-n', :desc => "do not write a .powder file"
|
@@ -129,17 +174,19 @@ module Powder
|
|
129
174
|
|
130
175
|
desc "list", "List current pows"
|
131
176
|
def list
|
132
|
-
pows = Dir[POW_PATH + "/*"].map do |
|
133
|
-
|
134
|
-
app_is_current = (
|
135
|
-
[app_is_current, File.basename(
|
177
|
+
pows = Dir[POW_PATH + "/*"].map do |link_or_port|
|
178
|
+
realpath_or_port = get_app_origin(link_or_port)
|
179
|
+
app_is_current = (realpath_or_port == Dir.pwd) ? '*' : ' '
|
180
|
+
[app_is_current, File.basename(link_or_port), realpath_or_port.gsub(ENV['HOME'], '~')]
|
136
181
|
end
|
137
182
|
print_table(pows)
|
138
183
|
end
|
139
184
|
|
140
185
|
desc "open", "Open a pow in the browser"
|
186
|
+
method_option :browser, :type => :string, :default => false, :aliases => '-b', :desc => 'browser to open with'
|
141
187
|
method_option :xip, :type => :boolean, :default => false, :alias => '-x', :desc => "open xip.io instead of .domain"
|
142
188
|
def open(name=nil)
|
189
|
+
browser = options.browser? ? "-a \'#{options.browser}\'" : nil
|
143
190
|
if options.xip?
|
144
191
|
local_ip = '0.0.0.0'
|
145
192
|
begin
|
@@ -151,9 +198,9 @@ module Powder
|
|
151
198
|
ensure
|
152
199
|
Socket.do_not_reverse_lookup = orig
|
153
200
|
end
|
154
|
-
%x{open http://#{name || get_pow_name}.#{local_ip}.xip.io}
|
201
|
+
%x{open #{browser} http://#{name || get_pow_name}.#{local_ip}.xip.io}
|
155
202
|
else
|
156
|
-
%x{open http://#{name || get_pow_name}.#{domain}}
|
203
|
+
%x{open #{browser} http://#{name || get_pow_name}.#{domain}}
|
157
204
|
end
|
158
205
|
end
|
159
206
|
|
@@ -212,7 +259,16 @@ module Powder
|
|
212
259
|
Debugger.settings[:autoeval] = true
|
213
260
|
Debugger.settings[:autolist] = 1
|
214
261
|
Debugger.settings[:reload_source_on_change] = true
|
215
|
-
|
262
|
+
connected = false
|
263
|
+
start = Time.now.to_i
|
264
|
+
while !connected && (Time.now.to_i - start) < 15
|
265
|
+
begin
|
266
|
+
Debugger.start_client && connected = true
|
267
|
+
rescue
|
268
|
+
next
|
269
|
+
end
|
270
|
+
end
|
271
|
+
say "Tried to connect for 15 seconds. Is the server ready for a debugger connection?" unless connected
|
216
272
|
end
|
217
273
|
|
218
274
|
desc "version", "Shows the version"
|
@@ -251,7 +307,8 @@ module Powder
|
|
251
307
|
|
252
308
|
desc "config", "Shows current pow configuration"
|
253
309
|
def config
|
254
|
-
|
310
|
+
http_port = ":" + configured_pow_http_port.to_s
|
311
|
+
results = %x{curl --silent -H host:pow localhost#{http_port}/config.json}.gsub(':','=>')
|
255
312
|
return say("Error: Cannot get Pow config. Pow may be down. Try 'powder up' first.") if results.empty? || !(results =~ /^\{/)
|
256
313
|
json = eval results
|
257
314
|
json.each do |k,v|
|
@@ -266,7 +323,8 @@ module Powder
|
|
266
323
|
|
267
324
|
desc "status", "Shows current pow status"
|
268
325
|
def status
|
269
|
-
|
326
|
+
http_port = ":" + configured_pow_http_port.to_s
|
327
|
+
results = %x{curl --silent -H host:pow localhost#{http_port}/status.json}.gsub(':','=>')
|
270
328
|
return say("Error: Cannot get Pow status. Pow may be down. Try 'powder up' first.") if results.empty? || !(results =~ /^\{/)
|
271
329
|
json = eval results
|
272
330
|
json.each {|k,v| say "#{k.ljust(12, ' ')} #{v}"}
|
@@ -292,6 +350,46 @@ module Powder
|
|
292
350
|
|
293
351
|
private
|
294
352
|
|
353
|
+
def powenv_exists?
|
354
|
+
File.exists?(POW_ENV)
|
355
|
+
end
|
356
|
+
|
357
|
+
def show_env
|
358
|
+
if powenv_exists? && File.readlines(POW_ENV).any?
|
359
|
+
say %x{echo && cat #{POW_ENV} && echo}
|
360
|
+
else
|
361
|
+
say "\nYou haven't yet configured any custom environment variables for pow."
|
362
|
+
say "Try `powder env BACON chunky` to set ENV[\"BACON\"]=chunky"
|
363
|
+
say " or `powder env BACON` to remove ENV[\"BACON\"]"
|
364
|
+
say " or `powder prod` to set RAILS_ENV=production.\n\n"
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
def remove_env(key)
|
369
|
+
if powenv_exists? && File.readlines(POW_ENV).grep(/export #{key}=/).any?
|
370
|
+
%x{sed -i '' '/^export #{key}=.*$/d' #{POW_ENV}}
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
def create_or_update_env(key, value)
|
375
|
+
if exists = powenv_exists? && File.readlines(POW_ENV).grep(/export #{key}=/).any?
|
376
|
+
%x{sed -i '' 's/^export #{key}=.*$/export #{key}=#{value}/' #{POW_ENV}}
|
377
|
+
say "Modified #{POW_ENV}"
|
378
|
+
else
|
379
|
+
%x{echo "export #{key}=#{value}" >> #{POW_ENV} && touch tmp/restart.txt}
|
380
|
+
say "Appended to #{POW_ENV}"
|
381
|
+
gitignore POW_ENV unless exists
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
def gitignore(filename)
|
386
|
+
if File.exists?(".gitignore") && File.readlines(".gitignore").grep(Regexp.new(filename)).none?
|
387
|
+
%x{echo #{filename} >> .gitignore}
|
388
|
+
say "\nYou'll probably be wanting to .gitignore that new .powenv file..."
|
389
|
+
say "Here, let me take care of that for you.\n\n"
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
295
393
|
def current_dir_name
|
296
394
|
File.basename(%x{pwd}.chomp)
|
297
395
|
end
|
@@ -307,6 +405,12 @@ module Powder
|
|
307
405
|
return nil
|
308
406
|
end
|
309
407
|
|
408
|
+
def configured_pow_http_port
|
409
|
+
return 20559 unless File.exists?(POW_CONFIG)
|
410
|
+
|
411
|
+
return File.open(POW_CONFIG).read.match(/export[\s]+POW_HTTP_PORT[\s]*=[\s]*(\d+)/) || 20559
|
412
|
+
end
|
413
|
+
|
310
414
|
def current_dir_pow_name
|
311
415
|
current_dir_name.tr('_', '-')
|
312
416
|
end
|
@@ -388,7 +492,7 @@ module Powder
|
|
388
492
|
create_file rails_initializer, get_gist(1135055)
|
389
493
|
else
|
390
494
|
create_file rack_initializer, get_gist(1262647)
|
391
|
-
append_to_file 'config.ru', "
|
495
|
+
append_to_file 'config.ru', "\nrequire 'rdebug.rb'"
|
392
496
|
end
|
393
497
|
restart
|
394
498
|
else
|
data/lib/powder.rb
CHANGED
@@ -1,2 +1,12 @@
|
|
1
1
|
module Powder
|
2
|
+
# Get the origin of the application link, whether it's a link to a
|
3
|
+
# rack app or proxy to a port.
|
4
|
+
def get_app_origin(app_link)
|
5
|
+
if File.symlink? app_link
|
6
|
+
File.readlink(app_link)
|
7
|
+
else
|
8
|
+
port = File.readlines(app_link)[0]
|
9
|
+
"proxy port: #{port}"
|
10
|
+
end
|
11
|
+
end
|
2
12
|
end
|
data/lib/powder/version.rb
CHANGED
data/man/powder.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "POWDER" "1" "
|
4
|
+
.TH "POWDER" "1" "August 2012" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpowder\fR \- manage Pow Rack server
|
@@ -63,6 +63,9 @@ powder will attempt to read \.powder, which names a default symlink for the curr
|
|
63
63
|
=> Create \.powder, contents bacon
|
64
64
|
.
|
65
65
|
.P
|
66
|
+
\fB$ powder default\fR => Link the current dir to ~/\.pow/default # Serve this directory for all unhandled domains
|
67
|
+
.
|
68
|
+
.P
|
66
69
|
For both forms of link, if the current directory doesn\'t look like an app that can be powed it will offer to download a basic \fBconfig\.ru\fR for Rails 2
|
67
70
|
.
|
68
71
|
.SS "Unlinking applications"
|
@@ -134,6 +137,15 @@ For both forms of link, if the current directory doesn\'t look like an app that
|
|
134
137
|
.br
|
135
138
|
# then the first listed domain will be opened\.
|
136
139
|
.
|
140
|
+
.P
|
141
|
+
\fB$ powder open \-\-browser Safari\fR => Opens the pow link in a specific browser (in this case, Safari) # Also aliased as \-b
|
142
|
+
.
|
143
|
+
.P
|
144
|
+
\fB$ powder open \-b \'Google Chrome\'\fR => Opens the pow link with browsers with more than one word
|
145
|
+
.
|
146
|
+
.P
|
147
|
+
# Should also works with all the other \'open\' options: \fB$ powder open bacon \-b Safari\fR \fB$ powder open \-\-xip \-b Firefox\fR \fB$ powder \-o \-x \-b \'Google Chrome\'\fR
|
148
|
+
.
|
137
149
|
.SS "Managing application restarts"
|
138
150
|
\fB$ powder restart\fR
|
139
151
|
.
|
@@ -176,6 +188,18 @@ For both forms of link, if the current directory doesn\'t look like an app that
|
|
176
188
|
.br
|
177
189
|
# ~/Library/Logs/Pow/apps/#{app\-directory}\.log
|
178
190
|
.
|
191
|
+
.SS "Working with Environment Variables"
|
192
|
+
\fB$ powder env\fR => Displays your current custom pow environment variables # Pow reads environment varialbles from \.powenv
|
193
|
+
.
|
194
|
+
.P
|
195
|
+
\fB$ powder env_reset\fR => Deletes your \.powevn, removing all custom environment variables\.
|
196
|
+
.
|
197
|
+
.P
|
198
|
+
\fB$ powder env BACON chunky\fR => Pass an arbitrary environment variable to pow, eg, ENV["BACON"] = "chunky" # Remove an ENV by passing in no value, eg: powder env BACON # If you already have a \.gitignore, the newly created \.powenv will also be ignored automatically\.
|
199
|
+
.
|
200
|
+
.P
|
201
|
+
\fB$ powder [production|development|test]\fR => Run your Rails app as Production # aliased as powder [prod|dev] # This is a wrapper for powder env RAILS_ENV \.\.\.
|
202
|
+
.
|
179
203
|
.SS "Installing and uninstalling Pow"
|
180
204
|
\fB$ powder install\fR
|
181
205
|
.
|
@@ -215,5 +239,8 @@ For both forms of link, if the current directory doesn\'t look like an app that
|
|
215
239
|
.br
|
216
240
|
=> Disable Pow
|
217
241
|
.
|
242
|
+
.P
|
243
|
+
\fB$ powder debug\fR => Opens a debug shell with your application environment
|
244
|
+
.
|
218
245
|
.SH "AUTHOR"
|
219
246
|
Built by rodreegez \fIhttps://github\.com/Rodreegez\fR and philnash \fIhttps://github\.com/philnash\fR\.
|
data/man/powder.1.html
CHANGED
@@ -111,6 +111,10 @@
|
|
111
111
|
=> Link the current dir to ~/.pow/bacon<br />
|
112
112
|
=> Create .powder, contents bacon</p>
|
113
113
|
|
114
|
+
<p> <code>$ powder default</code>
|
115
|
+
=> Link the current dir to ~/.pow/default
|
116
|
+
# Serve this directory for all unhandled domains</p>
|
117
|
+
|
114
118
|
<p>For both forms of link, if the current directory doesn't
|
115
119
|
look like an app that can be powed it will offer to download
|
116
120
|
a basic <strong>config.ru</strong> for Rails 2</p>
|
@@ -153,6 +157,18 @@ a basic <strong>config.ru</strong> for Rails 2</p>
|
|
153
157
|
# if you have set up alternative top level domains in .powconfig,<br />
|
154
158
|
# then the first listed domain will be opened.</p>
|
155
159
|
|
160
|
+
<p> <code>$ powder open --browser Safari</code>
|
161
|
+
=> Opens the pow link in a specific browser (in this case, Safari)
|
162
|
+
# Also aliased as -b</p>
|
163
|
+
|
164
|
+
<p> <code>$ powder open -b 'Google Chrome'</code>
|
165
|
+
=> Opens the pow link with browsers with more than one word</p>
|
166
|
+
|
167
|
+
<p> # Should also works with all the other 'open' options:
|
168
|
+
<code>$ powder open bacon -b Safari</code>
|
169
|
+
<code>$ powder open --xip -b Firefox</code>
|
170
|
+
<code>$ powder -o -x -b 'Google Chrome'</code></p>
|
171
|
+
|
156
172
|
<h3 id="Managing-application-restarts">Managing application restarts</h3>
|
157
173
|
|
158
174
|
<p> <code>$ powder restart</code><br />
|
@@ -176,6 +192,25 @@ a basic <strong>config.ru</strong> for Rails 2</p>
|
|
176
192
|
# Not the application log, but the pow log, available at<br />
|
177
193
|
# ~/Library/Logs/Pow/apps/#{app-directory}.log</p>
|
178
194
|
|
195
|
+
<h3 id="Working-with-Environment-Variables">Working with Environment Variables</h3>
|
196
|
+
|
197
|
+
<p> <code>$ powder env</code>
|
198
|
+
=> Displays your current custom pow environment variables
|
199
|
+
# Pow reads environment varialbles from .powenv</p>
|
200
|
+
|
201
|
+
<p> <code>$ powder env_reset</code>
|
202
|
+
=> Deletes your .powevn, removing all custom environment variables.</p>
|
203
|
+
|
204
|
+
<p> <code>$ powder env BACON chunky</code>
|
205
|
+
=> Pass an arbitrary environment variable to pow, eg, ENV["BACON"] = "chunky"
|
206
|
+
# Remove an ENV by passing in no value, eg: powder env BACON
|
207
|
+
# If you already have a .gitignore, the newly created .powenv will also be ignored automatically.</p>
|
208
|
+
|
209
|
+
<p> <code>$ powder [production|development|test]</code>
|
210
|
+
=> Run your Rails app as Production
|
211
|
+
# aliased as powder [prod|dev]
|
212
|
+
# This is a wrapper for powder env RAILS_ENV ...</p>
|
213
|
+
|
179
214
|
<h3 id="Installing-and-uninstalling-Pow">Installing and uninstalling Pow</h3>
|
180
215
|
|
181
216
|
<p> <code>$ powder install</code><br />
|
@@ -198,6 +233,9 @@ a basic <strong>config.ru</strong> for Rails 2</p>
|
|
198
233
|
<p> <code>$ powder down</code><br />
|
199
234
|
=> Disable Pow</p>
|
200
235
|
|
236
|
+
<p> <code>$ powder debug</code>
|
237
|
+
=> Opens a debug shell with your application environment</p>
|
238
|
+
|
201
239
|
<h2 id="AUTHOR">AUTHOR</h2>
|
202
240
|
|
203
241
|
<p>Built by <a href="https://github.com/Rodreegez">rodreegez</a> and <a href="https://github.com/philnash">philnash</a>.</p>
|
@@ -205,7 +243,7 @@ a basic <strong>config.ru</strong> for Rails 2</p>
|
|
205
243
|
|
206
244
|
<ol class='man-decor man-foot man foot'>
|
207
245
|
<li class='tl'></li>
|
208
|
-
<li class='tc'>
|
246
|
+
<li class='tc'>August 2012</li>
|
209
247
|
<li class='tr'>powder(1)</li>
|
210
248
|
</ol>
|
211
249
|
|
data/man/powder.1.ronn
CHANGED
@@ -38,7 +38,11 @@ powder will attempt to read .powder, which names a default symlink for the curre
|
|
38
38
|
`$ powder link [bacon] --force`
|
39
39
|
=> Remove the current pow symlink, and .powder
|
40
40
|
=> Link the current dir to ~/.pow/bacon
|
41
|
-
=> Create .powder, contents bacon
|
41
|
+
=> Create .powder, contents bacon
|
42
|
+
|
43
|
+
`$ powder default`
|
44
|
+
=> Link the current dir to ~/.pow/default
|
45
|
+
# Serve this directory for all unhandled domains
|
42
46
|
|
43
47
|
For both forms of link, if the current directory doesn't
|
44
48
|
look like an app that can be powed it will offer to download
|
@@ -82,6 +86,18 @@ a basic **config.ru** for Rails 2
|
|
82
86
|
# if you have set up alternative top level domains in .powconfig,
|
83
87
|
# then the first listed domain will be opened.
|
84
88
|
|
89
|
+
`$ powder open --browser Safari`
|
90
|
+
=> Opens the pow link in a specific browser (in this case, Safari)
|
91
|
+
# Also aliased as -b
|
92
|
+
|
93
|
+
`$ powder open -b 'Google Chrome'`
|
94
|
+
=> Opens the pow link with browsers with more than one word
|
95
|
+
|
96
|
+
# Should also works with all the other 'open' options:
|
97
|
+
`$ powder open bacon -b Safari`
|
98
|
+
`$ powder open --xip -b Firefox`
|
99
|
+
`$ powder -o -x -b 'Google Chrome'`
|
100
|
+
|
85
101
|
### Managing application restarts
|
86
102
|
|
87
103
|
`$ powder restart`
|
@@ -105,6 +121,25 @@ a basic **config.ru** for Rails 2
|
|
105
121
|
# Not the application log, but the pow log, available at
|
106
122
|
# ~/Library/Logs/Pow/apps/#{app-directory}.log
|
107
123
|
|
124
|
+
### Working with Environment Variables
|
125
|
+
|
126
|
+
`$ powder env`
|
127
|
+
=> Displays your current custom pow environment variables
|
128
|
+
# Pow reads environment varialbles from .powenv
|
129
|
+
|
130
|
+
`$ powder env_reset`
|
131
|
+
=> Deletes your .powevn, removing all custom environment variables.
|
132
|
+
|
133
|
+
`$ powder env BACON chunky`
|
134
|
+
=> Pass an arbitrary environment variable to pow, eg, ENV["BACON"] = "chunky"
|
135
|
+
# Remove an ENV by passing in no value, eg: powder env BACON
|
136
|
+
# If you already have a .gitignore, the newly created .powenv will also be ignored automatically.
|
137
|
+
|
138
|
+
`$ powder [production|development|test]`
|
139
|
+
=> Run your Rails app as Production
|
140
|
+
# aliased as powder [prod|dev]
|
141
|
+
# This is a wrapper for powder env RAILS_ENV ...
|
142
|
+
|
108
143
|
### Installing and uninstalling Pow
|
109
144
|
|
110
145
|
`$ powder install`
|
@@ -127,6 +162,9 @@ a basic **config.ru** for Rails 2
|
|
127
162
|
`$ powder down`
|
128
163
|
=> Disable Pow
|
129
164
|
|
165
|
+
`$ powder debug`
|
166
|
+
=> Opens a debug shell with your application environment
|
167
|
+
|
130
168
|
## AUTHOR
|
131
169
|
|
132
170
|
Built by [rodreegez](https://github.com/Rodreegez) and [philnash](https://github.com/philnash).
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: powder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
17
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,15 @@ dependencies:
|
|
22
22
|
version: 0.11.5
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 0.11.5
|
26
31
|
- !ruby/object:Gem::Dependency
|
27
32
|
name: rake
|
28
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
29
34
|
none: false
|
30
35
|
requirements:
|
31
36
|
- - ! '>='
|
@@ -33,7 +38,12 @@ dependencies:
|
|
33
38
|
version: '0'
|
34
39
|
type: :development
|
35
40
|
prerelease: false
|
36
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
37
47
|
description: Makes Pow even easier. I mean really, really, ridiculously easy.
|
38
48
|
email:
|
39
49
|
- 'no'
|
@@ -67,22 +77,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
77
|
- - ! '>='
|
68
78
|
- !ruby/object:Gem::Version
|
69
79
|
version: '0'
|
70
|
-
segments:
|
71
|
-
- 0
|
72
|
-
hash: 1995833865637283519
|
73
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
81
|
none: false
|
75
82
|
requirements:
|
76
83
|
- - ! '>='
|
77
84
|
- !ruby/object:Gem::Version
|
78
85
|
version: '0'
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
hash: 1995833865637283519
|
82
86
|
requirements: []
|
83
87
|
rubyforge_project: powder
|
84
|
-
rubygems_version: 1.8.
|
88
|
+
rubygems_version: 1.8.23
|
85
89
|
signing_key:
|
86
90
|
specification_version: 3
|
87
91
|
summary: Makes Pow even easier
|
88
92
|
test_files: []
|
93
|
+
has_rdoc:
|