appengine-rack 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -4
- data/lib/appengine-rack.rb +42 -8
- metadata +4 -13
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ EOF
|
|
10
10
|
|
11
11
|
spec = Gem::Specification.new do |s|
|
12
12
|
s.name = "appengine-rack"
|
13
|
-
s.version = "0.0.
|
13
|
+
s.version = "0.0.3"
|
14
14
|
s.author = "Ryan Brown"
|
15
15
|
s.email = "ribrdb@google.com"
|
16
16
|
s.homepage = "http://code.google.com/p/appengine-jruby"
|
@@ -18,8 +18,6 @@ spec = Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.platform = Gem::Platform::RUBY
|
20
20
|
|
21
|
-
s.add_dependency "rack"
|
22
|
-
|
23
21
|
s.require_path = 'lib'
|
24
22
|
s.files = %w(LICENSE Rakefile) + Dir.glob("lib/**/*")
|
25
23
|
end
|
@@ -40,4 +38,4 @@ task :make_spec do
|
|
40
38
|
File.open("#{GEM}.gemspec", "w") do |file|
|
41
39
|
file.puts spec.to_ruby
|
42
40
|
end
|
43
|
-
end
|
41
|
+
end
|
data/lib/appengine-rack.rb
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
begin
|
19
19
|
require 'appengine-apis/urlfetch'
|
20
|
+
require 'appengine-apis/tempfile'
|
20
21
|
rescue Exception
|
21
22
|
end
|
22
23
|
|
@@ -25,23 +26,42 @@ module AppEngine
|
|
25
26
|
ROOT = File.expand_path(File.dirname(__FILE__))
|
26
27
|
|
27
28
|
class Resources
|
29
|
+
COMMON_EXCLUDES = {
|
30
|
+
:rails_excludes => %w(README Rakefile db/** doc/**
|
31
|
+
log/** script/** test/** tmp/**),
|
32
|
+
:merb_excludes => %w(Rakefile autotest/** doc/** gems/** spec/**) }
|
33
|
+
|
28
34
|
def initialize
|
29
35
|
@includes = []
|
30
36
|
@excludes = []
|
31
37
|
end
|
32
38
|
|
33
|
-
def include(glob)
|
34
|
-
|
39
|
+
def include(glob, expiration=nil)
|
40
|
+
if glob.is_a? Array
|
41
|
+
glob.each do |g|
|
42
|
+
@includes << [g, expiration]
|
43
|
+
end
|
44
|
+
else
|
45
|
+
@includes << [glob, expiration]
|
46
|
+
end
|
35
47
|
end
|
36
48
|
|
37
49
|
def exclude(glob)
|
38
|
-
|
50
|
+
if glob.is_a? Array
|
51
|
+
@excludes += glob
|
52
|
+
elsif glob.is_a? Symbol
|
53
|
+
@excludes += COMMON_EXCLUDES[glob]
|
54
|
+
else
|
55
|
+
@excludes << glob
|
56
|
+
end
|
39
57
|
end
|
40
58
|
|
41
59
|
def append_to(xml, type)
|
42
60
|
resources = xml.add_element(type)
|
43
|
-
@includes.each do |path|
|
44
|
-
resources.add_element('include')
|
61
|
+
@includes.each do |path, expiration|
|
62
|
+
element = resources.add_element('include')
|
63
|
+
element.add_attribute('path', path)
|
64
|
+
element.add_attribute('expiration', expiration) if expiration
|
45
65
|
end
|
46
66
|
@excludes.each do |path|
|
47
67
|
resources.add_element('exclude').add_attribute('path', path)
|
@@ -74,19 +94,21 @@ module AppEngine
|
|
74
94
|
end
|
75
95
|
|
76
96
|
class RackApplication
|
77
|
-
attr_accessor :application, :
|
78
|
-
attr_reader :version, :static_files, :resource_files
|
97
|
+
attr_accessor :application, :inbound_services
|
98
|
+
attr_reader :version, :static_files, :resource_files, :public_root
|
79
99
|
attr_reader :system_properties, :environment_variables
|
80
100
|
attr_writer :ssl_enabled, :sessions_enabled
|
81
101
|
|
82
102
|
def initialize
|
83
103
|
@version = '1'
|
84
104
|
@system_properties = PropertyMap[ 'os.arch' => '',
|
85
|
-
|
105
|
+
'jruby.management.enabled' => false,
|
106
|
+
'jruby.rack.input.rewindable' => false ]
|
86
107
|
@environment_variables = EnvVarMap.new
|
87
108
|
@static_files = Resources.new
|
88
109
|
@resource_files = Resources.new
|
89
110
|
@public_root = '/public'
|
111
|
+
@inbound_services = []
|
90
112
|
end
|
91
113
|
|
92
114
|
alias id application
|
@@ -99,6 +121,12 @@ module AppEngine
|
|
99
121
|
@ssl_enabled
|
100
122
|
end
|
101
123
|
|
124
|
+
def public_root=(root)
|
125
|
+
root = "/#{root}".squeeze '/'
|
126
|
+
root = nil if root.eql? '/'
|
127
|
+
@public_root = root
|
128
|
+
end
|
129
|
+
|
102
130
|
def version=(version)
|
103
131
|
@version = version.to_s
|
104
132
|
end
|
@@ -128,6 +156,12 @@ module AppEngine
|
|
128
156
|
if ssl_enabled?
|
129
157
|
xml.add_element('ssl-enabled').add_text('true')
|
130
158
|
end
|
159
|
+
unless @inbound_services.empty?
|
160
|
+
services = xml.add_element('inbound-services')
|
161
|
+
@inbound_services.each do |service|
|
162
|
+
services.add_element('service').add_text(service.to_s)
|
163
|
+
end
|
164
|
+
end
|
131
165
|
return xml
|
132
166
|
end
|
133
167
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appengine-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brown
|
@@ -9,19 +9,10 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
name: rack
|
17
|
-
type: :runtime
|
18
|
-
version_requirement:
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "0"
|
24
|
-
version:
|
14
|
+
dependencies: []
|
15
|
+
|
25
16
|
description: |
|
26
17
|
Commom dependencies for configuring an App Engine application via Rack.
|
27
18
|
|