cobweb 1.0.17 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjMzY2NkZjAzZjUzMmExMTM1NTQzOTU4ZWY0OWI3Yzk4ODFiOGRmZQ==
4
+ MTg3ODFiMWE1MmZlYWFjYzZiZjIzZjQ1NmFjZmJmMWU1MDVjZTc5Mg==
5
5
  data.tar.gz: !binary |-
6
- YjIwOTE0MzY0NzIwNDRhNTNjN2EzYTg3Njc4MzQyYzIwNzUzYmFmYw==
6
+ ZGU4NmFiYTJlNmZlODRiMjRmNTkzZjMwOWQyMzEyZjU4OGQzMWUxMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZmZlODk5ZTZmMDI0MzVkN2M2NDM3MjMzYmM3MjA1MjQ5MDRmMmUwNzU2MzUw
10
- YTM5MWNlM2Y4MjJhMWEwMDk3ZDQ3MDJkNDBhOTExNWRhNWU4OWE4N2JmYjU3
11
- YzM2NzYzZWJmNjM3MjQzZThlOGM2NGMzMzAxZDdhZTFjMTQxYTI=
9
+ ZDVmN2MwYzBiMjQ1N2E2YjBmYmM0ZTk5ZWJjMGVkN2VmMDM4ODhkNTQ0OTIx
10
+ ZTg4YzMzMWE0OTY2ZjgyNWRiNzZlZjgyZDlkM2Y4MTQ2OTVmZTg5Zjc1NTA1
11
+ MTZhYzc2ZmYwNmM2ODRlMmViODljMGFjODYwNTY5OThlNjY2M2Y=
12
12
  data.tar.gz: !binary |-
13
- NDBhZTdlZjc1NTljMGE4NTU2M2UyZWM5YzZhNjQ2OTc1ZTQ5NjJmOGRiY2E2
14
- MTc4ZDAxMmRjNTlkMjMzZGRlZGZiODQzYmZlZWMwYzIxMTlhOWZlZDEyY2Fh
15
- ZjFmYWY5NTgwYTc1OTY1ODdkOWY3NThhODk1ZWEwMWY1N2M4OTQ=
13
+ M2M2YzU4ZTE5YzkxMWVmNmJiNTQ5OWFhNDExZGUwNzkxMGEzY2IyYTFmYTJl
14
+ YTE0OWI2ZmZhN2I0ZjA2YjU4NWFmNmUwMjY5ZDM4YWQ3ZmJkZmViNzRlNWMw
15
+ ZWMzNjIwNDkxNDk0NmMxOTE3NzljMGQ5MjlmYzgyODc3ZWQ2ZTY=
@@ -1,5 +1,5 @@
1
1
 
2
- h1. Cobweb v1.0.17
2
+ h1. Cobweb v1.0.18
3
3
 
4
4
  "@cobweb_gem":https://twitter.com/cobweb_gem
5
5
  !https://badge.fury.io/rb/cobweb.png!:http://badge.fury.io/rb/cobweb
@@ -3,7 +3,7 @@ class CobwebVersion
3
3
 
4
4
  # Returns a string of the current version
5
5
  def self.version
6
- "1.0.17"
6
+ "1.0.18"
7
7
  end
8
8
 
9
9
  end
@@ -1,4 +1,4 @@
1
- require 'sidekiq'
1
+
2
2
  require File.expand_path(File.dirname(__FILE__) + '/sidekiq/cobweb_helper')
3
3
 
4
4
  # If your client is single-threaded, we just need a single connection in our Redis connection pool
@@ -15,8 +15,7 @@ class CrawlFinishedWorker
15
15
 
16
16
  include Sidekiq::Worker
17
17
 
18
- sidekiq_options queue: "crawl_finished_worker"
19
-
18
+ sidekiq_options queue: "crawl_finished_worker" if SIDEKIQ_INSTALLED
20
19
 
21
20
  def perform(statistics)
22
21
  puts "Dummy Finished Job"
@@ -1,5 +1,4 @@
1
1
 
2
- require 'sidekiq'
3
2
  require File.expand_path(File.dirname(__FILE__) + '/sidekiq/cobweb_helper')
4
3
 
5
4
  # If your client is single-threaded, we just need a single connection in our Redis connection pool
@@ -16,7 +15,7 @@ class CrawlProcessWorker
16
15
 
17
16
  include Sidekiq::Worker
18
17
 
19
- sidekiq_options queue: "crawl_process_worker"
18
+ sidekiq_options queue: "crawl_process_worker" if SIDEKIQ_INSTALLED
20
19
 
21
20
  def perform(content)
