rails_health_check 3.0.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 +7 -0
- data/.document +5 -0
- data/.gitignore +49 -0
- data/.travis.yml +50 -0
- data/CHANGELOG +64 -0
- data/Gemfile +20 -0
- data/MIT-LICENSE +22 -0
- data/README.rdoc +337 -0
- data/Rakefile +29 -0
- data/Vagrantfile +20 -0
- data/config/routes.rb +5 -0
- data/health_check.gemspec +32 -0
- data/init.rb +2 -0
- data/lib/health_check/base_health_check.rb +5 -0
- data/lib/health_check/health_check_controller.rb +75 -0
- data/lib/health_check/health_check_routes.rb +15 -0
- data/lib/health_check/middleware_health_check.rb +102 -0
- data/lib/health_check/redis_health_check.rb +23 -0
- data/lib/health_check/resque_health_check.rb +15 -0
- data/lib/health_check/s3_health_check.rb +65 -0
- data/lib/health_check/sidekiq_health_check.rb +17 -0
- data/lib/health_check/utils.rb +171 -0
- data/lib/health_check/version.rb +3 -0
- data/lib/health_check.rb +101 -0
- data/test/fake_smtp_server +38 -0
- data/test/init_variables +61 -0
- data/test/migrate/empty/do_not_remove.txt +1 -0
- data/test/migrate/nine/9_create_countries.rb +11 -0
- data/test/migrate/twelve/011_create_roles.roles.rb +11 -0
- data/test/migrate/twelve/012_create_users.rb +11 -0
- data/test/migrate/twelve/9_create_countries.rb +11 -0
- data/test/provision_vagrant +61 -0
- data/test/rails_5.1.gemfile +26 -0
- data/test/rails_edge.gemfile +32 -0
- data/test/setup_railsapp +440 -0
- data/test/test_with_railsapp +679 -0
- data/test/testurl +65 -0
- metadata +180 -0
    
        data/test/testurl
    ADDED
    
    | @@ -0,0 +1,65 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            require 'net/http'
         | 
| 3 | 
            +
            require 'uri'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            def open(url)
         | 
| 6 | 
            +
              parsed_uri = URI.parse(url)
         | 
| 7 | 
            +
              http = Net::HTTP.new(parsed_uri.host, parsed_uri.port)
         | 
| 8 | 
            +
              req = Net::HTTP::Get.new(parsed_uri.request_uri)
         | 
| 9 | 
            +
              req.basic_auth(ENV['AUTH_USER'], ENV['AUTH_PASSWORD'].to_s) if ENV['AUTH_USER']
         | 
| 10 | 
            +
              http.request(req)
         | 
| 11 | 
            +
            end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            response = open(ARGV[0]) rescue nil
         | 
| 14 | 
            +
            unless response
         | 
| 15 | 
            +
              i=0
         | 
| 16 | 
            +
              print "waiting.."
         | 
| 17 | 
            +
              while i < 120 and not response
         | 
| 18 | 
            +
                #puts 'RESPONSE:', response.inspect
         | 
| 19 | 
            +
                print "."
         | 
| 20 | 
            +
                STDOUT.flush
         | 
| 21 | 
            +
                i += 1
         | 
| 22 | 
            +
                sleep(1)
         | 
| 23 | 
            +
                response = open(ARGV[0]) rescue nil
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
              unless response
         | 
| 26 | 
            +
                puts "\nFAIL: timed out after waiting #{i} seconds"
         | 
| 27 | 
            +
                exit 9
         | 
| 28 | 
            +
              end
         | 
| 29 | 
            +
              puts "\n  got url content after waiting #{i} seconds"
         | 
| 30 | 
            +
            end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            page_content = response.body
         | 
| 33 | 
            +
             | 
| 34 | 
            +
            puts "  response code: #{response.code} #{response.message}"
         | 
| 35 | 
            +
            response.header.each_header {|key,value| puts "  #{key}: #{value}" }
         | 
| 36 | 
            +
            puts "  body: #{page_content}"
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            if ARGV[1] and ARGV[1] != ''
         | 
