platform1 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/platform1 +20 -2
  2. data/platform1.gemspec +1 -1
  3. 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(application_url)
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://localhost:#{passenger_port}/"
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
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
 
6
6
  gem.name = "platform1"
7
- gem.version = "0.0.2"
7
+ gem.version = "0.0.3"
8
8
  gem.platform = Gem::Platform::RUBY
9
9
 
10
10
  gem.authors = ["Mike Williams"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: platform1
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
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-17 00:00:00 +10:00
13
+ date: 2011-04-21 00:00:00 +10:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency