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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e42f8139af0d116901738ca8bc6a51933818105c491df9a8ebe1f76baf28c175
4
- data.tar.gz: 72351eff53e4308af07bdce240b23cf07a2b4d7a6ddb28d19725c5b4ef9be4e7
3
+ metadata.gz: a397826750b77c88234b91c4e1dee2c0b07fdee7ed036d50472c5388747f22a0
4
+ data.tar.gz: 6dd31bed2a97e6d6093eff149a282dcd1d42249b390a713f863b023334e1254a
5
5
  SHA512:
6
- metadata.gz: 3ef6e292db6485cf8ad8093c0f8da309e44f166860a409a16bc032d76bc5036d2850aa2fce3b8da1ff60d6cef1446cd59e08a26967354d8e399001ae401372d6
7
- data.tar.gz: 210c5cf9b02d7fe242e58a1e013e9e5262bc7edca34f1d55f81bf9b1806cdb29bf161c213931d8006ef6933b58ca008cdff30897a78e54f02cb8f7fd6707fde2
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.1.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.0)
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Waylon
4
4
  module Jokes
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -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.1.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-20 00:00:00.000000000 Z
11
+ date: 2022-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: waylon-core