From 02c2d7080d075326a3be452f9eb4db8fdd0f4249 Mon Sep 17 00:00:00 2001 From: Nick Abramovic Date: Mon, 23 Sep 2013 22:34:18 -0700 Subject: [PATCH 1/2] Using native Redis commandsfor DB Size --- cloud-crawler/lib/cloud-crawler/redis_page_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud-crawler/lib/cloud-crawler/redis_page_store.rb b/cloud-crawler/lib/cloud-crawler/redis_page_store.rb index 70abe2f..ea3acaa 100644 --- a/cloud-crawler/lib/cloud-crawler/redis_page_store.rb +++ b/cloud-crawler/lib/cloud-crawler/redis_page_store.rb @@ -97,7 +97,7 @@ def merge!(hash) end def size - @pages.keys("*").size + @pages.dbsize end def keys From 0671fc9265a04916dee192ab759383c15243fe00 Mon Sep 17 00:00:00 2001 From: Nick Abramovic Date: Mon, 23 Sep 2013 22:58:00 -0700 Subject: [PATCH 2/2] Adding Version and new Require Logic --- cloud-crawler/lib/cloud-crawler.rb | 27 +++++++++++----------- cloud-crawler/lib/cloud-crawler/version.rb | 27 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 cloud-crawler/lib/cloud-crawler/version.rb diff --git a/cloud-crawler/lib/cloud-crawler.rb b/cloud-crawler/lib/cloud-crawler.rb index 91af08c..f078727 100644 --- a/cloud-crawler/lib/cloud-crawler.rb +++ b/cloud-crawler/lib/cloud-crawler.rb @@ -20,17 +20,18 @@ # require 'rubygems' require 'bundler/setup' -require 'cloud-crawler' -require 'cloud-crawler/logger' -require 'cloud-crawler/cookie_store' -require 'cloud-crawler/http' -require 'cloud-crawler/page' -require 'cloud-crawler/redis_page_store' -require 'cloud-crawler/driver' -require 'cloud-crawler/dsl_core' -require 'cloud-crawler/dsl_front_end' -require 'cloud-crawler/crawl_job' -require 'cloud-crawler/batch_crawl_job' -require 'cloud-crawler/batch_curl_job' -require 'cloud-crawler/worker' +%w[logger + cookie_store + http + page + redis_page_store + driver + dsl_core + dsl_front_end + crawl_job + batch_crawl_job + batch_curl_job + worker].each do |f| + require "cloud-crawler/#{f}" +end diff --git a/cloud-crawler/lib/cloud-crawler/version.rb b/cloud-crawler/lib/cloud-crawler/version.rb new file mode 100644 index 0000000..ceb6d16 --- /dev/null +++ b/cloud-crawler/lib/cloud-crawler/version.rb @@ -0,0 +1,27 @@ +# +# Copyright (c) 2013 Charles H Martin, PhD +# +# Calculated Content (TM) +# http://calculatedcontent.com +# charles@calculatedcontent.com +# +# All rights reserved. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL MADE BY MADE LTD BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +module CloudCrawler + MAJOR = 0 + MINOR = 2 + PATCH = 0 + VERSION = [MAJOR, MINOR, PATCH].join('.') +end \ No newline at end of file