bot 0.0.33 → 0.0.34
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/bot/context.rb +4 -4
- data/lib/bot/version.rb +1 -1
- data/test/dummy/log/test.log +43 -0
- 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: a10a18d96622e3385da75b17a857a5e6ef45e5d3
|
4
|
+
data.tar.gz: 1fd060a8bfc681a672ea48816bbe58772f006a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae58b2b58ee61a1168ebbbb92e34b40a30ca6cbbd4926bfe0cdc0e8c5d071a00bef9363ba78fddc5a5e8ddc4d7f7beb01a80d3c76377bcb200fa9d2c154c7e34
|
7
|
+
data.tar.gz: b3c332647bfe2c06f1bda8f447fe8f1bacf3caf5b7f9c613a26f7683d6cabdf7d7d015f9bdf752333ae75926125ec272762e8772c69a250b83c9240db2c90ce7
|
data/lib/bot/context.rb
CHANGED
@@ -18,7 +18,7 @@ module Bot
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def get(field)
|
21
|
-
data =
|
21
|
+
data = redis_client.hget(context_key, field)
|
22
22
|
JSON.parse(data) if data.present?
|
23
23
|
rescue JSON::ParserError
|
24
24
|
data
|
@@ -26,15 +26,15 @@ module Bot
|
|
26
26
|
|
27
27
|
def set(context)
|
28
28
|
self.clear
|
29
|
-
|
29
|
+
redis_client.hmset(context_key, context.map { |k, v| [k, v] }.flatten)
|
30
30
|
end
|
31
31
|
|
32
32
|
def add(field, content)
|
33
|
-
|
33
|
+
redis_client.hset context_key, field, content
|
34
34
|
end
|
35
35
|
|
36
36
|
def clear
|
37
|
-
|
37
|
+
redis_client.del context_key
|
38
38
|
end
|
39
39
|
|
40
40
|
def context_key
|
data/lib/bot/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -3162,5 +3162,48 @@ Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
|
3162
3162
|
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3163
3163
|
-------------------
|
3164
3164
|
BotTest: test_truth
|
3165
|
+
-------------------
|
3166
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3167
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.5ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
3168
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
3169
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3170
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
3171
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
3172
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
3173
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
3174
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3175
|
+
---------------------------
|
3176
|
+
NavigationTest: test_notify
|
3177
|
+
---------------------------
|
3178
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-04-28 16:58:15 -0400
|
3179
|
+
Processing by Bot::BotController#notify as HTML
|
3180
|
+
Parameters: {"bot"=>ApplicationHandler}
|
3181
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3182
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-04-28 16:58:15 -0400
|
3183
|
+
Processing by Bot::BotController#notify as HTML
|
3184
|
+
Parameters: {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"text", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3185
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3186
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3187
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3188
|
+
---------------------------------------
|
3189
|
+
NavigationTest: test_notify_multi_types
|
3190
|
+
---------------------------------------
|
3191
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-04-28 16:58:15 -0400
|
3192
|
+
Processing by Bot::BotController#notify as HTML
|
3193
|
+
Parameters: {"messages"=>[{"body"=>"multi", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3194
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3195
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3196
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
3197
|
+
-----------------------------------------
|
3198
|
+
NavigationTest: test_notify_special_types
|
3199
|
+
-----------------------------------------
|
3200
|
+
Started POST "/bot/notify" for 127.0.0.1 at 2016-04-28 16:58:15 -0400
|
3201
|
+
Processing by Bot::BotController#notify as HTML
|
3202
|
+
Parameters: {"messages"=>[{"body"=>"Hello", "readReceiptRequested"=>"true", "from"=>"bnmrrs", "timestamp"=>"1452785908454", "type"=>"scan-data", "id"=>"2af0d873-d157-4627-b863-8be11b0dfd86"}], "bot"=>ApplicationHandler}
|
3203
|
+
Completed 200 OK in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms)
|
3204
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3205
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
3206
|
+
-------------------
|
3207
|
+
BotTest: test_truth
|
3165
3208
|
-------------------
|
3166
3209
|
[1m[35m (0.0ms)[0m rollback transaction
|