sbsm 1.4.8 → 1.4.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71c3990f77f5cba4cd28fd528d59a80b82909935
4
- data.tar.gz: 45944e3cd0c393bec1d04fe20a6bd2f9439c8f91
3
+ metadata.gz: 6aee853a34b97d3ab2ff7b4001c7e652d1e01c49
4
+ data.tar.gz: 0b2c1aa161689b95b35c60a01e09274df57c9533
5
5
  SHA512:
6
- metadata.gz: c08586c857d44c1c4e4d9ccf887df09ce5e663f1963f4a37bade46d9a374e921881a828c8e4c1aaa1f4d5382f92f36b83e621c7d94086169ca9cf0d08fa0fbe9
7
- data.tar.gz: c784b2b282e004eaf943ddc64b87e9ab3eb6cc758fcee32decbd0e9340f99194927375407d0dee3fd46abfbaf52ffed1c7c05841a052e3b0194f09b6909beff0
6
+ metadata.gz: '097042df4c5dc65aae06155a75b52def17a5135d8b426ce0ebea531da3a5dcbbb510a01d3bc48ddc1f2d31c229d01394d7329753f71f9f30454ce4162b5763f7'
7
+ data.tar.gz: cea64d66ef58aaefcf3e6246286f61260052f8bc258100896259a2db7c00aeac6a259c0ef006257982d23b037e674499324f7761d13eb0f775843ac5c781561d
@@ -17,9 +17,11 @@ bundler_args: --without debugger
17
17
  rvm:
18
18
  - ruby-head
19
19
  - 2.2.3
20
+ - 2.4.0
20
21
  - 2.3.0
21
22
  matrix:
22
23
  allow_failures:
23
24
  # On november 1 had failure compiling the child_processes
24
25
  - rvm: ruby-head
25
- - rvm: 2.2.3
26
+ - rvm: 2.2.3 # Test for LogLevel does not work
27
+ - rvm: 2.3.0 # Test for LogLevel does not work
@@ -1,3 +1,7 @@
1
+ === 1.4.9 / 28.06.2017
2
+
3
+ * Fix is_crawler?
4
+
1
5
  === 1.4.8 / 26.06.2017
2
6
 
3
7
  * Fix setting mime_type for files like status/status_crawler
@@ -387,11 +387,10 @@ module SBSM
387
387
  def info?
388
388
  @state.info? if @state.respond_to?(:info?)
389
389
  end
390
- def is_crawler?
391
- @is_crawler ||= if @request.respond_to?(:is_crawler?)
392
- @request.is_crawler?
393
- end
394
- end
390
+ def is_crawler?
391
+ crawler_pattern = /archiver|slurp|bot|crawler|jeeves|spider|\.{6}/i
392
+ !!crawler_pattern.match(@rack_request.user_agent)
393
+ end
395
394
  def language
396
395
  cookie_set_or_get(:language) || default_language
397
396
  end
@@ -1,3 +1,3 @@
1
1
  module SBSM
2
- VERSION = '1.4.8'
2
+ VERSION = '1.4.9'
3
3
  end
@@ -70,6 +70,7 @@ class StubSessionValidator < SBSM::Validator
70
70
  end
71
71
  end
72
72
  class StubSessionRequest < Rack::Request
73
+ attr_accessor :user_agent
73
74
  def initialize(path='', params = {})
74
75
  super(Rack::MockRequest.env_for("http://example.com:8080/#{path}", params))
75
76
  end
@@ -429,4 +430,9 @@ class TestSession < Minitest::Test
429
430
  }
430
431
  assert_equal('gcc', session.flavor)
431
432
  end
433
+ def test_is_crawler
434
+ @request.user_agent = 'google crawler'
435
+ @session.process_rack(rack_request: @request)
436
+ assert_equal(true, @session.is_crawler?)
437
+ end
432
438
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbsm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.8
4
+ version: 1.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz