spellbook 0.2.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -2
- data/VERSION +1 -1
- data/lib/spellbook/app.rb +6 -2
- data/lib/spellbook/proxy.rb +2 -0
- data/lib/spellbook/server.rb +8 -4
- metadata +4 -5
data/History.txt
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
-
version 0.2.
|
1
|
+
version 0.2.3 - 2011/05/19
|
2
|
+
|
3
|
+
* fix: proxy failed when accessed from other than localhost
|
4
|
+
* fix: do not append --port and --prefix when 'proxy' is unchecked
|
5
|
+
|
6
|
+
version 0.2.2 - 2011/05/06
|
2
7
|
|
3
8
|
* fix: installation issue
|
4
9
|
* fix: did not work with Ruby 1.8
|
5
10
|
* fix: proxy failed on other than localhost
|
6
11
|
|
7
|
-
version 0.2.0 -
|
12
|
+
version 0.2.0 - 2011/04/22
|
8
13
|
|
9
14
|
* first release
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/spellbook/app.rb
CHANGED
@@ -4,11 +4,15 @@ module SpellBook
|
|
4
4
|
validates_uniqueness_of :name, :port
|
5
5
|
validates_numericality_of :port
|
6
6
|
|
7
|
+
def proxy?
|
8
|
+
self.proxy
|
9
|
+
end
|
10
|
+
|
7
11
|
def url
|
8
|
-
if self.proxy
|
12
|
+
if self.proxy?
|
9
13
|
"/#{self.name}/"
|
10
14
|
else
|
11
|
-
"http://localhost:#{self.port}
|
15
|
+
"http://localhost:#{self.port}"
|
12
16
|
end
|
13
17
|
end
|
14
18
|
end
|
data/lib/spellbook/proxy.rb
CHANGED
data/lib/spellbook/server.rb
CHANGED
@@ -140,10 +140,13 @@ module SpellBook
|
|
140
140
|
get '/spellbook/apps/:name/start' do
|
141
141
|
app = find_app(params[:name])
|
142
142
|
|
143
|
-
cmd = app.command.split
|
144
|
-
|
145
|
-
|
146
|
-
|
143
|
+
cmd = app.command.split
|
144
|
+
if app.proxy?
|
145
|
+
cmd += [
|
146
|
+
"--port", app.port.to_s,
|
147
|
+
"--prefix", "/#{app.name}"
|
148
|
+
]
|
149
|
+
end
|
147
150
|
process = ChildProcess.build(*cmd)
|
148
151
|
|
149
152
|
Server.processes[app.id] = process
|
@@ -152,6 +155,7 @@ module SpellBook
|
|
152
155
|
process.io.stdout = tempfile
|
153
156
|
process.io.stderr = tempfile
|
154
157
|
|
158
|
+
puts "starting app: #{cmd.join(' ')}"
|
155
159
|
process.start
|
156
160
|
|
157
161
|
sleep 1
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spellbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.2.2.2
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Yutaka HARA
|
@@ -16,7 +15,7 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-19 00:00:00 +09:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|