22
21
  content = HashUtil.deep_symbolize_keys(content)
@@ -1,4 +1,3 @@
1
- require 'sidekiq'
2
1
  require File.expand_path(File.dirname(__FILE__) + '/cobweb')
3
2
  require File.expand_path(File.dirname(__FILE__) + '/sidekiq/cobweb_helper')
4
3
 
@@ -14,8 +13,7 @@ require File.expand_path(File.dirname(__FILE__) + '/sidekiq/cobweb_helper')
14
13
 
15
14
  class CrawlWorker
16
15
  include Sidekiq::Worker
17
- sidekiq_options queue: "crawl_worker"
18
- sidekiq_options retry: false
16
+ sidekiq_options :queue => "crawl_worker", :retry => false if SIDEKIQ_INSTALLED
19
17
 
20
18
  def perform(content_request)
21
19
  # setup the crawl class to manage the crawl of this object
@@ -1,3 +1,11 @@
1
+ if Gem::Specification.find_all_by_name("sidekiq", ">=3.0.0").count > 1
2
+ SIDEKIQ_INSTALLED = true
3
+ require 'sidekiq'
4
+ else
5
+ SIDEKIQ_INSTALLED = false
6
+ puts "can't find sidekiq gem"
7
+ end
8
+
1
9
  module Sidekiq
2
10
  module Worker
3
11
  module ClassMethods
@@ -4,25 +4,28 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
4
4
  describe CrawlWorker, :local_only => true do
5
5
 
6
6
  before(:all) do
7
- #store all existing resque process ids so we don't kill them afterwards
8
- @existing_processes = `ps aux | grep sidekiq | grep -v grep | awk '{print $2}'`.split("\n")
9
- puts @existing_processes
10
- @existing_processes.should be_empty
11
-
12
- # START WORKERS ONLY FOR CRAWL QUEUE SO WE CAN COUNT ENQUEUED PROCESS AND FINISH QUEUES
13
- puts "Starting Workers... Please Wait..."
14
- `mkdir log`
15
- `rm -rf output.log`
16
- io = IO.popen("nohup sidekiq -r ./lib/crawl_worker.rb -q crawl_worker > ./log/output.log &")
17
- puts "Workers Started."
18
-
7
+
8
+ if SIDEKIQ_INSTALLED
9
+ #store all existing resque process ids so we don't kill them afterwards
10
+ @existing_processes = `ps aux | grep sidekiq | grep -v grep | awk '{print $2}'`.split("\n")
11
+ puts @existing_processes
12
+ @existing_processes.should be_empty
13
+
14
+ # START WORKERS ONLY FOR CRAWL QUEUE SO WE CAN COUNT ENQUEUED PROCESS AND FINISH QUEUES
15
+ puts "Starting Workers... Please Wait..."
16
+ `mkdir log`
17
+ `rm -rf output.log`
18
+ io = IO.popen("nohup sidekiq -r ./lib/crawl_worker.rb -q crawl_worker > ./log/output.log &")
19
+ puts "Workers Started."
20
+ end
19
21
  end
20
22
 
21
23
  before(:each) do
24
+ pending("Sidkiq not installed") unless SIDEKIQ_INSTALLED
22
25
  @base_url = "http://localhost:3532/"
23
26
  @base_page_count = 77
24
27
 
25
- clear_queues
28
+ clear_sidekiq_queues
26
29
  end
27
30
 
28
31
  describe "with no crawl limit" do
@@ -198,7 +201,7 @@ describe CrawlWorker, :local_only => true do
198
201
  command = "kill #{(@all_processes - @existing_processes).join(" ")}"
199
202
  IO.popen(command)
200
203
  end
201
- clear_queues
204
+ clear_sidekiq_queues
202
205
  end
203
206
 
204
207
  end
@@ -234,7 +237,7 @@ def running?(crawl_id)
234
237
  result
235
238
  end
236
239
 
237
- def clear_queues
240
+ def clear_sidekiq_queues
238
241
  Sidekiq.redis do |conn|
239
242
  conn.smembers("queues").each do |queue_name|
240
243
  conn.del("queue:#{queue_name}")
@@ -4,7 +4,6 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec/samples/sample_serve
4
4
  require File.expand_path(File.dirname(__FILE__) + '/../spec/http_stubs')
5
5
  require 'mock_redis'
6
6
  require 'thin' if ENV["TRAVIS_RUBY_VERSION"].nil?
7
- require 'sidekiq'
8
7
 
9
8
  require 'coveralls'
10
9
  Coveralls.wear!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cobweb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stewart McKee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-23 00:00:00.000000000 Z
11
+ date: 2013-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis