jarvis-cli 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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +47 -0
  3. data/Rakefile +9 -0
  4. data/features/giphy_service.feature +3 -0
  5. data/features/i_heart_quotes_service.feature +21 -0
  6. data/features/step_definitions/giphy_steps.rb +3 -0
  7. data/features/step_definitions/server_steps.rb +1 -1
  8. data/features/step_definitions/weather_steps.rb +3 -0
  9. data/features/support/env.rb +1 -2
  10. data/features/support/vcr_cassettes/Giphy_Service/Bacon.yml +2 -2
  11. data/features/support/vcr_cassettes/Giphy_Service/Cat_GIF_-_Cat_Wording.yml +2 -2
  12. data/features/support/vcr_cassettes/Giphy_Service/Cat_GIF_-_Kitty_Wording.yml +2 -2
  13. data/features/support/vcr_cassettes/Giphy_Service/Cat_GIF_-_Kitty_Wording_-_Case_Insensitive.yml +2 -2
  14. data/features/support/vcr_cassettes/Giphy_Service/Plain_old_GIF.yml +2 -2
  15. data/features/support/vcr_cassettes/Giphy_Service/Sloth.yml +2 -2
  16. data/features/support/vcr_cassettes/Giphy_Service/Trippy.yml +2 -2
  17. data/features/support/vcr_cassettes/I_Heart_Quotes/A_Random_Quote.yml +44 -0
  18. data/features/support/vcr_cassettes/I_Heart_Quotes/A_Simpsons_Quote.yml +44 -0
  19. data/features/support/vcr_cassettes/I_Heart_Quotes/A_Star_Wars_Quote.yml +44 -0
  20. data/features/support/vcr_cassettes/Weather_Service/Use_a_specified_location.yml +86 -0
  21. data/features/support/vcr_cassettes/Weather_Service/Use_default_location.yml +86 -0
  22. data/features/weather_service.feature +21 -0
  23. data/jarvis-cli.gemspec +4 -0
  24. data/lib/jarvis.rb +8 -0
  25. data/lib/jarvis/api/response.rb +11 -1
  26. data/lib/jarvis/refinements.rb +1 -0
  27. data/lib/jarvis/refinements/zip_refinement.rb +11 -0
  28. data/lib/jarvis/server.rb +1 -1
  29. data/lib/jarvis/service.rb +2 -2
  30. data/lib/jarvis/services.rb +2 -0
  31. data/lib/jarvis/services/fact.rb +1 -1
  32. data/lib/jarvis/services/i_heart_quotes.rb +29 -0
  33. data/lib/jarvis/services/weather.rb +42 -0
  34. data/lib/jarvis/test_support/cucumber.rb +1 -0
  35. data/lib/jarvis/test_support/test_support.rb +7 -0
  36. data/lib/jarvis/version.rb +1 -1
  37. data/spec/jarvis/jarvis_spec.rb +6 -0
  38. data/spec/services/giphy_spec.rb +1 -0
  39. data/spec/services/i_heart_quotes_spec.rb +50 -0
  40. data/spec/services/weather_spec.rb +17 -0
  41. data/spec/spec_helper.rb +0 -6
  42. data/spec/support/fixtures/vcr_cassettes/giphy.yml +240 -5
  43. data/spec/support/fixtures/vcr_cassettes/i_heart_quotes.yml +222 -0
  44. data/spec/support/fixtures/vcr_cassettes/weather.yml +346 -0
  45. data/templates/project/bot/server.rb +1 -1
  46. metadata +90 -2
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.zippopotam.us/us/43204
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sun, 22 Feb 2015 01:41:52 GMT
23
+ Server:
24
+ - Apache/2.4.7
25
+ Content-Length:
26
+ - '212'
27
+ X-Cache:
28
+ - hit
29
+ Charset:
30
+ - UTF-8
31
+ Vary:
32
+ - Accept-Encoding
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Content-Type:
36
+ - application/json
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"post code": "43204", "country": "United States", "country abbreviation":
40
+ "US", "places": [{"place name": "Columbus", "longitude": "-83.078", "state":
41
+ "Ohio", "state abbreviation": "OH", "latitude": "39.9523"}]}'
42
+ http_version:
43
+ recorded_at: Sun, 22 Feb 2015 01:41:52 GMT
44
+ - request:
45
+ method: get
46
+ uri: http://api.openweathermap.org/data/2.5/weather?q=Columbus,%20OH
47
+ body:
48
+ encoding: US-ASCII
49
+ string: ''
50
+ headers:
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ Accept:
54
+ - "*/*"
55
+ User-Agent:
56
+ - Ruby
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Server:
63
+ - nginx
64
+ Date:
65
+ - Sun, 22 Feb 2015 01:41:52 GMT
66
+ Content-Type:
67
+ - application/json; charset=utf-8
68
+ Transfer-Encoding:
69
+ - chunked
70
+ Connection:
71
+ - keep-alive
72
+ X-Source:
73
+ - back
74
+ Access-Control-Allow-Origin:
75
+ - "*"
76
+ Access-Control-Allow-Credentials:
77
+ - 'true'
78
+ Access-Control-Allow-Methods:
79
+ - GET, POST
80
+ body:
81
+ encoding: UTF-8
82
+ string: |
83
+ {"coord":{"lon":-83,"lat":39.96},"sys":{"message":0.0235,"country":"United States of America","sunrise":1424607278,"sunset":1424646972},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"base":"cmc stations","main":{"temp":277.284,"temp_min":277.284,"temp_max":277.284,"pressure":996.01,"sea_level":1029.3,"grnd_level":996.01,"humidity":99},"wind":{"speed":1.66,"deg":140.001},"clouds":{"all":92},"rain":{"3h":2},"dt":1424569257,"id":4509177,"name":"Columbus","cod":200}
84
+ http_version:
85
+ recorded_at: Sun, 22 Feb 2015 01:41:52 GMT
86
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,21 @@
1
+ @vcr
2
+
3
+ Feature: Weather Service
4
+
5
+ Because I live in the midwest
6
+ As a person who doesn't want to get rained on
7
+ I want Jarvis to tell me if I need an umbrella
8
+
9
+ Background:
10
+ Given a default location of 43240
11
+
12
+ Scenario: Use default location
13
+ Given a server is running with the weather service enabled
14
+ When Jarvis recieves the message "Jarvis what's the weather like?"
15
+ Then Jarvis will respond with "Light rain. The temperature is currently 38"
16
+
17
+
18
+ Scenario: Use a specified location
19
+ Given a server is running with the weather service enabled
20
+ When Jarvis recieves the message "Jarvis what's the weather like in 90210?"
21
+ Then Jarvis will respond with "Broken clouds. The temperature is currently 51"
data/jarvis-cli.gemspec CHANGED
@@ -25,6 +25,10 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "webmock"
26
26
  spec.add_development_dependency "cucumber"
