another_place 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a18ba075539360c0935c28a56e9f8734f615c453
4
- data.tar.gz: 71b653fea957611e6596e4a95a469a8f51bd6782
3
+ metadata.gz: ae62f1eaef5217675930e436c0f24493282117d0
4
+ data.tar.gz: 810c82feaee65138da8af691fa9fe712e0b5b979
5
5
  SHA512:
6
- metadata.gz: 0ab953a07e07b553de38babde0ec6f6eadde2b151aa1bd22a9ca08ac5be1aad6644db1968d5a3618988cc2b92274d9245312edd841121aa9f7a1e8c33e9655b1
7
- data.tar.gz: 33851204dba3cf8522d0d3f30bd9aa36343b3e3e16d10d5d45fe491a1a8dbeda0b3e2687dcdc1543f7666c2ecc15b5e1349e38d4a756ae5c49c691998f4ea0a5
6
+ metadata.gz: f4762db8f7bd18fea780573583ba91188acc6a6cfc8569e31aee09a2434a774e359d42c1b27545e18743fcf8140683fc14f68fd50d9ec8366c2e8391411af255
7
+ data.tar.gz: 05824aee6fe7d36c161e8e6be6d172e35ddfd978f402338d8ea723327ba2c874a316aa90a0c5f6bf3afcf85995191f6f750051ef01a73e38032911c852ccc053
@@ -1,8 +1,6 @@
1
1
  require 'sinatra'
2
2
  require 'json'
3
3
 
4
- require 'pry'
5
-
6
4
  require_relative 'evidence'
7
5
 
8
6
  class AnotherPlace < Sinatra::Base
@@ -126,10 +124,23 @@ class AnotherPlace < Sinatra::Base
126
124
 
127
125
  get '/another_place' do
128
126
  # STEP 10
129
-
127
+ logger.info(Evidence::CLUES[request.path][:log_clue])
128
+ headers({
129
+ "X-Clue" => Evidence::CLUES[request.path][:header_clue],
130
+ "Content-Transfer-Encoding" => 'base64'
131
+ })
132
+ body(Evidence::CLUES[request.path][:body_clue].to_json)
130
133
  end
131
134
 
132
-
135
+ get '/d2l0aCB0aGUgcm0gLXJm' do
136
+ # THE FINAL CLUE
137
+ logger.info(Evidence::CLUES[request.path][:log_clue])
138
+ headers({
139
+ "X-Clue" => Evidence::CLUES[request.path][:header_clue],
140
+ "Content-Transfer-Encoding" => 'base64'
141
+ })
142
+ body(Evidence::CLUES[request.path][:body_clue].to_json)
143
+ end
133
144
  end
134
145
 
135
146
  # Run the app!
@@ -23,19 +23,6 @@ they make a damn fine coffee!
23
23
  ==
24
24
  EOF
25
25
 
26
- # header
27
- # puzzle
28
- # query
29
- # puzzle
30
- # data
31
- # puzzle
32
-
33
- # "/path" => {
34
- # header_clue: ,
35
- # log_clue: ,
36
- # body_clue:
37
- # },
38
-
39
26
  CLUES = {
40
27
  "/double_r_diner" => {
41
28
  header_clue: "",
@@ -108,51 +95,14 @@ EOF
108
95
  }
109
96
  ],
110
97
  "/another_place" => {
111
- header_clue: "",
112
- log_clue: "The dream held all the answers, we have to go back.",
113
- body_clue: ""
98
+ header_clue: "If the index is even minus 1, otherwise add 1",
99
+ log_clue: "Turn strings to integer with .ord and integers to strings with .chr",
100
+ body_clue: ["e",1,"m",-1,"b","B","C",-1,"b","F","V","f","d","l",1,"f","M","W","K","l"]
101
+ },
102
+ "/d2l0aCB0aGUgcm0gLXJm" => {
103
+ header_clue: "All of the nonsense paths came to you in a dream.",
104
+ log_clue: "The **content** of the dreams was **transferred** to you **in code**...",
105
+ body_clue: "If you can decode the paths so that they are readable, you will know the answer.\n"
114
106
  }
115
-
116
- # {
117
- # url: "/coffee/?black=true",
118
- # method: "delete",
119
- # clue: "first character of every key in a hash",
120
- # code: "cGo=" #pj
121
- # },
122
- # {
123
- # url: "/ladies/?type=log",
124
- # method: "get",
125
- # clue: "all the odd elements in an array, after the array has been reversed",
126
- # puzzle: [ "l", 119, "h", "MU", "G", "AT", "d", 145, "g", "ID", "4", "HQ", "W", "YY", "a", 404 ],
127
- # code: "aW4gdGhl" # in the
128
- # },
129
- # {
130
- # method: "get",
131
- # url: "/meditations/type=mantra&eyes=closed",
132
- # clue: "all numbers to `char` and all the letters to `ord`",
133
- # puzzle: [99, 109, "\t", 118, 100, 67, 66, 107, 97, 88, 74, 108, 89, "\x03", 82, 118, 99, 110, 107, 61],
134
- # code: "cm9vdCBkaXJlY3Rvcnk=" # root directory
135
- # },
136
- # {
137
- # post: "[/owls]/7",
138
- # data: { "eyes" => true },
139
- # code: "d2l0aCB0aGU=" # with the
140
- # },
141
- # {
142
- # url: "/gums/",
143
- # method: "post",
144
- # data: { news: "good", in_style: true },
145
- # clue: "http://ruby-doc.org/stdlib-2.1.2/libdoc/base64/rdoc/Base64.html",
146
- # code: "cm0gLXJm" # rm -rf
147
- # }
148
107
  }
149
-
150
- #
151
- # HINTS = [
152
- # "I like Twin Peaks",
153
- # "Join your hints together",
154
- # "Try using query strings",
155
- # "The owls have eyes",
156
- # "Always check your headers"
157
- # ]
158
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: another_place
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - phlco