culpa 1.3.2 → 1.3.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.
- checksums.yaml +8 -8
- data/lib/culpa/brickchain_helpers.rb +1 -1
- data/lib/culpa/coliseum_dsl.rb +2 -0
- data/lib/culpa/renderers/coliseum.rb +1 -1
- data/lib/culpa/version.rb +1 -0
- data/lib/culpa.rb +5 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjBjMzRjMTY2YjFiYmM2MTc0MTk0MTBhMzVmNDhmYTZmNzk4OGZkOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzljY2FjMGFkMzMwMjM4MzIzNmVhMDdlN2U1ODI4YTRiNjdhNjcxOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWE1ZWNkN2ZkZDdkZDYyMmQzZTIzMTc4OGMwMWQ4NWU2ZjRiMDQwYzZhNWVl
|
10
|
+
NjE2ODlmZTYyNDQ1YTNjMTY2OGUwZWEwZWM3MDNkMTFhNjI4ZDJiY2Q1OTMx
|
11
|
+
YzI5MjFmYzYxNTc4MTNmNDAwNmQ2NDYwNzlkODQ1MTVkZWQ5MDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmI4NmE5Y2NkZmQ0MzdhYTdhMmM1YjUxZDQzNGRiN2QyOTUxYjExZGZiZGZl
|
14
|
+
M2M0ZmU2YTIyMWRjNTlmNDE5NDUzODczZWVjZmJlYTFiMzA4YTFiYzk3NzZh
|
15
|
+
YmQyY2Q1NWQzZTQ0MjMwNTczYTYxNzY1ZDQ0ZmQ4NzU4MTllNTQ=
|
@@ -19,7 +19,7 @@ module Culpa
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def render_coliseum(file)
|
22
|
-
coliseum = ColiseumDSL.new("
|
22
|
+
coliseum = ColiseumDSL.new("./#{COLISEUMS_PATH || 'coliseums'}/#{file}.rb", envelope)
|
23
23
|
raise Action::RenderNow, format: :json,
|
24
24
|
status: RendererDescriber::RETURN_CODES[coliseum.culpa_status] || 200,
|
25
25
|
headers: { 'Content-Type' => 'application/json' }.merge(coliseum.culpa_headers),
|
data/lib/culpa/coliseum_dsl.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
require_relative '../coliseum_dsl'
|
7
7
|
|
8
8
|
describe_renderer :coliseum do |options, envelope|
|
9
|
-
coliseum = ColiseumDSL.new("
|
9
|
+
coliseum = ColiseumDSL.new("./#{ COLISEUMS_PATH || 'coliseums' }/#{options[:coliseum]}.rb", envelope)
|
10
10
|
|
11
11
|
sent_headers = { 'Content-Type' => 'application/json' }.merge(options[:headers]).merge(coliseum.culpa_headers)
|
12
12
|
|
@@ -0,0 +1 @@
|
|
1
|
+
CULPA_VERSION = '1.3.3'.freeze
|
data/lib/culpa.rb
CHANGED
@@ -7,8 +7,7 @@ require_relative 'culpa/envelope'
|
|
7
7
|
require_relative 'culpa/path_parser'
|
8
8
|
require_relative 'culpa/routes_builder'
|
9
9
|
require_relative 'culpa/brickchain_helpers'
|
10
|
-
|
11
|
-
CULPA_VERSION = '1.3.2'.freeze
|
10
|
+
require_relative 'culpa/version'
|
12
11
|
|
13
12
|
ACTIONS_PATH ||= './actions/*.rb'.freeze
|
14
13
|
MODELS_PATH ||= './models/*.rb'.freeze
|
@@ -70,8 +69,10 @@ module Culpa
|
|
70
69
|
# Rack entrypoint
|
71
70
|
def call(env)
|
72
71
|
# Checking if it is a static file before calling the router
|
73
|
-
|
74
|
-
|
72
|
+
if @rack_file
|
73
|
+
static_asset = try_static_asset(env)
|
74
|
+
return static_asset if static_asset
|
75
|
+
end
|
75
76
|
# Calling the router
|
76
77
|
@logger.info "Received request : #{env['PATH_INFO']}"
|
77
78
|
# Request preparation
|
@@ -117,7 +118,6 @@ module Culpa
|
|
117
118
|
##
|
118
119
|
# Serving static assets for dev purposes
|
119
120
|
def try_static_asset(env)
|
120
|
-
return unless @rack_file
|
121
121
|
if File.exist?("#{@public_folder}#{env['PATH_INFO']}") || env['PATH_INFO'] == '/'
|
122
122
|
env['PATH_INFO'] = '/index.html' if env['PATH_INFO'] == '/'
|
123
123
|
@logger.info "Serving static file : #{env['PATH_INFO']}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: culpa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jérémy SEBAN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/culpa/renderers/status.rb
|
88
88
|
- lib/culpa/routes_builder.rb
|
89
89
|
- lib/culpa/test_helpers.rb
|
90
|
+
- lib/culpa/version.rb
|
90
91
|
- templates/culpa/Dockerfile
|
91
92
|
- templates/culpa/Gemfile
|
92
93
|
- templates/culpa/config.ru
|