| 39 | 
            +
              if ARGV[1].split(',').include?(response.code)
         | 
| 40 | 
            +
                puts "PASS (response code was #{response.code} which matched #{ARGV[1]})"
         | 
| 41 | 
            +
              else
         | 
| 42 | 
            +
                puts "FAIL (response code was #{response.code}, expected #{ARGV[1]})" 
         | 
| 43 | 
            +
                exit 1
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
            end
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            if ARGV[2] and ARGV[2] != ''
         | 
| 48 | 
            +
              if response.content_type == ARGV[2]
         | 
| 49 | 
            +
                puts "PASS (content type was #{response.content_type})"
         | 
| 50 | 
            +
              else
         | 
| 51 | 
            +
                puts "FAIL (content type was #{response.content_type}, expected #{ARGV[2]})" 
         | 
| 52 | 
            +
                exit 2
         | 
| 53 | 
            +
              end
         | 
| 54 | 
            +
            end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            if ARGV[3] and ARGV[3] != ''
         | 
| 57 | 
            +
              if page_content.to_s.include? ARGV[3]
         | 
| 58 | 
            +
                puts "PASS (found #{ARGV[3]})"
         | 
| 59 | 
            +
              else
         | 
| 60 | 
            +
                puts "FAIL (expected to find #{ARGV[3]}) - page contents:" , page_content.to_s, 'END-OF-CONTENTS'
         | 
| 61 | 
            +
                exit 3
         | 
| 62 | 
            +
              end
         | 
| 63 | 
            +
            end
         | 
| 64 | 
            +
             | 
| 65 | 
            +
            exit 0
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,180 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: rails_health_check
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 3.0.0
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - Ian Heggie
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2019-03-06 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: rails
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - ">="
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '4.0'
         | 
| 20 | 
            +
              type: :runtime
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - ">="
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '4.0'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: bundler
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - ">="
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '0'
         | 
| 34 | 
            +
              type: :development
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - ">="
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: rake
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - ">="
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: 0.8.3
         | 
| 48 | 
            +
              type: :development
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - ">="
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: 0.8.3
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: shoulda
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: 2.11.0
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: 2.11.0
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: smarter_bundler
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - ">="
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: 0.1.0
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - ">="
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: 0.1.0
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: sqlite3
         | 
| 85 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - ">="
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: '0'
         | 
| 90 | 
            +
              type: :development
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            +
                requirements:
         | 
| 94 | 
            +
                - - ">="
         | 
| 95 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            +
                    version: '0'
         | 
| 97 | 
            +
            description: "  \tFork of https://github.com/ianheggie/health_check.\n    Simple health
         | 
| 98 | 
            +
              check of Rails app for uptime monitoring with Pingdom, NewRelic, EngineYard or uptime.openacs.org
         | 
| 99 | 
            +
              etc.\n"
         | 
| 100 | 
            +
            email:
         | 
| 101 | 
            +
            - ian@heggie.biz
         | 
| 102 | 
            +
            executables: []
         | 
| 103 | 
            +
            extensions: []
         | 
| 104 | 
            +
            extra_rdoc_files:
         | 
| 105 | 
            +
            - README.rdoc
         | 
| 106 | 
            +
            files:
         | 
| 107 | 
            +
            - ".document"
         | 
| 108 | 
            +
            - ".gitignore"
         | 
| 109 | 
            +
            - ".travis.yml"
         | 
| 110 | 
            +
            - CHANGELOG
         | 
| 111 | 
            +
            - Gemfile
         | 
| 112 | 
            +
            - MIT-LICENSE
         | 
| 113 | 
            +
            - README.rdoc
         | 
| 114 | 
            +
            - Rakefile
         | 
| 115 | 
            +
            - Vagrantfile
         | 
| 116 | 
            +
            - config/routes.rb
         | 
| 117 | 
            +
            - health_check.gemspec
         | 
| 118 | 
            +
            - init.rb
         | 
| 119 | 
            +
            - lib/health_check.rb
         | 
| 120 | 
            +
            - lib/health_check/base_health_check.rb
         | 
