abril_heartbeat 1.0.0 → 1.1.0
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/abril_heartbeat.rb +14 -14
 - data/lib/abril_heartbeat/checkers/abstract_checker.rb +5 -7
 - data/lib/abril_heartbeat/checkers/mongo_checker.rb +5 -7
 - data/lib/abril_heartbeat/checkers/mysql_checker.rb +5 -7
 - data/lib/abril_heartbeat/checkers/redis_checker.rb +5 -7
 - data/lib/abril_heartbeat/checkers/rest_checker.rb +14 -14
 - data/lib/abril_heartbeat/config_loader.rb +7 -7
 - data/lib/abril_heartbeat/heartbeater.rb +5 -5
 - data/lib/abril_heartbeat/version.rb +1 -1
 - data/lib/abril_heartbeat/wrappers/mongo_wrapper.rb +1 -1
 - data/lib/abril_heartbeat/wrappers/mysql_wrapper.rb +1 -1
 - data/lib/abril_heartbeat/wrappers/redis_wrapper.rb +1 -1
 - data/spec/checkers/mongo_checker_spec.rb +4 -4
 - data/spec/checkers/mysql_checker_spec.rb +4 -4
 - data/spec/checkers/redis_checker_spec.rb +4 -4
 - data/spec/checkers/rest_checker_spec.rb +3 -3
 - data/spec/heartbeater_spec.rb +9 -9
 - data/spec/support/shared_examples/checker_share.rb +1 -1
 - metadata +2 -4
 - data/spec/cassettes/HeartbeatAbril_Middleware/when_middleware_handles_the_request/responds_success.yml +0 -111
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 151615ea0de619412b3cdd9ca7e08adb5d650931
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d881ece89929c7e6b36f8f6bf944f72fd1f32773
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 198171c751b44416d834ec25782b56572e07c0510402b4764027140396efbf80227211ddba1097233cbe80d1058846aed34c954d69f4a8fb06b5d0f1a22148c1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8c4a95edbe456febc7338c6a959c33fb8fe3514f777c35b7df0eff2e57b8b02a2ad5d21ce760c063c7b37807474f685a9089c8403c02e7bc93e63529f649d720
         
     | 
    
        data/lib/abril_heartbeat.rb
    CHANGED
    
    | 
         @@ -1,25 +1,25 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require  
     | 
| 
       2 
     | 
    
         
            -
            require  
     | 
| 
       3 
     | 
    
         
            -
            require  
     | 
| 
      
 1 
     | 
    
         
            +
            require 'json'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'abril_heartbeat/version'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'abril_heartbeat/heartbeater'
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            # Config Loader
         
     | 
| 
       6 
     | 
    
         
            -
            require  
     | 
| 
      
 6 
     | 
    
         
            +
            require 'abril_heartbeat/config_loader'
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            # Checkers
         
     | 
| 
       9 
     | 
    
         
            -
            require  
     | 
| 
       10 
     | 
    
         
            -
            require  
     | 
| 
       11 
     | 
    
         
            -
            require  
     | 
| 
       12 
     | 
    
         
            -
            require  
     | 
| 
       13 
     | 
    
         
            -
            require  
     | 
| 
      
 9 
     | 
    
         
            +
            require 'abril_heartbeat/checkers/abstract_checker'
         
     | 
| 
      
 10 
     | 
    
         
            +
            require 'abril_heartbeat/checkers/rest_checker'
         
     | 
| 
      
 11 
     | 
    
         
            +
            require 'abril_heartbeat/checkers/mongo_checker'
         
     | 
| 
      
 12 
     | 
    
         
            +
            require 'abril_heartbeat/checkers/mysql_checker'
         
     | 
| 
      
 13 
     | 
    
         
            +
            require 'abril_heartbeat/checkers/redis_checker'
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
            # Wrappers
         
     | 
| 
       16 
     | 
    
         
            -
            require  
     | 
| 
       17 
     | 
    
         
            -
            require  
     | 
| 
       18 
     | 
    
         
            -
            require  
     | 
| 
      
 16 
     | 
    
         
            +
            require 'abril_heartbeat/wrappers/mongo_wrapper'
         
     | 
| 
      
 17 
     | 
    
         
            +
            require 'abril_heartbeat/wrappers/mysql_wrapper'
         
     | 
| 
      
 18 
     | 
    
         
            +
            require 'abril_heartbeat/wrappers/redis_wrapper'
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       21 
21 
     | 
    
         
             
              class Middleware
         
     | 
| 
       22 
     | 
    
         
            -
                def initialize(app, options={})
         
     | 
| 
      
 22 
     | 
    
         
            +
                def initialize(app, options = {})
         
     | 
| 
       23 
23 
     | 
    
         
             
                  @app = app
         
     | 
| 
       24 
24 
     | 
    
         
             
                  @file_path = options[:file_path]
         
     | 
| 
       25 
25 
     | 
    
         
             
                end
         
     | 
| 
         @@ -36,7 +36,7 @@ module AbrilHeartbeat 
     | 
|
| 
       36 
36 
     | 
    
         
             
                private
         
     | 
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
                def response
         
     | 
