spellbook 0.2.2.2 → 0.2.3

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/History.txt CHANGED
@@ -1,9 +1,14 @@
1
- version 0.2.2 - May 6, 2011
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 - Apr 22, 2011
12
+ version 0.2.0 - 2011/04/22
8
13
 
9
14
  * first release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2.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}/#{self.name}/"
15
+ "http://localhost:#{self.port}"
12
16
  end
13
17
  end
14
18
  end
@@ -7,7 +7,9 @@ module SpellBook
7
7
  end
8
8
 
9
9
  def rewrite_env(env)
10
+ env["SERVER_NAME"] = "localhost"
10
11
  env["SERVER_PORT"] = @port.to_s
12
+ env["HTTP_HOST"] = "localhost:#{@port}"
11
13
  env
12
14
  end
13
15
  end
@@ -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
- "--port", app.port.to_s,
145
- "--prefix", "/#{app.name}"
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: 83
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- - 2
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-06 00:00:00 +09:00
18
+ date: 2011-05-19 00:00:00 +09:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency