Module: Powify
- Included in:
- App, Client, Server, Utils
- Defined in:
- lib/powify/utils.rb,
lib/powify/app.rb,
lib/powify/core.rb,
lib/powify/client.rb,
lib/powify/server.rb
Overview
powify server functions invoked via powify server [COMMAND] [ARGS]
Defined Under Namespace
Classes: App, Client, Server, Utils
Constant Summary
collapse
- POWPATH =
File.expand_path("~/.pow")
Instance Method Summary
collapse
Instance Method Details
#config ⇒ Object
26
27
28
29
|
# File 'lib/powify/core.rb', line 26
def config
result = %x{curl localhost/config.json --silent --header host:pow}
JSON.parse(result)
end
|
#current_path ⇒ Object
10
11
12
|
# File 'lib/powify/core.rb', line 10
def current_path
%x{pwd}.strip
end
|
#extension ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/powify/core.rb', line 14
def extension
if File.exists?('~/.powconfig')
return %x{source ~/.powconfig; echo $POW_DOMAIN}.strip unless %x{source ~/.powconfig; echo $POW_DOMAIN}.strip.empty?
return %x{source ~/.powconfig; echo $POW_DOMAINS}.strip.split(',').first unless %x{source ~/.powconfig; echo $POW_DOMAINS}.strip.empty?
else
return %x{echo $POW_DOMAIN}.strip unless %x{echo $POW_DOMAIN}.strip.empty?
return %x{echo $POW_DOMAINS}.strip.split(',').first unless %x{echo $POW_DOMAINS}.strip.empty?
end
return 'dev'
end
|