This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STATUSES.each_pair do |code, message| | |
klass = Class.new(Exception) do | |
send(:define_method, :message) {"#{code ? "#{code} " : ''}#{message}"} | |
end | |
klass_constant = const_set message.delete(' \-\''), klass | |
Exceptions::EXCEPTIONS_MAP[code] = klass_constant | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise Blanket::Exceptions::EXCEPTIONS_MAP[500].new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise Blanket::InternalServerError.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates a new exception | |
# @param [HTTParty::Response] response the HTTP Response | |
# @return [Blanket::Exception] The Blanket Exception object | |
def initialize(response = nil) | |
#... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @macro [attach] REST action | |
# @method $1() | |
# Performs a $1 request on the wrapped URL | |
# @param [String, Symbol, Numeric] id The resource identifier to attach to the last part of the request | |
# @param [Hash] options An options hash with values for :headers, :extension and :params | |
# @return [Blanket::Response, Array] A wrapped Blanket::Response or an Array | |
def add_action(action) | |
#... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Interface checker | |
# Checks to see whether interface has an IP address, if it doesn't assume it's down and start hostapd | |
# Author : SirLagz | |
# | |
Interface='wlan0' | |
HostAPDIP='10.0.0.1' | |
echo "-----------------------------------" | |
echo "Checking connectivity of $Interface" |
OlderNewer