morizyun/http_status_checker

View on GitHub
bin/http_status_checker

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby
#coding: utf-8

require 'thor'
require 'http_status_checker'

class Command < Thor
  default_command :http_status_checker

  desc 'http_status_checker', 'Checking whether can access url'
  option :url, :type => :string, :aliases => :'-u', :desc => 'url for checking'
  def http_status_checker
    results = HttpStatusChecker.check(options[:url])
    results.each do |result|
      result.each do |url, res|
        puts "url: #{url}"
        puts "response: #{res}"
      end
    end
  end
end

Command.start