apollo-crawler 0.0.22 → 0.0.23
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.
- data/bin/apollo-crawler +14 -2
- data/lib/apollo_crawler/version.rb +1 -1
- metadata +1 -1
data/bin/apollo-crawler
CHANGED
@@ -13,6 +13,8 @@ require "nokogiri"
|
|
13
13
|
require "pp"
|
14
14
|
require "optparse"
|
15
15
|
|
16
|
+
require File.join(File.dirname(__FILE__), '..', 'lib', 'apollo_crawler', 'version')
|
17
|
+
|
16
18
|
module Crawler
|
17
19
|
class Program
|
18
20
|
# This hash will hold all of the options
|
@@ -31,6 +33,7 @@ module Crawler
|
|
31
33
|
def init_options
|
32
34
|
@options = {}
|
33
35
|
@options[:verbose] = false
|
36
|
+
@options[:version] = false
|
34
37
|
|
35
38
|
@optparser = OptionParser.new do | opts |
|
36
39
|
# This displays the help screen, all programs are
|
@@ -48,6 +51,10 @@ module Crawler
|
|
48
51
|
@options[:verbose] = true
|
49
52
|
end
|
50
53
|
|
54
|
+
opts.on('-V', '--version', 'Show version info') do
|
55
|
+
@options[:version] = true
|
56
|
+
end
|
57
|
+
|
51
58
|
opts.on('-l', '--list-plugins', 'List of plugins') do
|
52
59
|
@options[:list_plugins] = true
|
53
60
|
end
|
@@ -123,11 +130,16 @@ module Crawler
|
|
123
130
|
|
124
131
|
def run
|
125
132
|
init_options()
|
126
|
-
|
127
|
-
load_config_file()
|
128
133
|
|
129
134
|
parse_options()
|
130
135
|
|
136
|
+
if(@options[:version])
|
137
|
+
puts Apollo::Crawler::VERSION
|
138
|
+
return
|
139
|
+
end
|
140
|
+
|
141
|
+
load_config_file()
|
142
|
+
|
131
143
|
# Register sites which can be crawled
|
132
144
|
register_plugins()
|
133
145
|
|