xing-backend 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xing/spec_helpers.rb +1 -0
- data/lib/xing/spec_helpers/json_helpers.rb +9 -0
- data/spec_help/dummy/log/test.log +25 -0
- data/spec_help/spec_helper.rb +0 -3
- metadata +34 -12
- data/lib/xing/static.rb +0 -1
- data/lib/xing/static/backend_url_cookie.rb +0 -20
- data/lib/xing/static/goto_param.rb +0 -30
- data/lib/xing/static/logger.rb +0 -11
- data/lib/xing/static/rack_app.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00bccc65c4ee12dc633807fab406ca544f4502b3
|
4
|
+
data.tar.gz: 67dcce3d8caa2996eb40ae17e658271d9e32d435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 845ba0d372296203484ee4ba854fe72d6d76a43d47e0414cfdccecab631920fbd0c68271bf2e6bf7e801019a52c57a3d67882c546a468f53e3c31ce12da93ee6
|
7
|
+
data.tar.gz: dea446d153f97588a7f9fef1d02d3d6758df08abe25f794094b43cd04cee05a65465b28a4d0287e0ef9b83fa6e9359967066e1cad51789319a7bf3c02e02fe7e
|
data/lib/xing/spec_helpers.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'xing/spec_helpers/api_response_matchers'
|
2
2
|
require 'xing/spec_helpers/ci_support'
|
3
3
|
require 'xing/spec_helpers/dom_equiv'
|
4
|
+
require 'xing/spec_helpers/json_helpers'
|
4
5
|
require 'xing/spec_helpers/json_requests'
|
5
6
|
require 'xing/spec_helpers/routing_spec_patch'
|
6
7
|
require 'xing/spec_helpers/split_servers'
|
@@ -181,3 +181,28 @@ ETHON: started MULTI
|
|
181
181
|
ETHON: performed MULTI
|
182
182
|
ETHON: started MULTI
|
183
183
|
ETHON: performed MULTI
|
184
|
+
ETHON: Libcurl initialized
|
185
|
+
ETHON: started MULTI
|
186
|
+
ETHON: performed MULTI
|
187
|
+
ETHON: started MULTI
|
188
|
+
ETHON: performed MULTI
|
189
|
+
ETHON: Libcurl initialized
|
190
|
+
ETHON: started MULTI
|
191
|
+
ETHON: performed MULTI
|
192
|
+
ETHON: started MULTI
|
193
|
+
ETHON: performed MULTI
|
194
|
+
ETHON: Libcurl initialized
|
195
|
+
ETHON: started MULTI
|
196
|
+
ETHON: performed MULTI
|
197
|
+
ETHON: started MULTI
|
198
|
+
ETHON: performed MULTI
|
199
|
+
ETHON: Libcurl initialized
|
200
|
+
ETHON: started MULTI
|
201
|
+
ETHON: performed MULTI
|
202
|
+
ETHON: started MULTI
|
203
|
+
ETHON: performed MULTI
|
204
|
+
ETHON: Libcurl initialized
|
205
|
+
ETHON: started MULTI
|
206
|
+
ETHON: performed MULTI
|
207
|
+
ETHON: started MULTI
|
208
|
+
ETHON: performed MULTI
|
data/spec_help/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xing-backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Dorn
|
@@ -11,22 +11,28 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-01-
|
14
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
19
19
|
requirements:
|
20
|
-
- - "
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 4.2.5.1
|
23
|
+
- - "<"
|
21
24
|
- !ruby/object:Gem::Version
|
22
|
-
version: '4.
|
25
|
+
version: '4.3'
|
23
26
|
type: :runtime
|
24
27
|
prerelease: false
|
25
28
|
version_requirements: !ruby/object:Gem::Requirement
|
26
29
|
requirements:
|
27
|
-
- - "
|
30
|
+
- - ">="
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
32
|
+
version: 4.2.5.1
|
33
|
+
- - "<"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '4.3'
|
30
36
|
- !ruby/object:Gem::Dependency
|
31
37
|
name: active_model_serializers
|
32
38
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,6 +87,26 @@ dependencies:
|
|
81
87
|
- - ">="
|
82
88
|
- !ruby/object:Gem::Version
|
83
89
|
version: 0.1.31
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: xing-dev-assets
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- - "<="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '1.0'
|
100
|
+
type: :runtime
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
- - "<="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.0'
|
84
110
|
- !ruby/object:Gem::Dependency
|
85
111
|
name: rails-rfc6570
|
86
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -265,15 +291,11 @@ files:
|
|
265
291
|
- lib/xing/spec_helpers/api_response_matchers.rb
|
266
292
|
- lib/xing/spec_helpers/ci_support.rb
|
267
293
|
- lib/xing/spec_helpers/dom_equiv.rb
|
294
|
+
- lib/xing/spec_helpers/json_helpers.rb
|
268
295
|
- lib/xing/spec_helpers/json_requests.rb
|
269
296
|
- lib/xing/spec_helpers/routing_spec_patch.rb
|
270
297
|
- lib/xing/spec_helpers/split_servers.rb
|
271
298
|
- lib/xing/spec_helpers/test_url_helpers.rb
|
272
|
-
- lib/xing/static.rb
|
273
|
-
- lib/xing/static/backend_url_cookie.rb
|
274
|
-
- lib/xing/static/goto_param.rb
|
275
|
-
- lib/xing/static/logger.rb
|
276
|
-
- lib/xing/static/rack_app.rb
|
277
299
|
- lib/xing/tasks/all.rake
|
278
300
|
- lib/xing/tasks/db_recycle.rake
|
279
301
|
- lib/xing/tasks/dependencies_common.rake
|
@@ -345,7 +367,7 @@ rdoc_options:
|
|
345
367
|
- "--main"
|
346
368
|
- doc/README
|
347
369
|
- "--title"
|
348
|
-
- xing-backend-0.0.
|
370
|
+
- xing-backend-0.0.25 Documentation
|
349
371
|
require_paths:
|
350
372
|
- lib/
|
351
373
|
required_ruby_version: !ruby/object:Gem::Requirement
|
data/lib/xing/static.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'xing/static/rack_app'
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Xing
|
2
|
-
module Static
|
3
|
-
class BackendUrlCookie
|
4
|
-
def initialize(app, backend_url)
|
5
|
-
@backend_url = backend_url
|
6
|
-
@app = app
|
7
|
-
end
|
8
|
-
|
9
|
-
def call(env)
|
10
|
-
status, headers, body = @app.call(env)
|
11
|
-
headers["Set-Cookie"] = [
|
12
|
-
(headers["Set-Cookie"]),
|
13
|
-
"lrdBackendUrl=#@backend_url",
|
14
|
-
"xingBackendUrl=#{@backend_url}"
|
15
|
-
].compact.join("\n") unless @backend_url.nil?
|
16
|
-
[ status, headers, body ]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'pp'
|
2
|
-
module Xing
|
3
|
-
module Static
|
4
|
-
class GotoParam
|
5
|
-
def initialize(app)
|
6
|
-
@app = app
|
7
|
-
end
|
8
|
-
|
9
|
-
def call(env)
|
10
|
-
status, headers, body = @app.call(env)
|
11
|
-
default = [ status, headers, body ]
|
12
|
-
request_path = env["SCRIPT_NAME"] + env["PATH_INFO"]
|
13
|
-
if env["QUERY_STRING"]
|
14
|
-
request_path += "&#{env["QUERY_STRING"]}"
|
15
|
-
end
|
16
|
-
|
17
|
-
redirect = [ 301, headers.merge("Location" => "/?goto=#{request_path}", "Content-Length" => "0"), [] ]
|
18
|
-
|
19
|
-
return default unless status == 404
|
20
|
-
return default if /\A(assets|fonts|system)/ =~ request_path
|
21
|
-
return default if /\.(xml|html|ico|txt)\z/ =~ request_path
|
22
|
-
return default if /goto=/ =~ env["QUERY_STRING"]
|
23
|
-
|
24
|
-
return redirect
|
25
|
-
rescue => ex
|
26
|
-
pp ex
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/lib/xing/static/logger.rb
DELETED
data/lib/xing/static/rack_app.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require 'xing/static/backend_url_cookie'
|
2
|
-
require 'xing/static/goto_param'
|
3
|
-
require 'xing/static/logger'
|
4
|
-
|
5
|
-
module Xing
|
6
|
-
module Static
|
7
|
-
class RackApp
|
8
|
-
# Should be override by client app. Ironically, override with exactly
|
9
|
-
# this definition will usually work.
|
10
|
-
def self.log_root
|
11
|
-
File.expand_path("../../log", __FILE__)
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.logpath_for_env(env)
|
15
|
-
File.join( log_root, "#{env}_static.log")
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.build(root_path, backend_port)
|
19
|
-
backend_url = "http://localhost:#{backend_port}/"
|
20
|
-
env = ENV['RAILS_ENV'] || 'development'
|
21
|
-
logger = Logger.new(logpath_for_env(env))
|
22
|
-
|
23
|
-
Rack::Builder.new do
|
24
|
-
use BackendUrlCookie, backend_url
|
25
|
-
use GotoParam
|
26
|
-
use Rack::CommonLogger, logger
|
27
|
-
use Rack::Static, {
|
28
|
-
:urls => [""],
|
29
|
-
:root => root_path,
|
30
|
-
:index => "index.html",
|
31
|
-
:header_rules => {
|
32
|
-
:all => {"Cache-Control" => "no-cache, max-age=0" } #no caching development assets
|
33
|
-
}
|
34
|
-
}
|
35
|
-
run proc{}
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|