| 121 | 
            +
            - lib/health_check/health_check_controller.rb
         | 
| 122 | 
            +
            - lib/health_check/health_check_routes.rb
         | 
| 123 | 
            +
            - lib/health_check/middleware_health_check.rb
         | 
| 124 | 
            +
            - lib/health_check/redis_health_check.rb
         | 
| 125 | 
            +
            - lib/health_check/resque_health_check.rb
         | 
| 126 | 
            +
            - lib/health_check/s3_health_check.rb
         | 
| 127 | 
            +
            - lib/health_check/sidekiq_health_check.rb
         | 
| 128 | 
            +
            - lib/health_check/utils.rb
         | 
| 129 | 
            +
            - lib/health_check/version.rb
         | 
| 130 | 
            +
            - test/fake_smtp_server
         | 
| 131 | 
            +
            - test/init_variables
         | 
| 132 | 
            +
            - test/migrate/empty/do_not_remove.txt
         | 
| 133 | 
            +
            - test/migrate/nine/9_create_countries.rb
         | 
| 134 | 
            +
            - test/migrate/twelve/011_create_roles.roles.rb
         | 
| 135 | 
            +
            - test/migrate/twelve/012_create_users.rb
         | 
| 136 | 
            +
            - test/migrate/twelve/9_create_countries.rb
         | 
| 137 | 
            +
            - test/provision_vagrant
         | 
| 138 | 
            +
            - test/rails_5.1.gemfile
         | 
| 139 | 
            +
            - test/rails_edge.gemfile
         | 
| 140 | 
            +
            - test/setup_railsapp
         | 
| 141 | 
            +
            - test/test_with_railsapp
         | 
| 142 | 
            +
            - test/testurl
         | 
| 143 | 
            +
            homepage: https://github.com/FinalCAD/health_check
         | 
| 144 | 
            +
            licenses: []
         | 
| 145 | 
            +
            metadata: {}
         | 
| 146 | 
            +
            post_install_message: 
         | 
| 147 | 
            +
            rdoc_options: []
         | 
| 148 | 
            +
            require_paths:
         | 
| 149 | 
            +
            - lib
         | 
| 150 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 151 | 
            +
              requirements:
         | 
| 152 | 
            +
              - - ">="
         | 
| 153 | 
            +
                - !ruby/object:Gem::Version
         | 
| 154 | 
            +
                  version: 2.2.2
         | 
| 155 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 156 | 
            +
              requirements:
         | 
| 157 | 
            +
              - - ">="
         | 
| 158 | 
            +
                - !ruby/object:Gem::Version
         | 
| 159 | 
            +
                  version: '0'
         | 
| 160 | 
            +
            requirements: []
         | 
| 161 | 
            +
            rubyforge_project: 
         | 
| 162 | 
            +
            rubygems_version: 2.7.6
         | 
| 163 | 
            +
            signing_key: 
         | 
| 164 | 
            +
            specification_version: 4
         | 
| 165 | 
            +
            summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic,
         | 
| 166 | 
            +
              EngineYard or uptime.openacs.org etc.
         | 
| 167 | 
            +
            test_files:
         | 
| 168 | 
            +
            - test/fake_smtp_server
         | 
| 169 | 
            +
            - test/init_variables
         | 
| 170 | 
            +
            - test/migrate/empty/do_not_remove.txt
         | 
| 171 | 
            +
            - test/migrate/nine/9_create_countries.rb
         | 
| 172 | 
            +
            - test/migrate/twelve/011_create_roles.roles.rb
         | 
| 173 | 
            +
            - test/migrate/twelve/012_create_users.rb
         | 
| 174 | 
            +
            - test/migrate/twelve/9_create_countries.rb
         | 
| 175 | 
            +
            - test/provision_vagrant
         | 
| 176 | 
            +
            - test/rails_5.1.gemfile
         | 
| 177 | 
            +
            - test/rails_edge.gemfile
         | 
| 178 | 
            +
            - test/setup_railsapp
         | 
| 179 | 
            +
            - test/test_with_railsapp
         | 
| 180 | 
            +
            - test/testurl
         |