| 
       39 
     | 
    
         
            -
                  Heartbeater.new( 
     | 
| 
      
 39 
     | 
    
         
            +
                  Heartbeater.new(file_path: @file_path).run!
         
     | 
| 
       40 
40 
     | 
    
         
             
                end
         
     | 
| 
       41 
41 
     | 
    
         | 
| 
       42 
42 
     | 
    
         
             
                def request
         
     | 
| 
         @@ -1,22 +1,20 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       2 
2 
     | 
    
         
             
              class AbstractChecker
         
     | 
| 
       3 
     | 
    
         
            -
                def self. 
     | 
| 
       4 
     | 
    
         
            -
                   
     | 
| 
      
 3 
     | 
    
         
            +
                def self.running?
         
     | 
| 
      
 4 
     | 
    
         
            +
                  fail NotImplementedError
         
     | 
| 
       5 
5 
     | 
    
         
             
                end
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                def self.module_name
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
      
 8 
     | 
    
         
            +
                  fail NotImplementedError
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
11 
     | 
    
         
             
                def self.run!
         
     | 
| 
       12 
12 
     | 
    
         
             
                  status, message = check!
         
     | 
| 
       13 
     | 
    
         
            -
                  { module_name => {  
     | 
| 
      
 13 
     | 
    
         
            +
                  { module_name => { 'status' => status, 'status_message' => message } }
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                private
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
16 
     | 
    
         
             
                def self.check!
         
     | 
| 
       19 
     | 
    
         
            -
                   
     | 
| 
      
 17 
     | 
    
         
            +
                  fail NotImplementedError
         
     | 
| 
       20 
18 
     | 
    
         
             
                end
         
     | 
| 
       21 
19 
     | 
    
         
             
              end
         
     | 
| 
       22 
20 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,20 +1,18 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       2 
2 
     | 
    
         
             
              class MongoChecker < AbstractChecker
         
     | 
| 
       3 
     | 
    
         
            -
                def self. 
     | 
| 
       4 
     | 
    
         
            -
                  MongoWrapper. 
     | 
| 
      
 3 
     | 
    
         
            +
                def self.running?
         
     | 
| 
      
 4 
     | 
    
         
            +
                  MongoWrapper.client?
         
     | 
| 
       5 
5 
     | 
    
         
             
                end
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                def self.module_name
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
      
 8 
     | 
    
         
            +
                  'MONGO'
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                private
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
11 
     | 
    
         
             
                def self.check!
         
     | 
| 
       14 
12 
     | 
    
         
             
                  MongoWrapper.check_status!
         
     | 
| 
       15 
     | 
    
         
            -
                  [ 
     | 
| 
      
 13 
     | 
    
         
            +
                  ['OK', 'Everything is under control']
         
     | 
| 
       16 
14 
     | 
    
         
             
                rescue => exception
         
     | 
| 
       17 
     | 
    
         
            -
                  [ 
     | 
| 
      
 15 
     | 
    
         
            +
                  ['FAIL', exception.message]
         
     | 
| 
       18 
16 
     | 
    
         
             
                end
         
     | 
| 
       19 
17 
     | 
    
         
             
              end
         
     | 
| 
       20 
18 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,20 +1,18 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       2 
2 
     | 
    
         
             
              class MysqlChecker < AbstractChecker
         
     | 
| 
       3 
     | 
    
         
            -
                def self. 
     | 
| 
       4 
     | 
    
         
            -
                  MysqlWrapper. 
     | 
| 
      
 3 
     | 
    
         
            +
                def self.running?
         
     | 
| 
      
 4 
     | 
    
         
            +
                  MysqlWrapper.client?
         
     | 
| 
       5 
5 
     | 
    
         
             
                end
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                def self.module_name
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
      
 8 
     | 
    
         
            +
                  'MYSQL'
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                private
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
11 
     | 
    
         
             
                def self.check!
         
     | 
| 
       14 
12 
     | 
    
         
             
                  MysqlWrapper.check_status!
         
     | 
| 
       15 
     | 
    
         
            -
                  [ 
     | 
| 
      
 13 
     | 
    
         
            +
                  ['OK', 'Everything is under control']
         
     | 
| 
       16 
14 
     | 
    
         
             
                rescue => exception
         
     | 
| 
       17 
     | 
    
         
            -
                  [ 
     | 
| 
      
 15 
     | 
    
         
            +
                  ['FAIL', exception.message]
         
     | 
| 
       18 
16 
     | 
    
         
             
                end
         
     | 
| 
       19 
17 
     | 
    
         
             
              end
         
     | 
| 
       20 
18 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,20 +1,18 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       2 
2 
     | 
    
         
             
              class RedisChecker < AbstractChecker
         
     | 
| 
       3 
     | 
    
         
            -
                def self. 
     | 
| 
       4 
     | 
    
         
            -
                  RedisWrapper. 
     | 
| 
      
 3 
     | 
    
         
            +
                def self.running?
         
     | 
| 
      
 4 
     | 
    
         
            +
                  RedisWrapper.client?
         
     | 
| 
       5 
5 
     | 
    
         
             
                end
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
                def self.module_name
         
     | 
| 
       8 
     | 
    
         
            -
                   
     | 
| 
      
 8 
     | 
    
         
            +
                  'REDIS'
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                private
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
11 
     | 
    
         
             
                def self.check!
         
     | 
| 
       14 
12 
     | 
    
         
             
                  RedisWrapper.check_status!
         
     | 
| 
       15 
     | 
    
         
            -
                  [ 
     | 
| 
      
 13 
     | 
    
         
            +
                  ['OK', 'Everything is under control']
         
     | 
| 
       16 
14 
     | 
    
         
             
                rescue => exception
         
     | 
| 
       17 
     | 
    
         
            -
                  [ 
     | 
| 
      
 15 
     | 
    
         
            +
                  ['FAIL', exception.message]
         
     | 
| 
       18 
16 
     | 
    
         
             
                end
         
     | 
| 
       19 
17 
     | 
    
         
             
              end
         
     | 
| 
       20 
18 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,38 +1,38 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require  
     | 
| 
      
 1 
     | 
    
         
            +
            require 'rest_client'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       4 
4 
     | 
    
         
             
              class RestChecker < AbstractChecker
         
     | 
| 
       5 
     | 
    
         
            -
                def self. 
     | 
| 
      
 5 
     | 
    
         
            +
                def self.running?
         
     | 
| 
       6 
6 
     | 
    
         
             
                  !rest_hash.empty?
         
     | 
| 
       7 
7 
     | 
    
         
             
                end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
9 
     | 
    
         
             
                def self.run!
         
     | 
| 
       10 
10 
     | 
    
         
             
                  messages = rest_hash.map do |key, value|
         
     | 
| 
       11 
     | 
    
         
            -
                    status, message = check!{ value['url'] }
         
     | 
| 
       12 
     | 
    
         
            -
                    { key => {  
     | 
| 
      
 11 
     | 
    
         
            +
                    status, message = check! { value['url'] }
         
     | 
| 
      
 12 
     | 
    
         
            +
                    { key => { 'url' => value['url'], 'status' => status, 'status_message' => message } }
         
     | 
| 
       13 
13 
     | 
    
         
             
                  end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                  { module_name => messages }
         
     | 
| 
       16 
16 
     | 
    
         
             
                end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                def self.module_name
         
     | 
| 
       19 
     | 
    
         
            -
                   
     | 
| 
      
 19 
     | 
    
         
            +
                  'REST'
         
     | 
| 
       20 
20 
     | 
    
         
             
                end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                 
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
                def self.rest_hash
         
     | 
| 
       25 
     | 
    
         
            -
                  ConfigLoader.load_by_type(:rest)
         
     | 
| 
       26 
     | 
    
         
            -
                end
         
     | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
       28 
     | 
    
         
            -
                def self.check!(&block)
         
     | 
| 
      
 22 
     | 
    
         
            +
                def self.check!
         
     | 
| 
       29 
23 
     | 
    
         
             
                  url = yield
         
     | 
| 
       30 
24 
     | 
    
         
             
                  response = RestClient.get(url)
         
     | 
| 
       31 
     | 
    
         
            -
                  [response.code,  
     | 
| 
      
 25 
     | 
    
         
            +
                  [response.code, 'OK']
         
     | 
| 
       32 
26 
     | 
    
         
             
                rescue RestClient::ResourceNotFound
         
     | 
| 
       33 
     | 
    
         
            -
                  [404,  
     | 
| 
      
 27 
     | 
    
         
            +
                  [404, 'Page Not Found']
         
     | 
| 
       34 
28 
     | 
    
         
             
                rescue => exception
         
     | 
| 
       35 
29 
     | 
    
         
             
                  [nil, exception.message]
         
     | 
| 
       36 
30 
     | 
    
         
             
                end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
                def self.rest_hash
         
     | 
| 
      
 33 
     | 
    
         
            +
                  ConfigLoader.load_by_type(:rest)
         
     | 
| 
      
 34 
     | 
    
         
            +
                end
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
                private_class_method :rest_hash
         
     | 
| 
       37 
37 
     | 
    
         
             
              end
         
     | 
| 
       38 
38 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,22 +1,22 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       2 
2 
     | 
    
         
             
              class ConfigLoader
         
     | 
| 
      
 3 
     | 
    
         
            +
                class << self
         
     | 
| 
      
 4 
     | 
    
         
            +
                  attr_accessor :file_path
         
     | 
| 
      
 5 
     | 
    
         
            +
                end
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
       3 
7 
     | 
    
         
             
                def self.load
         
     | 
| 
       4 
8 
     | 
    
         
             
                  @file ||= load_file
         
     | 
| 
       5 
9 
     | 
    
         
             
                end
         
     | 
| 
       6 
10 
     | 
    
         | 
| 
       7 
11 
     | 
    
         
             
                def self.load_by_type(type)
         
     | 
| 
       8 
12 
     | 
    
         
             
                  return load if load.empty?
         
     | 
| 
       9 
     | 
    
         
            -
                  load.select{|_, v| v['type'] == type.to_s}
         
     | 
| 
       10 
     | 
    
         
            -
                end
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                def self.set_file(file_path)
         
     | 
| 
       13 
     | 
    
         
            -
                  @file_path = file_path
         
     | 
| 
      
 13 
     | 
    
         
            +
                  load.select { |_, v| v['type'] == type.to_s }
         
     | 
| 
       14 
14 
     | 
    
         
             
                end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                def self.load_file
         
     | 
| 
       17 
     | 
    
         
            -
                  return {} unless  
     | 
| 
      
 17 
     | 
    
         
            +
                  return {} unless file_path
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
                  ::YAML.load_file( 
     | 
| 
      
 19 
     | 
    
         
            +
                  ::YAML.load_file(file_path)
         
     | 
| 
       20 
20 
     | 
    
         
             
                end
         
     | 
| 
       21 
21 
     | 
    
         
             
              end
         
     | 
| 
       22 
22 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,9 +1,9 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            require  
     | 
| 
      
 1 
     | 
    
         
            +
            require 'yaml'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module AbrilHeartbeat
         
     | 
| 
       4 
4 
     | 
    
         
             
              class Heartbeater
         
     | 
| 
       5 
     | 
    
         
            -
                def initialize(options={})
         
     | 
| 
       6 
     | 
    
         
            -
                  ConfigLoader. 
     | 
| 
      
 5 
     | 
    
         
            +
                def initialize(options = {})
         
     | 
| 
      
 6 
     | 
    
         
            +
                  ConfigLoader.file_path = options[:file_path] if options[:file_path]
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
                  @checkers = [MongoChecker, MysqlChecker, RedisChecker]
         
     | 
| 
       9 
9 
     | 
    
         
             
                  @checkers += options[:custom_checkers] if options[:custom_checkers]
         
     | 
| 
         @@ -11,10 +11,10 @@ module AbrilHeartbeat 
     | 
|
| 
       11 
11 
     | 
    
         | 
| 
       12 
12 
     | 
    
         
             
                def run!
         
     | 
| 
       13 
13 
     | 
    
         
             
                  response = []
         
     | 
| 
       14 
     | 
    
         
            -
                  response << RestChecker.run! if RestChecker. 
     | 
| 
      
 14 
     | 
    
         
            +
                  response << RestChecker.run! if RestChecker.running?
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
                  @checkers.each do |checker|
         
     | 
| 
       17 
     | 
    
         
            -
                    response << checker.run! if checker. 
     | 
| 
      
 17 
     | 
    
         
            +
                    response << checker.run! if checker.running?
         
     | 
| 
       18 
18 
     | 
    
         
             
                  end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         
             
                  response
         
     | 
| 
         @@ -24,17 +24,17 @@ describe AbrilHeartbeat::MongoChecker do 
     | 
|
| 
       24 
24 
     | 
    
         
             
                end
         
     | 
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
              describe "# 
     | 
| 
      
 27 
     | 
    
         
            +
              describe "#running?" do
         
     | 
| 
       28 
28 
     | 
    
         
             
                context "when the app has a mongo client" do
         
     | 
| 
       29 
     | 
    
         
            -
                  before { allow(AbrilHeartbeat::MongoWrapper).to receive(: 
     | 
| 
      
 29 
     | 
    
         
            +
                  before { allow(AbrilHeartbeat::MongoWrapper).to receive(:client?) { "constant" } }
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 31 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                  it { is_expected.to be_truthy }
         
     | 
| 
       34 
34 
     | 
    
         
             
                end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                context "when the app does not have a mongo client" do
         
     | 
| 
       37 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 37 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  it { is_expected.to be_falsy }
         
     | 
| 
       40 
40 
     | 
    
         
             
                end
         
     | 
| 
         @@ -24,17 +24,17 @@ describe AbrilHeartbeat::MysqlChecker do 
     | 
|
| 
       24 
24 
     | 
    
         
             
                end
         
     | 
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
              describe "# 
     | 
| 
      
 27 
     | 
    
         
            +
              describe "#running?" do
         
     | 
| 
       28 
28 
     | 
    
         
             
                context "when the app has a mysql client" do
         
     | 
| 
       29 
     | 
    
         
            -
                  before { allow(AbrilHeartbeat::MysqlWrapper).to receive(: 
     | 
| 
      
 29 
     | 
    
         
            +
                  before { allow(AbrilHeartbeat::MysqlWrapper).to receive(:client?) { "constant" } }
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 31 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                  it { is_expected.to be_truthy }
         
     | 
| 
       34 
34 
     | 
    
         
             
                end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                context "when the app does not have a mysql client" do
         
     | 
| 
       37 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 37 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  it { is_expected.to be_falsy }
         
     | 
| 
       40 
40 
     | 
    
         
             
                end
         
     | 
| 
         @@ -24,17 +24,17 @@ describe AbrilHeartbeat::RedisChecker do 
     | 
|
| 
       24 
24 
     | 
    
         
             
                end
         
     | 
| 
       25 
25 
     | 
    
         
             
              end
         
     | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
              describe "# 
     | 
| 
      
 27 
     | 
    
         
            +
              describe "#running?" do
         
     | 
| 
       28 
28 
     | 
    
         
             
                context "when the app has a redis client" do
         
     | 
| 
       29 
     | 
    
         
            -
                  before { allow(AbrilHeartbeat::RedisWrapper).to receive(: 
     | 
| 
      
 29 
     | 
    
         
            +
                  before { allow(AbrilHeartbeat::RedisWrapper).to receive(:client?) { "constant" } }
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 31 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
33 
     | 
    
         
             
                  it { is_expected.to be_truthy }
         
     | 
| 
       34 
34 
     | 
    
         
             
                end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
       36 
36 
     | 
    
         
             
                context "when the app does not have a redis client" do
         
     | 
| 
       37 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 37 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  it { is_expected.to be_falsy }
         
     | 
| 
       40 
40 
     | 
    
         
             
                end
         
     | 
| 
         @@ -17,9 +17,9 @@ describe AbrilHeartbeat::RestChecker do 
     | 
|
| 
       17 
17 
     | 
    
         
             
                let(:response) {{ "MODEL" => [{"api_success"=>{"url"=>"http://www.scudelletti.com", "status"=>"OK", "status_message"=>"Everything is OK"}}, {"api_not_found"=>{"url"=>"http://www.scudelletti.com/not_found", "status"=>"OK", "status_message"=>"Everything is OK"}}, {"api_wrong_url"=>{"url"=>"I am a wrong url", "status"=>"OK", "status_message"=>"Everything is OK"}}] }}
         
     | 
| 
       18 
18 
     | 
    
         
             
              end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
              describe "# 
     | 
| 
      
 20 
     | 
    
         
            +
              describe "#running?" do
         
     | 
| 
       21 
21 
     | 
    
         
             
                context "when there is rest calls" do
         
     | 
| 
       22 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 22 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
                  it { is_expected.to be_truthy }
         
     | 
| 
       25 
25 
     | 
    
         
             
                end
         
     | 
| 
         @@ -27,7 +27,7 @@ describe AbrilHeartbeat::RestChecker do 
     | 
|
| 
       27 
27 
     | 
    
         
             
                context "when there is not rest calls" do
         
     | 
| 
       28 
28 
     | 
    
         
             
                  before { allow(AbrilHeartbeat::ConfigLoader).to receive(:load) { {} } }
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                  subject { described_class. 
     | 
| 
      
 30 
     | 
    
         
            +
                  subject { described_class.running? }
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
                  it { is_expected.to be_falsy }
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
    
        data/spec/heartbeater_spec.rb
    CHANGED
    
    | 
         @@ -14,8 +14,8 @@ describe AbrilHeartbeat::Heartbeater do 
     | 
|
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                  context "when the app has more than one dependency" do
         
     | 
| 
       16 
16 
     | 
    
         
             
                    before do
         
     | 
| 
       17 
     | 
    
         
            -
                      allow(AbrilHeartbeat::RestChecker).to receive(: 
     | 
| 
       18 
     | 
    
         
            -
                      allow(AbrilHeartbeat::MongoChecker).to receive(: 
     | 
| 
      
 17 
     | 
    
         
            +
                      allow(AbrilHeartbeat::RestChecker).to receive(:running?) { true }
         
     | 
| 
      
 18 
     | 
    
         
            +
                      allow(AbrilHeartbeat::MongoChecker).to receive(:running?) { true }
         
     | 
| 
       19 
19 
     | 
    
         
             
                    end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                    it { is_expected.to eql([{"REST" => "MOCK"}, {"MONGO" => "MOCK"}]) }
         
     | 
| 
         @@ -23,8 +23,8 @@ describe AbrilHeartbeat::Heartbeater do 
     | 
|
| 
       23 
23 
     | 
    
         | 
| 
       24 
24 
     | 
    
         
             
                  context "when the app just have on kind of dependency" do
         
     | 
| 
       25 
25 
     | 
    
         
             
                    before do
         
     | 
| 
       26 
     | 
    
         
            -
                      allow(AbrilHeartbeat::RestChecker).to receive(: 
     | 
| 
       27 
     | 
    
         
            -
                      allow(AbrilHeartbeat::MongoChecker).to receive(: 
     | 
| 
      
 26 
     | 
    
         
            +
                      allow(AbrilHeartbeat::RestChecker).to receive(:running?) { false }
         
     | 
| 
      
 27 
     | 
    
         
            +
                      allow(AbrilHeartbeat::MongoChecker).to receive(:running?) { true }
         
     | 
| 
       28 
28 
     | 
    
         
             
                    end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
30 
     | 
    
         
             
                    it { is_expected.to eql([{"MONGO" => "MOCK"}]) }
         
     | 
| 
         @@ -32,18 +32,18 @@ describe AbrilHeartbeat::Heartbeater do 
     | 
|
| 
       32 
32 
     | 
    
         
             
                end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                describe "Custom checkers" do
         
     | 
| 
       35 
     | 
    
         
            -
                  let(:custom_checker) { double("CustomChecker",  
     | 
| 
      
 35 
     | 
    
         
            +
                  let(:custom_checker) { double("CustomChecker", running?: true) }
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                  subject { described_class.new({file_path: file_path, custom_checkers: [custom_checker]}) }
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                  before do
         
     | 
| 
       40 
     | 
    
         
            -
                    allow(AbrilHeartbeat::RestChecker).to receive(: 
     | 
| 
       41 
     | 
    
         
            -
                    allow(AbrilHeartbeat::MongoChecker).to receive(: 
     | 
| 
       42 
     | 
    
         
            -
                    allow(AbrilHeartbeat::MysqlChecker).to receive(: 
     | 
| 
      
 40 
     | 
    
         
            +
                    allow(AbrilHeartbeat::RestChecker).to receive(:running?) { false }
         
     | 
| 
      
 41 
     | 
    
         
            +
                    allow(AbrilHeartbeat::MongoChecker).to receive(:running?) { false }
         
     | 
| 
      
 42 
     | 
    
         
            +
                    allow(AbrilHeartbeat::MysqlChecker).to receive(:running?) { false }
         
     | 
| 
       43 
43 
     | 
    
         
             
                  end
         
     | 
| 
       44 
44 
     | 
    
         | 
| 
       45 
45 
     | 
    
         
             
                  it "returns the status codes" do
         
     | 
| 
       46 
     | 
    
         
            -
                    expect(custom_checker).to receive(: 
     | 
| 
      
 46 
     | 
    
         
            +
                    expect(custom_checker).to receive(:running?)
         
     | 
| 
       47 
47 
     | 
    
         
             
                    expect(custom_checker).to receive(:run!)
         
     | 
| 
       48 
48 
     | 
    
         | 
| 
       49 
49 
     | 
    
         
             
                    subject.run!
         
     | 
| 
         @@ -3,7 +3,7 @@ RSpec.shared_examples "a checker" do 
     | 
|
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
              subject{ described_class }
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
     | 
    
         
            -
              it { is_expected.to respond_to(: 
     | 
| 
      
 6 
     | 
    
         
            +
              it { is_expected.to respond_to(:running?) }
         
     | 
| 
       7 
7 
     | 
    
         
             
              it { is_expected.to respond_to(:module_name) }
         
     | 
| 
       8 
8 
     | 
    
         
             
              it { is_expected.to respond_to(:run!) }
         
     | 
| 
       9 
9 
     | 
    
         
             
              it { is_expected.to respond_to(:check!) }
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: abril_heartbeat
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Diogo Scudelletti
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-09- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-09-30 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rack
         
     | 
| 
         @@ -180,7 +180,6 @@ files: 
     | 
|
| 
       180 
180 
     | 
    
         
             
            - lib/abril_heartbeat/wrappers/mysql_wrapper.rb
         
     | 
| 
       181 
181 
     | 
    
         
             
            - lib/abril_heartbeat/wrappers/redis_wrapper.rb
         
     | 
| 
       182 
182 
     | 
    
         
             
            - spec/cassettes/AbrilHeartbeat_Middleware/when_middleware_handles_the_request/responds_success.yml
         
     | 
| 
       183 
     | 
    
         
            -
            - spec/cassettes/HeartbeatAbril_Middleware/when_middleware_handles_the_request/responds_success.yml
         
     | 
| 
       184 
183 
     | 
    
         
             
            - spec/checkers/abstract_checker_spec.rb
         
     | 
| 
       185 
184 
     | 
    
         
             
            - spec/checkers/mongo_checker_spec.rb
         
     | 
| 
       186 
185 
     | 
    
         
             
            - spec/checkers/mysql_checker_spec.rb
         
     | 
| 
         @@ -219,7 +218,6 @@ specification_version: 4 
     | 
|
| 
       219 
218 
     | 
    
         
             
            summary: Builds a heartbeat route for Apps
         
     | 
| 
       220 
219 
     | 
    
         
             
            test_files:
         
     | 
| 
       221 
220 
     | 
    
         
             
            - spec/cassettes/AbrilHeartbeat_Middleware/when_middleware_handles_the_request/responds_success.yml
         
     | 
| 
       222 
     | 
    
         
            -
            - spec/cassettes/HeartbeatAbril_Middleware/when_middleware_handles_the_request/responds_success.yml
         
     | 
| 
       223 
221 
     | 
    
         
             
            - spec/checkers/abstract_checker_spec.rb
         
     | 
| 
       224 
222 
     | 
    
         
             
            - spec/checkers/mongo_checker_spec.rb
         
     | 
| 
       225 
223 
     | 
    
         
             
            - spec/checkers/mysql_checker_spec.rb
         
     | 
| 
         @@ -1,111 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ---
         
     | 
| 
       2 
     | 
    
         
            -
            http_interactions:
         
     | 
| 
       3 
     | 
    
         
            -
            - request:
         
     | 
| 
       4 
     | 
    
         
            -
                method: get
         
     | 
| 
       5 
     | 
    
         
            -
                uri: http://www.scudelletti.com/
         
     | 
| 
       6 
     | 
    
         
            -
                body:
         
     | 
| 
       7 
     | 
    
         
            -
                  encoding: US-ASCII
         
     | 
| 
       8 
     | 
    
         
            -
                  string: ''
         
     | 
| 
       9 
     | 
    
         
            -
                headers:
         
     | 
| 
       10 
     | 
    
         
            -
                  Accept:
         
     | 
| 
       11 
     | 
    
         
            -
                  - "*/*; q=0.5, application/xml"
         
     | 
| 
       12 
     | 
    
         
            -
                  Accept-Encoding:
         
     | 
| 
       13 
     | 
    
         
            -
                  - gzip, deflate
         
     | 
| 
       14 
     | 
    
         
            -
                  User-Agent:
         
     | 
| 
       15 
     | 
    
         
            -
                  - Ruby
         
     | 
| 
       16 
     | 
    
         
            -
              response:
         
     | 
| 
       17 
     | 
    
         
            -
                status:
         
     | 
| 
       18 
     | 
    
         
            -
                  code: 200
         
     | 
| 
       19 
     | 
    
         
            -
                  message: OK
         
     | 
| 
       20 
     | 
    
         
            -
                headers:
         
     | 
| 
       21 
     | 
    
         
            -
                  Date:
         
     | 
| 
       22 
     | 
    
         
            -
                  - Fri, 26 Sep 2014 13:09:40 GMT
         
     | 
| 
       23 
     | 
    
         
            -
                  Server:
         
     | 
| 
       24 
     | 
    
         
            -
                  - Apache/2.2.15 (Red Hat)
         
     | 
| 
       25 
     | 
    
         
            -
                  Last-Modified:
         
     | 
| 
       26 
     | 
    
         
            -
                  - Mon, 14 Jul 2014 11:37:00 GMT
         
     | 
| 
       27 
     | 
    
         
            -
                  Etag:
         
     | 
| 
       28 
     | 
    
         
            -
                  - '"540027-942-4fe25b58cef00"'
         
     | 
| 
       29 
     | 
    
         
            -
                  Accept-Ranges:
         
     | 
| 
       30 
     | 
    
         
            -
                  - none
         
     | 
| 
       31 
     | 
    
         
            -
                  Content-Type:
         
     | 
| 
       32 
     | 
    
         
            -
                  - text/html
         
     | 
| 
       33 
     | 
    
         
            -
                  Vary:
         
     | 
| 
       34 
     | 
    
         
            -
                  - Accept-Encoding
         
     | 
| 
       35 
     | 
    
         
            -
                  Content-Encoding:
         
     | 
| 
       36 
     | 
    
         
            -
                  - gzip
         
     | 
| 
       37 
     | 
    
         
            -
                  Content-Length:
         
     | 
| 
       38 
     | 
    
         
            -
                  - '948'
         
     | 
| 
       39 
     | 
    
         
            -
                body:
         
     | 
| 
       40 
     | 
    
         
            -
                  encoding: ASCII-8BIT
         
     | 
| 
       41 
     | 
    
         
            -
                  string: !binary |-
         
     | 
| 
       42 
     | 
    
         
            -
                    H4sIAAAAAAAAA51W32/bNhB+319x0AsdxJacdGuHxEoRI10bYOuCOsMegqCg
         
     | 
| 
       43 
     | 
    
         
            -
                    qbPMhiI1krIqrPvfd5TkWG7aZcmTqfvF7+4+3nm29oU6+wFgtkaetQcvvcKz
         
     | 
| 
       44 
     | 
    
         
            -
                    C2lyAwtRZagUei9hAh+qZQMLs/I1twhvdC61RkuKP3EZ1FwqR78Lqbm3nE5X
         
     | 
| 
       45 
     | 
    
         
            -
                    PLNSm1nSxQzRC/QcNC8wjTJ0wsrSS6MjEEZ71D6NLlkBDy/nUNMdGW5QmRLt
         
     | 
| 
       46 
     | 
    
         
            -
                    GOq1gdrYOzAaLq/BSS0QjqfTl2O4BK5q3jjwtgFvIJNOmA0B5cqjJWxygy4o
         
     | 
| 
       47 
     | 
    
         
            -
                    Cn6HUDRdHJ5LhXGb47hLZbzNZAy/GZ2bi/l4m9GHeQRJm4+S+g7WFlcpW3tf
         
     | 
| 
       48 
     | 
    
         
            -
                    niTJijJxcW5MrpCX0sXCFIlw7vWKF1I16bnC3GLDDxdcu5Mfp9PxT9MpA4sq
         
     | 
| 
       49 
     | 
    
         
            -
                    Zc43Ct0a0TPwTYkp8/jZB28Wbtve98C2A9BK4mD8tXMHdg9uFOA6wluqagu3
         
     | 
| 
       50 
     | 
    
         
            -
                    hXrYVn9Q/Ki9LyqrpZJ0n426zJN7xixN1vTxM7kBobhzaRQ6yiURJOp0D7XU
         
     | 
| 
       51 
     | 
    
         
            -
                    73vdvrbgnydCWqFwYPBVgF49S0g4iNJ9fjOq1CtjC94Sbi/s+ugh3ym/o32j
         
     | 
| 
       52 
     | 
    
         
            -
                    47NvPAAMvPIw//3XC7jUPb+M5gq4zuCtrUoD50srFcU73oun+Wb4TRI+6Aw1
         
     | 
| 
       53 
     | 
    
         
            -
                    pq7rOPQLM6nbzkiduB3ABPezaEPIIgdnBeVa8Bxdcu9f6jwKDyCN5srk0ZYQ
         
     | 
| 
       54 
     | 
    
         
            -
                    u7LxQdEeoAk8yaVfV8sWyADF4xB6vx2At9K/q5bPgeBr6anELYbsSSC2njsU
         
     | 
| 
       55 
     | 
    
         
            -
                    153kOTBCY1Zc4NKYuxbL4ilQ7j13WH7pRc8B8/jzfbxDbYxBg9pocEXSpyLq
         
     | 
| 
       56 
     | 
    
         
            -
                    q0NASqnoBZjY2PxxBEvi5P+i6PBz7wHtv/vBUBgeu32zddpwCx9z/hek3c+X
         
     | 
| 
       57 
     | 
    
         
            -
                    L3Bze9orgyQuK7ce3bCPDv25EKbSno2B/XE+OT56+erFz69eTI7Y7cH3XC5M
         
     | 
| 
       58 
     | 
    
         
            -
                    QfPvPe264DWgayjPf/idK2Xqd9ytg9uKK4ffM6bdJO6uqIIbiXVr1FuNVpUW
         
     | 
| 
       59 
     | 
    
         
            -
                    YQ6NDuDvQbo5p2QzI6qCZm8sLHKPbxSGrxHrqsMOTsksDguEbLsV8olveK9t
         
     | 
| 
       60 
     | 
    
         
            -
                    ldw1WpDW2wq3wEhMHSXhiHXUZJAO7lJGtIMxLq3xRhgFr4FtOeycYnACbMcg
         
     | 
| 
       61 
     | 
    
         
            -
                    dgCHwHpeTzjN08ZL0e1SuumTY6eDtNwwqxx9n5KbN9c8Dw3YJXczvT0FIjsN
         
     | 
| 
       62 
     | 
    
         
            -
                    cO3fmwxjqR1aP0faDTjKadm7+2L/czBqz7Nkx5xZ0q07muftX6d/AeG2G0BC
         
     | 
| 
       63 
     | 
    
         
            -
                    CQAA
         
     | 
| 
       64 
     | 
    
         
            -
                http_version: 
         
     | 
| 
       65 
     | 
    
         
            -
              recorded_at: Fri, 26 Sep 2014 13:09:41 GMT
         
     | 
| 
       66 
     | 
    
         
            -
            - request:
         
     | 
| 
       67 
     | 
    
         
            -
                method: get
         
     | 
| 
       68 
     | 
    
         
            -
                uri: http://www.scudelletti.com/not_found
         
     | 
| 
       69 
     | 
    
         
            -
                body:
         
     | 
| 
       70 
     | 
    
         
            -
                  encoding: US-ASCII
         
     | 
| 
       71 
     | 
    
         
            -
                  string: ''
         
     | 
| 
       72 
     | 
    
         
            -
                headers:
         
     | 
| 
       73 
     | 
    
         
            -
                  Accept:
         
     | 
| 
       74 
     | 
    
         
            -
                  - "*/*; q=0.5, application/xml"
         
     | 
| 
       75 
     | 
    
         
            -
                  Accept-Encoding:
         
     | 
| 
       76 
     | 
    
         
            -
                  - gzip, deflate
         
     | 
| 
       77 
     | 
    
         
            -
                  User-Agent:
         
     | 
| 
       78 
     | 
    
         
            -
                  - Ruby
         
     | 
| 
       79 
     | 
    
         
            -
              response:
         
     | 
| 
       80 
     | 
    
         
            -
                status:
         
     | 
| 
       81 
     | 
    
         
            -
                  code: 404
         
     | 
| 
       82 
     | 
    
         
            -
                  message: ''
         
     | 
| 
       83 
     | 
    
         
            -
                headers:
         
     | 
| 
       84 
     | 
    
         
            -
                  Date:
         
     | 
| 
       85 
     | 
    
         
            -
                  - Fri, 26 Sep 2014 13:09:41 GMT
         
     | 
| 
       86 
     | 
    
         
            -
                  Server:
         
     | 
| 
       87 
     | 
    
         
            -
                  - Apache/2.2.15 (Red Hat)
         
     | 
| 
       88 
     | 
    
         
            -
                  X-Powered-By:
         
     | 
| 
       89 
     | 
    
         
            -
                  - Phusion Passenger (mod_rails/mod_rack) 3.0.21
         
     | 
| 
       90 
     | 
    
         
            -
                  X-Cascade:
         
     | 
| 
       91 
     | 
    
         
            -
                  - pass
         
     | 
| 
       92 
     | 
    
         
            -
                  X-Xss-Protection:
         
     | 
| 
       93 
     | 
    
         
            -
                  - 1; mode=block
         
     | 
| 
       94 
     | 
    
         
            -
                  X-Content-Type-Options:
         
     | 
| 
       95 
     | 
    
         
            -
                  - nosniff
         
     | 
| 
       96 
     | 
    
         
            -
                  X-Frame-Options:
         
     | 
| 
       97 
     | 
    
         
            -
                  - SAMEORIGIN
         
     | 
| 
       98 
     | 
    
         
            -
                  Content-Length:
         
     | 
| 
       99 
     | 
    
         
            -
                  - '18'
         
     | 
| 
       100 
     | 
    
         
            -
                  Status:
         
     | 
| 
       101 
     | 
    
         
            -
                  - '404'
         
     | 
| 
       102 
     | 
    
         
            -
                  Content-Type:
         
     | 
| 
       103 
     | 
    
         
            -
                  - text/html;charset=utf-8
         
     | 
| 
       104 
     | 
    
         
            -
                  Accept-Ranges:
         
     | 
| 
       105 
     | 
    
         
            -
                  - none
         
     | 
| 
       106 
     | 
    
         
            -
                body:
         
     | 
| 
       107 
     | 
    
         
            -
                  encoding: UTF-8
         
     | 
| 
       108 
     | 
    
         
            -
                  string: "<h1>Not Found</h1>"
         
     | 
| 
       109 
     | 
    
         
            -
                http_version: 
         
     | 
| 
       110 
     | 
    
         
            -
              recorded_at: Fri, 26 Sep 2014 13:09:41 GMT
         
     | 
| 
       111 
     | 
    
         
            -
            recorded_with: VCR 2.9.3
         
     |