27
27
  spec.add_development_dependency "capybara"
28
+ spec.add_development_dependency "guard"
29
+ spec.add_development_dependency "guard-rspec"
30
+ spec.add_development_dependency "guard-cucumber"
31
+ spec.add_development_dependency "terminal-notifier-guard"
28
32
  spec.add_dependency "sinatra"
29
33
  spec.add_dependency "sinatra-contrib"
30
34
  spec.add_dependency "httparty"
data/lib/jarvis.rb CHANGED
@@ -5,6 +5,7 @@ require 'jarvis/server'
5
5
  require 'jarvis/service'
6
6
  require 'jarvis/exceptions'
7
7
  require 'jarvis/interpreter'
8
+ require 'jarvis/refinements'
8
9
  require 'jarvis/services'
9
10
  require 'jarvis/slack'
10
11
  require 'jarvis/api/response'
@@ -39,5 +40,12 @@ module Jarvis
39
40
  Jarvis::API::Response.new HTTParty.get(*args, &blk)
40
41
  end
41
42
 
43
+ def encode_uri(str)
44
+ URI.encode(str)
45
+ end
46
+
47
+ def decode_uri(str)
48
+ URI.decode(str)
49
+ end
42
50
  end
43
51
  end
@@ -1,12 +1,22 @@
1
1
  module Jarvis
