isbot 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6dce122546bc6c2b1db39b6aad3efc3050a8296
4
- data.tar.gz: 57bae46cea189c699d4b49b25bc5945a77a753df
3
+ metadata.gz: 379d67b37eaedcd41284a4f047a4982c4c914e30
4
+ data.tar.gz: fc33bf369f402c899bf1ed5c1dbea4dd8667fde4
5
5
  SHA512:
6
- metadata.gz: 42f6b6810f5b52494ea6c108a20e1414dc454cd433d1a06e9b24cfe1a6d188d093724d1f0593becf2c85a771b028775f3e60a28516e65d55f94ff0432f0716f4
7
- data.tar.gz: cfd588c79b8275c88b49f14f593e56bd0ac42b11d76b89e48c4676544655d25843a71fcba21bb8a4ff758d59717f5cdb0a7f3bb28e004bb2df4b1ad8073c4328
6
+ metadata.gz: 9806ad2d0580d92842701eff286137ad5ca3e16d1dacef4ead90b2ca095b92dd7dc5d6db7c87bdd646365be306a96206181d7c2833c7824e41d977788bcda4fa
7
+ data.tar.gz: 743aecd910ee3a6b66d8454cff8854d59f5ea287c579c852295c81ceee71b2fdb8716f3403aaf18281cc532a02fc336499617c6065a9a663f201215a16b530b9
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # isbot
2
2
 
3
- #### Install
4
-
3
+ #### Gem
5
4
 
5
+ https://rubygems.org/gems/isbot
6
6
 
7
7
  #### Usage
8
8
 
@@ -23,4 +23,7 @@ puts user_agent.is_bot? # true
23
23
  is_bot user_agent do |match_bot|
24
24
  puts match_bot # Googlebot/
25
25
  end
26
- ````
26
+ ````
27
+ #### Attached:
28
+
29
+ The crawler user-agent data from https://github.com/monperrus/crawler-user-agents, thanks! 😀
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'isbot'
4
+
5
+ ARGV.each do |arg|
6
+ puts "#{arg}\t#{is_bot arg.dup.to_s}"
7
+ end
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  wget https://raw.githubusercontent.com/monperrus/crawler-user-agents/master/crawler-user-agents.json \
4
- -O data.json
4
+ -O data/data.json
@@ -1,13 +1,14 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'isbot'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
+ s.executables << 'isbot'
4
5
  s.date = '2017-05-16'
5
6
  s.summary = 'detects bots/crawlers/spiders via the user agent.'
6
- s.description = 'A simple library for detecting bots/crawlers/spiders through user-agent strings.'
7
+ s.description = 'A simple library for detecting bots/crawlers/spiders through User-Agent strings.'
7
8
  s.authors = ['Hentioe']
8
9
  s.email = 'meow.i5.br@gmai.com'
9
10
  s.files = Dir['**/*']
10
11
  s.homepage =
11
12
  'https://github.com/Hentioe/isbot'
12
- s.license = 'MIT'
13
+ s.license = 'MIT'
13
14
  end
@@ -5,7 +5,7 @@ class IsBotTest < Test::Unit::TestCase
5
5
  $list = [
6
6
  'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
7
7
  'Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)',
8
- 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)'
8
+ 'Mozilla/5.0 (compatible; Baiduspid1er/2.0; +http://www.baidu.com/search/spider.html)'
9
9
  ]
10
10
 
11
11
  def test_is_bot
@@ -15,7 +15,7 @@ class IsBotTest < Test::Unit::TestCase
15
15
  def test_is_bot_with_block
16
16
  $list.each do |ua|
17
17
  is_bot ua do |match_bot|
18
- puts match_bot
18
+ puts match_bot.to_s
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hentioe
@@ -10,18 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-05-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A simple library for detecting bots/crawlers/spiders through user-agent
13
+ description: A simple library for detecting bots/crawlers/spiders through User-Agent
14
14
  strings.
15
15
  email: meow.i5.br@gmai.com
16
- executables: []
16
+ executables:
17
+ - isbot
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - README.md
22
+ - bin/isbot
21
23
  - data/data.json
24
+ - fetch.sh
22
25
  - isbot.gemspec
23
26
  - lib/Gemfile
24
- - lib/fetch.sh
25
27
  - lib/isbot.rb
26
28
  - lib/parser.rb
27
29
  - tests/isbot_test.rb