another_place 0.0.5 → 0.0.6
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 +4 -4
- data/lib/another_place/application/app.rb +14 -4
- data/lib/another_place/application/evidence.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a610ea4053497206ae2aca87a589b41146d2722a
|
4
|
+
data.tar.gz: 915ec70822d9beb53a132bee68f081896da7555b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f63feee5b39a00329781d13d47787436b35e43364dbddc5b4a98206985b8afb997cf93fe60326d4d84396da7dcc7217a3af3cea7192799cf10dcfeeaa878a6
|
7
|
+
data.tar.gz: fe8021d4c870d0b4bd4c41ce66ba7cbbb4960c1151abd352f80046f441089223b34b7ffce533c44983f4cf7e0a924d2c5029c976b0153147554830e4b541520c
|
@@ -15,6 +15,18 @@ class AnotherPlace < Sinatra::Base
|
|
15
15
|
headers({"Content-Type" => "application/json"})
|
16
16
|
end
|
17
17
|
|
18
|
+
# set up a special 404 not found message
|
19
|
+
not_found do
|
20
|
+
status 404
|
21
|
+
body("You're route (HTTP verb and path) didn't get you where you wanted to be...")
|
22
|
+
end
|
23
|
+
|
24
|
+
# create a special error handler
|
25
|
+
class CustomClueError < Exception; end
|
26
|
+
error CustomClueError do
|
27
|
+
"Read your errors!\n" + env['sinatra.error'].message
|
28
|
+
end
|
29
|
+
|
18
30
|
get '/' do
|
19
31
|
status 200
|
20
32
|
body("::psst:: *check the headers, watch the logs...*\n")
|
@@ -116,10 +128,8 @@ class AnotherPlace < Sinatra::Base
|
|
116
128
|
|
117
129
|
get '/police' do
|
118
130
|
# STEP 9.2
|
119
|
-
logger.info(Evidence::CLUES[request.path][1][:
|
120
|
-
|
121
|
-
"X-Clue" => Evidence::CLUES[request.path][1][:header_clue]
|
122
|
-
})
|
131
|
+
logger.info(Evidence::CLUES[request.path][1][:header_clue])
|
132
|
+
raise CustomClueError, Evidence::CLUES[request.path][1][:log_clue]
|
123
133
|
end
|
124
134
|
|
125
135
|
get '/another_place' do
|