2
2
  module API
3
3
  class Response
4
+ require 'json'
4
5
  attr_accessor :status, :response
5
6
 
6
7
  def initialize(response)
7
8
  @status = response.code
8
- @response = response.parsed_response
9
+ @response = response.body
9
10
  end
11
+
12
+ def response
13
+ JSON.parse @response
14
+ end
15
+
16
+ def unparsed_response
17
+ @response
18
+ end
19
+
10
20
  end
11
21
  end
12
22
  end
@@ -0,0 +1 @@
1
+ require 'jarvis/refinements/zip_refinement'
@@ -0,0 +1,11 @@
1
+ module ZipRefinement
2
+ refine String do
3
+ def contains_zip?
4
+ self.match(/\d{5}/) ? true : false
5
+ end
6
+
7
+ def zip_code
8
+ self.match(/(?<zip>\d{5})/)[:zip]
9
+ end
10
+ end
11
+ end
data/lib/jarvis/server.rb CHANGED
@@ -17,7 +17,7 @@ module Jarvis
17
17
  begin
18
18
  json text: run_service(service)
19
19
  rescue Jarvis::UnfitEnvironmentException => e
20
- json text: "I'm really sorry, but that sevice needs to be configured"
20
+ json text: "I'm really sorry, but that service needs to be configured"
21
21
  rescue => e
22
22
  json text: "I'm sorry, Something went wrong: #{e}"
23
23
  end
@@ -63,9 +63,9 @@ module Jarvis
63
63
  def self.invoke_with(method_name)
64
64
  send :define_method, :invoke do
65
65
  run_hook :before_invoke
66
- response = send method_name
66
+ self.response = send method_name
67
67
  run_hook :after_invoke
68
- response
68
+ self.response
69
69
  end
70
70
  end
71
71
 
@@ -3,3 +3,5 @@ require 'jarvis/services/dice'
3
3
  require 'jarvis/services/eightball'
4
4
  require 'jarvis/services/fact'
5
5
  require 'jarvis/services/giphy'
6
+ require 'jarvis/services/i_heart_quotes'
7
+ require 'jarvis/services/weather'
@@ -2,6 +2,6 @@ class Fact < Jarvis::Service
2
2
  phrases "fact"
3
3
 
4
4
  def run
5
- Jarvis.get("http://numbersapi.com/random").response
5
+ Jarvis.get("http://numbersapi.com/random").unparsed_response
6
6
  end
7
7
  end
@@ -0,0 +1,29 @@
1
+ class IHeartQuotes < Jarvis::Service
2
+ phrases "quote"
3
+ after_invoke :extract_quote
4
+
5
+ def run
6
+ Jarvis.get(request_url).response
7
+ end
8
+
9
+ private
10
+
11
+ def extract_quote
12
+ self.response = self.response["quote"].strip
13
+ end
14
+
15
+ def request_url
16
+ "http://iheartquotes.com/api/v1/random?format=json#{source}"
17
+ end
18
+
19
+ def source
20
+ case text
21
+ when /simpsons|homer/i
22
+ "&source=simpsons_homer"
23
+ when /star wars|luke|leia|vader/i
24
+ "&source=starwars"
25
+ else
26
+ ""
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,42 @@
1
+ class Weather < Jarvis::Service
2
+ using ZipRefinement
3
+
4
+ phrases "weather"
5
+ before_invoke :determine_location
6
+ environment :default_location # Default Location Should be a zip code
7
+ attr_accessor :location, :zip_api_response, :temperature, :parsed_response
8
+
9
+ def run
10
+ self.response = Jarvis.get("http://api.openweathermap.org/data/2.5/weather?q=#{encoded_location}").response
11
+ calculate_temperature
12
+ self.response = "#{weather_description}. The temperature is currently #{temperature}"
13
+ end
14
+
15
+ private
16
+
17
+ def determine_location
18
+ self.location = if text.contains_zip?
19
+ lookup_zip(text.zip_code)
20
+ else
21
+ lookup_zip(default_location)
22
+ end
23
+ end
24
+
25
+ def encoded_location
26
+ Jarvis.encode_uri(@location)
27
+ end
28
+
29
+ def lookup_zip(zip)
30
+ zip_api_response = Jarvis.get("http://api.zippopotam.us/us/#{zip}").response["places"].first
31
+ "#{zip_api_response["place name"]}, #{zip_api_response["state abbreviation"]}"
32
+ end
33
+
34
+ def weather_description
35
+ self.response["weather"].first["description"].humanize
36
+ end
37
+
38
+ def calculate_temperature
39
+ self.temperature = (((self.response["main"]["temp"].to_i - 273.15) * 1.8) + 32).to_i
40
+ end
41
+
42
+ end
@@ -0,0 +1 @@
1
+ require 'cucumber/rspec/doubles'
@@ -1,5 +1,7 @@
1
1
  module Jarvis
