waylon-jokes 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/waylon/jokes/version.rb +1 -1
- data/lib/waylon/skills/jokes.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a397826750b77c88234b91c4e1dee2c0b07fdee7ed036d50472c5388747f22a0
|
4
|
+
data.tar.gz: 6dd31bed2a97e6d6093eff149a282dcd1d42249b390a713f863b023334e1254a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 797edad1893387b1e224a5d02a355ca3f2dfd6a84a875b9219e83efebef6009aacc3b5f831aa33d5b713331c1f803cec69ed33e6fb0648c57028aec4cf166eb3
|
7
|
+
data.tar.gz: 21a2d7deab78c90bd0c508d3ca72a9088285da3b659da1d532031d6e02f93562db0fdba4eea845ea5297cbf04efac1f8f726c2da18065432c2ddb789ea9f745f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
waylon-jokes (0.
|
4
|
+
waylon-jokes (0.2.0)
|
5
5
|
waylon-core (~> 0.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -83,7 +83,7 @@ GEM
|
|
83
83
|
diff-lcs (>= 1.2.0, < 2.0)
|
84
84
|
rspec-support (~> 3.11.0)
|
85
85
|
rspec-support (3.11.0)
|
86
|
-
rubocop (1.30.
|
86
|
+
rubocop (1.30.1)
|
87
87
|
parallel (~> 1.10)
|
88
88
|
parser (>= 3.1.0.0)
|
89
89
|
rainbow (>= 2.2.2, < 4.0)
|
data/lib/waylon/jokes/version.rb
CHANGED
data/lib/waylon/skills/jokes.rb
CHANGED
@@ -15,12 +15,24 @@ module Waylon
|
|
15
15
|
|
16
16
|
def tell_a_joke
|
17
17
|
conn = Faraday.new(headers: { accept: "application/json" }) do |f|
|
18
|
-
f.request :retry
|
19
18
|
f.response :json
|
20
19
|
end
|
21
20
|
response = conn.get("https://icanhazdadjoke.com/")
|
22
21
|
|
23
22
|
reply(response.body["joke"])
|
23
|
+
rescue Faraday::Error
|
24
|
+
reply(fallback)
|
25
|
+
end
|
26
|
+
|
27
|
+
def fallback
|
28
|
+
[
|
29
|
+
"I was addicted to the hokey pokey…but I turned myself around.",
|
30
|
+
"What invention allows us to see through walls? Windows.",
|
31
|
+
"The past, the present, and the future walked into a bar. It was tense.",
|
32
|
+
"What's the least-spoken language in the world? Sign language.",
|
33
|
+
"Why do cows wear bells? Because their horns don't work.",
|
34
|
+
"Police arrested a bottle of water because it was wanted in three different states: solid, liquid, and gas."
|
35
|
+
].sample
|
24
36
|
end
|
25
37
|
end
|
26
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waylon-jokes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: waylon-core
|