platform1 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/platform1 +20 -2
- data/platform1.gemspec +1 -1
- metadata +2 -2
data/bin/platform1
CHANGED
@@ -53,12 +53,22 @@ class Platform1Command < Clamp::Command
|
|
53
53
|
|
54
54
|
subcommand "open", "Open app in a browser." do
|
55
55
|
|
56
|
+
parameter "[PATH]", "a path to append to the app url"
|
57
|
+
|
56
58
|
def execute
|
57
|
-
Launchy.open(
|
59
|
+
Launchy.open(url(path))
|
58
60
|
end
|
59
61
|
|
60
62
|
end
|
61
63
|
|
64
|
+
subcommand "url", "Print application url." do
|
65
|
+
|
66
|
+
def execute
|
67
|
+
puts application_url
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
62
72
|
subcommand "restart", "Ask app to restart" do
|
63
73
|
|
64
74
|
def execute
|
@@ -74,9 +84,17 @@ class Platform1Command < Clamp::Command
|
|
74
84
|
end
|
75
85
|
|
76
86
|
def application_url
|
77
|
-
"http://
|
87
|
+
"http://127.0.0.1:#{passenger_port}/"
|
78
88
|
end
|
79
89
|
|
90
|
+
def url(path = nil)
|
91
|
+
url = application_url
|
92
|
+
if path
|
93
|
+
url += path.sub(%r{^/}, '')
|
94
|
+
end
|
95
|
+
url
|
96
|
+
end
|
97
|
+
|
80
98
|
def sh(command)
|
81
99
|
system(command) || raise("Error running: #{command.inspect}")
|
82
100
|
end
|
data/platform1.gemspec
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: platform1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Williams
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-21 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|