2
2
  module TestSupport
3
+ require 'rspec/mocks'
4
+
3
5
  def slack_outgoing_message(options={text:"Jarvis, what's going on?"})
4
6
  {
5
7
  "team_id" => options[:team_id] || "T0001",
@@ -16,5 +18,10 @@ module Jarvis
16
18
  def parsed_response(response)
17
19
  JSON.parse(response.body)["text"]
18
20
  end
21
+
22
+ def stub_env(hash)
23
+ stub_const('ENV', ENV.to_hash.merge(hash))
24
+ end
25
+
19
26
  end
20
27
  end
@@ -1,3 +1,3 @@
1
1
  module Jarvis
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -13,4 +13,10 @@ RSpec.describe Jarvis do
13
13
  end
14
14
  end
15
15
 
16
+ describe "Utilities" do
17
+
18
+ it { expect(Jarvis.encode_uri("hello world")).to eq "hello%20world" }
19
+ it { expect(Jarvis.decode_uri("hello%20world")).to eq "hello world" }
20
+ end
21
+
16
22
  end
@@ -1,6 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Giphy, vcr: { cassette_name: 'giphy', :record => :new_episodes} do
4
+ before { stub_env("GIPHY_API_VERSION" => "v1", "GIPHY_API_KEY" => "key") }
4
5
  describe "Any old GIF" do
5
6
  let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a gif please")) }
6
7
  subject { described_class.new message }
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe IHeartQuotes, vcr: { cassette_name: 'i_heart_quotes', :record => :new_episodes} do
4
+ describe "A random quote" do
5
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a quote please")) }
6
+ subject { described_class.new message }
7
+ it { expect(subject.invoke).to eq "Prosperity makes friends, adversity tries them.\n\t\t-- Publilius Syrus" }
8
+ end
9
+
10
+ describe "Simpsons Quotes" do
11
+ let(:simpsons_response) { "Homer:\tI don't want you to see me sitting on my worthless butt.\n\nBart:\tWe've seen it, Dad.\n\n\t\t Homer at the Bat" }
12
+ context "Homer" do
13
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a homer quote please")) }
14
+ subject { described_class.new message }
15
+ it { expect(subject.invoke).to eq simpsons_response }
16
+ end
17
+ context "Simpsons" do
18
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a simpsons quote please")) }
19
+ subject { described_class.new message }
20
+ it { expect(subject.invoke).to eq simpsons_response }
21
+ end
22
+ end
23
+
24
+ describe "Star Wars" do
25
+ let(:star_wars_response) { "Han Solo:\n\tAfraid I was gonna leave without giving you a\n\tgoodbye kiss?\nPrincess Leia:\n\tI'd just as soon kiss a Wookiee!\nHan Solo:\n\tI can arrange that! You could use a good kiss!" }
26
+ context "Star Wars" do
27
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a star wars quote please")) }
28
+ subject { described_class.new message }
29
+ it { expect(subject.invoke).to eq star_wars_response }
30
+ end
31
+
32
+ context "Luke" do
33
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a luke quote please")) }
34
+ subject { described_class.new message }
35
+ it { expect(subject.invoke).to eq star_wars_response }
36
+ end
37
+
38
+ context "Leia" do
39
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a leia quote please")) }
40
+ subject { described_class.new message }
41
+ it { expect(subject.invoke).to eq star_wars_response }
42
+ end
43
+
44
+ context "Vader" do
45
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, a darth vader quote please")) }
46
+ subject { described_class.new message }
47
+ it { expect(subject.invoke).to eq star_wars_response }
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Weather, vcr: { cassette_name: 'weather', :record => :new_episodes} do
4
+ describe "Providing a ZIP" do
5
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, what's the weather in 90210")) }
6
+ subject { described_class.new message }
7
+ it { expect(subject.invoke).to eq "Sky is clear. The temperature is currently 60" }
8
+ end
9
+
10
+ describe "Default Location" do
11
+ before {stub_env('DEFAULT_LOCATION' => "43123")}
12
+ let(:message) { Slack::Message.new(slack_outgoing_message(text: "Jarvis, what's the weather")) }
13
+ subject { described_class.new message }
14
+ it { expect(subject.invoke).to eq "Light rain. The temperature is currently 35" }
15
+ end
16
+
17
+ end
data/spec/spec_helper.rb CHANGED
@@ -16,12 +16,6 @@ def app
16
16
  Jarvis::Server
17
17
  end
18
18
 
19
- def stub_env(hash)
20
- hash.each do |key, value|
21
- allow(ENV).to receive(:[]).with(key) { value }
22
- end
23
- end
24
-
25
19
  RSpec.configure do |config|
26
20
  config.expose_dsl_globally = false
27
21
  config.around(:each) do |example|
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC
5
+ uri: http://api.giphy.com/v1/gifs/random?api_key=key
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -57,7 +57,7 @@ http_interactions:
57
57
  recorded_at: Fri, 20 Feb 2015 20:30:48 GMT
58
58
  - request:
59
59
  method: get
60
- uri: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cat
60
+ uri: http://api.giphy.com/v1/gifs/random?api_key=key&tag=cat
61
61
  body:
62
62
  encoding: US-ASCII
63
63
  string: ''
@@ -112,7 +112,7 @@ http_interactions:
112
112
  recorded_at: Fri, 20 Feb 2015 20:35:08 GMT
113
113
  - request:
114
114
  method: get
115
- uri: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=sloth
115
+ uri: http://api.giphy.com/v1/gifs/random?api_key=key&tag=sloth
116
116
  body:
117
117
  encoding: US-ASCII
118
118
  string: ''
@@ -167,7 +167,7 @@ http_interactions:
167
167
  recorded_at: Fri, 20 Feb 2015 20:36:35 GMT
168
168
  - request:
169
169
  method: get
170
- uri: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=bacon
170
+ uri: http://api.giphy.com/v1/gifs/random?api_key=key&tag=bacon
171
171
  body:
172
172
  encoding: US-ASCII
173
173
  string: ''
@@ -222,7 +222,7 @@ http_interactions:
222
222
  recorded_at: Fri, 20 Feb 2015 20:37:44 GMT
223
223
  - request:
224
224
  method: get
225
- uri: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=trippy
225
+ uri: http://api.giphy.com/v1/gifs/random?api_key=key&tag=trippy
226
226
  body:
227
227
  encoding: US-ASCII
228
228
  string: ''
@@ -275,4 +275,239 @@ http_interactions:
275
275
  {"data":{"type":"gif","id":"muAhZqHWt0bv2","url":"http:\/\/giphy.com\/gifs\/trippy-psychedelic-eye-muAhZqHWt0bv2","image_original_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/giphy.gif","image_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/giphy.gif","image_mp4_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/giphy.mp4","image_frames":"19","image_width":"500","image_height":"369","fixed_height_downsampled_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/200_d.gif","fixed_height_downsampled_width":"271","fixed_height_downsampled_height":"200","fixed_width_downsampled_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/200w_d.gif","fixed_width_downsampled_width":"200","fixed_width_downsampled_height":"148","fixed_height_small_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/100.gif","fixed_height_small_still_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/100_s.gif","fixed_height_small_width":"136","fixed_height_small_height":"100","fixed_width_small_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/100w.gif","fixed_width_small_still_url":"http:\/\/s3.amazonaws.com\/giphymedia\/media\/muAhZqHWt0bv2\/100w_s.gif","fixed_width_small_width":"100","fixed_width_small_height":"74","rating":"y","username":"","caption":"","tags":["trippy","psychedelic","eye","camera","flash"]},"meta":{"status":200,"msg":"OK"}}
276
276
  http_version:
277
277
  recorded_at: Fri, 20 Feb 2015 20:38:45 GMT
278
+ - request:
279
+ method: get
280
+ uri: http://api.giphy.com//gifs/random?api_key=
281
+ body:
282
+ encoding: US-ASCII
283
+ string: ''
284
+ headers:
285
+ Accept-Encoding:
286
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
287
+ Accept:
288
+ - "*/*"
289
+ User-Agent:
290
+ - Ruby
291
+ response:
292
+ status:
293
+ code: 404
294
+ message: Not Found
295
+ headers:
296
+ Accept-Ranges:
297
+ - bytes
298
+ Age:
299
+ - '0'
300
+ Content-Type:
301
+ - application/json
302
+ Date:
303
+ - Sun, 22 Feb 2015 01:34:34 GMT
304
+ Server:
305
+ - nginx/1.4.6 (Ubuntu)
306
+ Vary:
307
+ - Accept-Encoding
308
+ Via:
309
+ - 1.1 varnish
310
+ X-Powered-By:
311
+ - PHP/5.5.9-1ubuntu4
312
+ X-Varnish:
313
+ - '490645020'
314
+ Content-Length:
315
+ - '63'
316
+ Connection:
317
+ - keep-alive
318
+ body:
319
+ encoding: UTF-8
320
+ string: |2-
321
+
322
+ {"meta":{"status":404,"msg":"Not Found!"}}
323
+ http_version:
324
+ recorded_at: Sun, 22 Feb 2015 01:34:00 GMT
325
+ - request:
326
+ method: get
327
+ uri: http://api.giphy.com//gifs/random?api_key=&tag=cat
328
+ body:
329
+ encoding: US-ASCII
330
+ string: ''
331
+ headers:
332
+ Accept-Encoding:
333
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
334
+ Accept:
335
+ - "*/*"
336
+ User-Agent:
337
+ - Ruby
338
+ response:
339
+ status:
340
+ code: 404
341
+ message: Not Found
342
+ headers:
343
+ Accept-Ranges:
344
+ - bytes
345
+ Age:
346
+ - '0'
347
+ Content-Type:
348
+ - application/json
349
+ Date:
350
+ - Sun, 22 Feb 2015 01:33:35 GMT
351
+ Server:
352
+ - nginx/1.4.6 (Ubuntu)
353
+ Vary:
354
+ - Accept-Encoding
355
+ Via:
356
+ - 1.1 varnish
357
+ X-Powered-By:
358
+ - PHP/5.5.9-1ubuntu4
359
+ X-Varnish:
360
+ - '1927175401'
361
+ Content-Length:
362
+ - '63'
363
+ Connection:
364
+ - keep-alive
365
+ body:
366
+ encoding: UTF-8
367
+ string: |2-
368
+
369
+ {"meta":{"status":404,"msg":"Not Found!"}}
370
+ http_version:
371
+ recorded_at: Sun, 22 Feb 2015 01:34:00 GMT
372
+ - request:
373
+ method: get
374
+ uri: http://api.giphy.com//gifs/random?api_key=&tag=sloth
375
+ body:
376
+ encoding: US-ASCII
377
+ string: ''
378
+ headers:
379
+ Accept-Encoding:
380
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
381
+ Accept:
382
+ - "*/*"
383
+ User-Agent:
384
+ - Ruby
385
+ response:
386
+ status:
387
+ code: 404
388
+ message: Not Found
389
+ headers:
390
+ Accept-Ranges:
391
+ - bytes
392
+ Age:
393
+ - '0'
394
+ Content-Type:
395
+ - application/json
396
+ Date:
397
+ - Sun, 22 Feb 2015 01:33:58 GMT
398
+ Server:
399
+ - nginx/1.4.6 (Ubuntu)
400
+ Vary:
401
+ - Accept-Encoding
402
+ Via:
403
+ - 1.1 varnish
404
+ X-Powered-By:
405
+ - PHP/5.5.9-1ubuntu4
406
+ X-Varnish:
407
+ - '300518237'
408
+ Content-Length:
409
+ - '63'
410
+ Connection:
411
+ - keep-alive
412
+ body:
413
+ encoding: UTF-8
414
+ string: |2-
415
+
416
+ {"meta":{"status":404,"msg":"Not Found!"}}
417
+ http_version:
418
+ recorded_at: Sun, 22 Feb 2015 01:34:01 GMT
419
+ - request:
420
+ method: get
421
+ uri: http://api.giphy.com//gifs/random?api_key=&tag=bacon
422
+ body:
423
+ encoding: US-ASCII
424
+ string: ''
425
+ headers:
426
+ Accept-Encoding:
427
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
428
+ Accept:
429
+ - "*/*"
430
+ User-Agent:
431
+ - Ruby
432
+ response:
433
+ status:
434
+ code: 404
435
+ message: Not Found
436
+ headers:
437
+ Accept-Ranges:
438
+ - bytes
439
+ Age:
440
+ - '0'
441
+ Content-Type:
442
+ - application/json
443
+ Date:
444
+ - Sun, 22 Feb 2015 01:33:46 GMT
445
+ Server:
446
+ - nginx/1.4.6 (Ubuntu)
447
+ Vary:
448
+ - Accept-Encoding
449
+ Via:
450
+ - 1.1 varnish
451
+ X-Powered-By:
452
+ - PHP/5.5.9-1ubuntu4
453
+ X-Varnish:
454
+ - '136002449'
455
+ Content-Length:
456
+ - '63'
457
+ Connection:
458
+ - keep-alive
459
+ body:
460
+ encoding: UTF-8
461
+ string: |2-
462
+
463
+ {"meta":{"status":404,"msg":"Not Found!"}}
464
+ http_version:
465
+ recorded_at: Sun, 22 Feb 2015 01:34:01 GMT
466
+ - request:
467
+ method: get
468
+ uri: http://api.giphy.com//gifs/random?api_key=&tag=trippy
469
+ body:
470
+ encoding: US-ASCII
471
+ string: ''
472
+ headers:
473
+ Accept-Encoding:
474
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
475
+ Accept:
476
+ - "*/*"
477
+ User-Agent:
478
+ - Ruby
479
+ response:
480
+ status:
481
+ code: 404
482
+ message: Not Found
483
+ headers:
484
+ Accept-Ranges:
485
+ - bytes
486
+ Age:
487
+ - '0'
488
+ Content-Type:
489
+ - application/json
490
+ Date:
491
+ - Sun, 22 Feb 2015 01:33:36 GMT
492
+ Server:
493
+ - nginx/1.4.6 (Ubuntu)
494
+ Vary:
495
+ - Accept-Encoding
496
+ Via:
497
+ - 1.1 varnish
498
+ X-Powered-By:
499
+ - PHP/5.5.9-1ubuntu4
500
+ X-Varnish:
501
+ - '1927175417'
502
+ Content-Length:
503
+ - '63'
504
+ Connection:
505
+ - keep-alive
506
+ body:
507
+ encoding: UTF-8
508
+ string: |2-
509
+
510
+ {"meta":{"status":404,"msg":"Not Found!"}}
511
+ http_version:
512
+ recorded_at: Sun, 22 Feb 2015 01:34:01 GMT
278
513
  recorded_with: VCR 2.9.3