Rename project-honeypot to project_honeypot
parent
6571e9bef5
commit
c0f8f6d054
|
@ -1,29 +1 @@
|
|||
require 'net/dns'
|
||||
require "project_honeypot/url"
|
||||
require "project_honeypot/base"
|
||||
require "project_honeypot/rack/header"
|
||||
require "project_honeypot/rack/forbidden"
|
||||
|
||||
module ProjectHoneypot
|
||||
class << self
|
||||
attr_accessor :api_key, :score, :last_activity
|
||||
|
||||
def api_key
|
||||
raise "ProjectHoneypot really needs its api_key set to work" unless @api_key
|
||||
@api_key
|
||||
end
|
||||
|
||||
def configure(&block)
|
||||
class_eval(&block)
|
||||
end
|
||||
end
|
||||
|
||||
def self.lookup(api_key_or_url, url=nil)
|
||||
if url.nil?
|
||||
url = api_key_or_url
|
||||
api_key_or_url = ProjectHoneypot.api_key
|
||||
end
|
||||
searcher = Base.new(api_key_or_url)
|
||||
searcher.lookup(url)
|
||||
end
|
||||
end
|
||||
require "project_honeypot"
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
require 'net/dns'
|
||||
require "project_honeypot/url"
|
||||
require "project_honeypot/base"
|
||||
require "project_honeypot/rack/header"
|
||||
require "project_honeypot/rack/forbidden"
|
||||
|
||||
module ProjectHoneypot
|
||||
class << self
|
||||
attr_accessor :api_key, :score, :last_activity
|
||||
|
||||
def api_key
|
||||
raise "ProjectHoneypot really needs its api_key set to work" unless @api_key
|
||||
@api_key
|
||||
end
|
||||
|
||||
def configure(&block)
|
||||
class_eval(&block)
|
||||
end
|
||||
end
|
||||
|
||||
def self.lookup(api_key_or_url, url=nil)
|
||||
if url.nil?
|
||||
url = api_key_or_url
|
||||
api_key_or_url = ProjectHoneypot.api_key
|
||||
end
|
||||
searcher = Base.new(api_key_or_url)
|
||||
searcher.lookup(url)
|
||||
end
|
||||
end
|
|
@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|||
require 'project_honeypot/version'
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = %q{project-honeypot}
|
||||
s.name = %q{project_honeypot}
|
||||
s.version = ProjectHoneypot::VERSION
|
||||
s.authors = ["Charles Max Wood", "Guillaume DOTT"]
|
||||
s.email = ["chuck@teachmetocode.com", "guillaume+github@dott.fr"]
|
Loading…
Reference in New Issue