Sha256: d9f32c40a9a734bf4213a5bfd70628c685598a802a905072e71db583e4fc6d4e

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

require 'voight_kampff/test'
require 'voight_kampff/user_agents_parser'
require 'voight_kampff/engine' if defined?(Rails)

module VoightKampff

  class << self

    def root
      require 'pathname'
      Pathname.new File.expand_path '..', File.dirname(__FILE__)
    end

    def human?(user_agent_string)
      test(user_agent_string).human?
    end
    
    def bot?(user_agent_string)
      test(user_agent_string).bot?
    end
    alias :replicant? :bot?

    def browser?(user_agent_string)
      test(user_agent_string).browser?
    end

    def checker?(user_agent_string)
      test(user_agent_string).checker?
    end
    
    def downloader?(user_agent_string)
      test(user_agent_string).downloader?
    end
    
    def proxy?(user_agent_string)
      test(user_agent_string).proxy?
    end

    def crawler?(user_agent_string)
      test(user_agent_string).crawler?
    end

    def spam?(user_agent_string)
      test(user_agent_string).spam?
    end

    private
    
    def test(user_agent_string)
      VoightKampff::Test.new(user_agent_string)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
voight_kampff-0.1.4 lib/voight_kampff.rb
voight_kampff-0.1.3 lib/voight_kampff.rb
voight_kampff-0.1.2 lib/voight_kampff.rb
voight_kampff-0.1.1 lib/voight_kampff.rb