snapcrawl 0.2.4rc1 → 0.2.4rc3

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
  SHA256:
3
- metadata.gz: 6cf8adbe42976bd97f013c67ffb70b5c162afaf566a1f5a16483dd0c8553dac0
4
- data.tar.gz: c6aff321ae9078f352870899a917b7f4f9e412b1403e39399fb3fefd0c752d60
3
+ metadata.gz: 7215567547e93a3e376017197b66f94aa5ec92d1aa775d209241951909666e9f
4
+ data.tar.gz: c94013330e9e165c9a28665422b66d6bc83420316a1a1f2f001e6e6c0cd6dacd
5
5
  SHA512:
6
- metadata.gz: d271cacd5fd3f60583b5c53340691c78965436c8ccab897202698c591b395d7be16325e05159d6633aae1c4076b919e361d157652fd2ab1739167c5711f893e1
7
- data.tar.gz: 1a87b710f345e98429391dd285648302fb23ed26dc3508b4ecc788c1ceada5b9c89d5bbef56e9f37d2402b76dc6bf5c12277a73ceed6a5c1d7f5dd87a3937491
6
+ metadata.gz: 4ad81c6c12ae20234ac663066e5f06cbcb7ca2c79560965e3db77147bbf0736431873d9a74fc5ea39ac4206e8329e08e33d0c87535fc09f734dcee02db5ac6de
7
+ data.tar.gz: 5877c5959414dd52b92736e400fa9f9b624e4fcd77ea863804ca110e7e5123fa266967cb6a47180bb2a7daf6c4661c3507c55ec6896fc9a59c4bd9a6480ba7d7
data/bin/snapcrawl CHANGED
@@ -3,5 +3,16 @@
3
3
  require 'snapcrawl'
4
4
  trap(:INT) { abort "\r\nGoodbye" }
5
5
  include Snapcrawl
6
- Crawler.instance.handle ARGV
6
+
7
+ begin
8
+ Crawler.instance.handle ARGV
9
+ rescue MissingPhantomJS => e
10
+ message = "Cannot find phantomjs executable in the path, please install it first."
11
+ say! "\n\n!undred!#{e.class}!txtrst!\n#{message}"
12
+ exit 2
13
+ rescue => e
14
+ puts e.backtrace.reverse if ENV['DEBUG']
15
+ say! "\n\n!undred!#{e.class}!txtrst!\n#{e.message}"
16
+ exit 1
17
+ end
7
18
 
@@ -10,6 +10,8 @@ require 'webshot'
10
10
  module Snapcrawl
11
11
  include Colsole
12
12
 
13
+ class MissingPhantomJS < StandardError; end
14
+
13
15
  class Crawler
14
16
  def self.instance
15
17
  @@instance ||= self.new
@@ -23,14 +25,14 @@ module Snapcrawl
23
25
  def handle(args)
24
26
  @done = []
25
27
  begin
26
- execute Docopt::docopt(doc, argv: args)
28
+ execute Docopt::docopt(doc, version: VERSION, argv: args)
27
29
  rescue Docopt::Exit => e
28
30
  puts e.message
29
31
  end
30
32
  end
31
33
 
32
34
  def execute(args)
33
- return show_version if args['--version']
35
+ raise MissingPhantomJS unless command_exist? "phantomjs"
34
36
  crawl args['<url>'].dup, opts_from_args(args)
35
37
  end
36
38
 
@@ -204,10 +206,6 @@ module Snapcrawl
204
206
  links_array.uniq
205
207
  end
206
208
 
207
- def show_version
208
- puts VERSION
209
- end
210
-
211
209
  def doc
212
210
  @doc ||= File.read template 'docopt.txt'
213
211
  end
@@ -1,3 +1,3 @@
1
1
  module Snapcrawl
2
- VERSION = "0.2.4rc1"
2
+ VERSION = "0.2.4rc3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapcrawl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4rc1
4
+ version: 0.2.4rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
- - !ruby/object:Gem::Dependency
70
- name: phantomjs
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '2.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '2.0'
83
69
  description: Snapcrawl is a command line utility for crawling a website and saving
84
70
  screenshots.
85
71
  email: db@dannyben.com