crabfarm 0.6.2 → 0.7.0

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: 09ceb80d5125962d7f54f0b7d9f79bc568221f18
4
- data.tar.gz: f72e8f9951b3ae981bece342c9a7364b007677e9
3
+ metadata.gz: d58ed7568693ec48b019ca4bf3d8051073938d1b
4
+ data.tar.gz: c0853a7063ef07de79950d23802993c5d5f4bc27
5
5
  SHA512:
6
- metadata.gz: 1572b106739d6f9a7b2ae385bb640b926f05707e31daf0a99758bb308ab8020a374636fc9df7eb56cf868c3a67aaa861d9538d859438367bc7a300e440613bf5
7
- data.tar.gz: 39049c8c5b3b5c115dfdc11c92a67bb81411aff7512c16b524c6874c66cf0638adcb9a1a369628e83f5a50d667cabb8c494325f534b94a468ea941969f9790b7
6
+ metadata.gz: cd5f294f3424f16316633894cfa3e25bfa464ef3a56aaa099d572a1eaf74873de840e89ee7afd7ff7f047f261d7179a9fb9c85c6549ba69b09cb4228e0a93a8c
7
+ data.tar.gz: a27f2e4ff7adef226539f4ff24301d0c6c2162c47b4a35d519a1737aa0bc4d76878c1b5518cd4de1e5e47454393ba6ac08880364008bd1a620296e7c3c0e4763
@@ -31,6 +31,7 @@ module Crabfarm
31
31
  def phantom_config
32
32
  {
33
33
  load_images: Crabfarm.config.phantom_load_images,
34
+ log_level: Crabfarm.config.phantom_log_level,
34
35
  ssl: Crabfarm.config.phantom_ssl,
35
36
  bin_path: Crabfarm.config.phantom_bin_path,
36
37
  proxy: config[:proxy],
@@ -22,7 +22,7 @@ module Crabfarm
22
22
  end
23
23
 
24
24
  def navigate(_name, _params={})
25
- TransitionService.transition(@context, _name, params.merge(_params)).navigator
25
+ TransitionService.transition(@context, _name, params.merge(_params))
26
26
  end
27
27
 
28
28
  alias :nav :navigate
@@ -41,10 +41,6 @@ module Crabfarm
41
41
  raise NotImplementedError.new
42
42
  end
43
43
 
44
- def as_json(_options=nil)
45
- field_hash
46
- end
47
-
48
44
  def to_json(_options=nil)
49
45
  field_hash.to_json _options
50
46
  end
@@ -11,10 +11,6 @@ module Crabfarm
11
11
  _values.each { |k,v| send("#{k}=", v) }
12
12
  end
13
13
 
14
- def as_json(_options=nil)
15
- field_hash
16
- end
17
-
18
14
  def to_json(_options={})
19
15
  field_hash.to_json(_options)
20
16
  end
@@ -22,17 +22,16 @@ module Crabfarm
22
22
 
23
23
  # Phantom launcher configuration
24
24
  [:phantom_load_images, :boolean, 'Phantomjs image loading, only for phantomjs driver.'],
25
+ [:phantom_log_level, ['error', 'warn', 'info', 'debug'], 'Phantomjs log level.'],
25
26
  [:phantom_ssl, ['sslv3', 'sslv2', 'tlsv1', 'any'], 'Phantomjs ssl mode: sslv3, sslv2, tlsv1 or any, only for phantomjs driver.'],
26
27
  [:phantom_bin_path, :string, 'Phantomjs binary path, only for phantomjs driver.'],
27
28
 
28
29
  # Crabtrap launcher configuration
29
30
  [:crabtrap_bin_path, :string, 'Crabtrap binary path.'],
31
+ [:crabtrap_log_level, ['error', 'warn', 'info', 'debug'], 'Crabtrap log level'],
30
32
 
31
33
  # Recorder configuration
32
- [:recorder_driver, :string, 'Recorder driver name, defaults to \'firefox\''],
33
-
34
- # Live configurations
35
- [:live_full_reload, :boolean, 'Whether to create a new driver session on every live reload or not']
34
+ [:recorder_driver, :string, 'Recorder driver name, defaults to \'firefox\'']
36
35
  ]
37
36
  .map { |o| Option.new(*o) }
38
37
 
@@ -67,9 +66,10 @@ module Crabfarm
67
66
  phantom_load_images: false,
68
67
  phantom_ssl: 'any',
69
68
  phantom_bin_path: 'phantomjs',
69
+ phantom_log_level: :warn,
70
70
  crabtrap_bin_path: 'crabtrap',
71
- recorder_driver: :firefox,
72
- live_full_reload: false
71
+ crabtrap_log_level: :warn,
72
+ recorder_driver: :firefox
73
73
  }
74
74
  end
75
75
 
@@ -87,6 +87,7 @@ module Crabfarm
87
87
  def crabtrap_config
88
88
  {
89
89
  bin_path: crabtrap_bin_path,
90
+ log_level: crabtrap_log_level,
90
91
  proxy: proxy
91
92
  }
92
93
  end
@@ -69,6 +69,7 @@ module Crabfarm
69
69
  cmd << @config[:bucket_path] if mode != :pass
70
70
  cmd << "--port=#{port}"
71
71
  cmd << "--virtual=#{@config[:virtual]}" if @config.key? :virtual
72
+ cmd << "--log=#{@config[:log_level].to_s.upcase}"
72
73
  cmd
73
74
  end
74
75
 
@@ -1,4 +1,3 @@
1
- require 'benchmark'
2
1
  require 'ostruct'
3
2
 
4
3
  module Crabfarm
@@ -106,18 +105,19 @@ module Crabfarm
106
105
  if @working
107
106
  begin
108
107
  logger.info "Transitioning state: #{@next_state_name}"
109
- @elapsed = Benchmark.measure do
110
- ActiveSupport::Dependencies.clear
111
- @doc = TransitionService.transition(@context, @next_state_name, @next_state_params).document
112
- end.real
108
+ ActiveSupport::Dependencies.clear
109
+ ts = TransitionService.transition(@context, @next_state_name, @next_state_params)
110
+ @elapsed = ts.elapsed
111
+ @doc = ts.document
112
+ @error = nil
113
113
 
114
114
  logger.info "Transitioned in #{@elapsed.real}"
115
- @error = nil
116
115
  rescue Exception => e
117
- logger.error "Error during transition:"
118
- logger.error e
119
116
  @doc = nil
120
117
  @error = e
118
+
119
+ logger.error "Error during transition:"
120
+ logger.error e
121
121
  end
122
122
 
123
123
  @lock.synchronize {
@@ -1,4 +1,3 @@
1
- require 'benchmark'
2
1
  require 'ostruct'
3
2
 
4
3
  module Crabfarm
@@ -27,13 +26,14 @@ module Crabfarm
27
26
 
28
27
  def navigate(_name, _params={})
29
28
  @lock.synchronize {
30
- output = { name: _name, params: _params }
31
-
32
- output[:elapsed] = Benchmark.measure do
33
- output[:doc] = TransitionService.transition(@context, _name, _params).document
34
- end
35
-
36
- OpenStruct.new output
29
+ ts = TransitionService.transition(@context, _name, _params)
30
+
31
+ OpenStruct.new({
32
+ name: _name,
33
+ params: _params,
34
+ doc: ts.document,
35
+ elapsed: ts.elapsed
36
+ })
37
37
  }
38
38
  end
39
39
 
@@ -1,4 +1,3 @@
1
- require 'benchmark'
2
1
  require 'crabfarm/utils/console'
3
2
 
4
3
  module Crabfarm
@@ -14,9 +13,7 @@ module Crabfarm
14
13
 
15
14
  def execute
16
15
  Crabfarm.with_context @memento do |ctx|
17
- @elapsed = Benchmark.measure do
18
- @transition = TransitionService.transition ctx, @target, (@params || {})
19
- end
16
+ @transition = TransitionService.transition ctx, @target, (@params || {})
20
17
  end
21
18
  end
22
19
 
@@ -24,7 +21,7 @@ module Crabfarm
24
21
  @manager.show_message(
25
22
  :neutral,
26
23
  'Navigation completed!',
27
- "The page was scrapped in #{@elapsed.real} seconds",
24
+ "The page was scrapped in #{@transition.elapsed} seconds",
28
25
  @transition.document.to_json,
29
26
  :json
30
27
  )
@@ -2,6 +2,7 @@ require 'readline'
2
2
  require 'rainbow'
3
3
  require 'rainbow/ext/string'
4
4
  require 'json'
5
+ require 'crabfarm/utils/console'
5
6
  require 'crabfarm/engines/sync_state_manager'
6
7
 
7
8
  module Crabfarm
@@ -23,60 +24,62 @@ module Crabfarm
23
24
  end
24
25
 
25
26
  def reload!
26
- puts "Reloading crawler source".color Colors::NOTICE
27
+ console.info "Reloading crawler source"
27
28
  @manager.reload
28
29
  nil
29
30
  end
30
31
 
31
32
  def reset
32
- puts "Resetting crawling context".color Colors::NOTICE
33
+ console.info "Resetting crawling context"
33
34
  @manager.reset
34
35
  nil
35
36
  end
36
37
 
37
38
  def navigate(_name=nil, _params={})
38
39
  if _name.nil?
39
- puts "Must provide a navigator name".color Colors::ERROR
40
+ console.warning "Must provide a navigator name"
40
41
  return
41
42
  end
42
43
 
43
44
  begin
44
- puts "Navigating...".color Colors::NOTICE
45
+ console.info "Navigating..."
45
46
  output = @manager.navigate _name, _params
46
- puts JSON.pretty_generate(output.doc).gsub(/(^|\\n)/, ' ').color Colors::RESULT
47
- puts "Completed in #{output.elapsed.real} s".color Colors::NOTICE
47
+ console.json_result output.doc
48
+ console.info "Completed in #{output.elapsed.real} s"
48
49
 
49
- rescue Exception => e
50
- puts "#{e.to_s}".color Colors::ERROR
51
- puts e.backtrace
50
+ rescue Exception => exc
51
+ console.exception exc
52
52
  end
53
53
  end
54
54
 
55
55
  def snap(_name=nil, _params={})
56
56
  if _name.nil?
57
- puts "Must provide a navigator name".color Colors::ERROR
57
+ console.warning "Must provide a navigator name"
58
58
  return
59
59
  end
60
60
 
61
61
  begin
62
- puts "Navigating, waiting to hit a reducer...".color Colors::NOTICE
62
+ console.info "Navigating, waiting to hit a reducer..."
63
63
  require 'crabfarm/modes/shared/snapshot_decorator'
64
64
  Factories::Reducer.with_decorator Shared::SnapshotDecorator do
65
65
  @manager.navigate _name, _params
66
66
  end
67
- puts "Navigation completed".color Colors::NOTICE
67
+ console.info "Navigation completed"
68
68
 
69
- rescue Exception => e
70
- puts "#{e.to_s}".color Colors::ERROR
71
- puts e.backtrace
69
+ rescue Exception => exc
70
+ console.exception exc
72
71
  end
73
72
  end
74
73
 
75
74
  def help
76
- puts "Ejem..."
75
+ console.info "Ejem..."
77
76
  nil
78
77
  end
79
78
 
79
+ def console
80
+ Crabfarm::Utils::Console
81
+ end
82
+
80
83
  alias :nav :navigate
81
84
  end
82
85
 
@@ -88,16 +91,15 @@ module Crabfarm
88
91
  output = dsl.instance_eval Readline.readline("> ", true)
89
92
  puts output.inspect unless output.nil?
90
93
  rescue SyntaxError => se
91
- puts "Syntax error: #{se.message}".color(Colors::ERROR)
94
+ Crabfarm::Utils::Console.exception se
92
95
  rescue SystemExit, Interrupt
93
96
  break
94
- rescue => e
95
- puts "#{e.to_s}".color(Colors::ERROR)
96
- puts e.backtrace
97
+ rescue => exc
98
+ Crabfarm::Utils::Console.exception exc
97
99
  end
98
100
  end
99
101
 
100
- puts "Exiting".color(Colors::NOTICE)
102
+ Crabfarm::Utils::Console.system "Exiting"
101
103
  end
102
104
 
103
105
  end
@@ -14,7 +14,7 @@ module Crabfarm
14
14
  prefix :api
15
15
 
16
16
  rescue_from Grape::Exceptions::ValidationErrors do |e|
17
- rack_response({ errors: e.as_json }.to_json, 400)
17
+ rack_response({ errors: e }.to_json, 400)
18
18
  end
19
19
 
20
20
  rescue_from Crabfarm::ApiError do |e|
@@ -54,7 +54,7 @@ module Crabfarm
54
54
  optional :wait, type: Float
55
55
  end
56
56
  put :state do
57
- print_state evaluator.navigate params[:name], params[:params], wait
57
+ print_state evaluator.navigate params[:name], params[:params] || {}, wait
58
58
  end
59
59
  end
60
60
 
@@ -14,7 +14,7 @@ RSpec.configure do |config|
14
14
  example.run
15
15
  ensure
16
16
  # store result in metadata so it can be accessed by formatters/reporters
17
- example.metadata[:result] = @reducer_state.as_json if @reducer_state
17
+ example.metadata[:result] = @reducer_state if @reducer_state
18
18
  end
19
19
  elsif described_class < Crabfarm::BaseNavigator
20
20
  Crabfarm.with_context example.metadata[:navigating] do |ctx|
@@ -55,7 +55,7 @@ module Crabfarm
55
55
  cmd << "--ssl-protocol=#{@config[:ssl]}" unless @config[:ssl].nil?
56
56
  cmd << "--ignore-ssl-errors=true"
57
57
  cmd << "--web-security=false"
58
- cmd << "--webdriver-loglevel=WARN"
58
+ cmd << "--webdriver-loglevel=#{@config[:log_level].to_s.upcase}"
59
59
  cmd
60
60
  end
61
61
 
@@ -36,7 +36,10 @@ set_webdriver_dsl :pincers
36
36
  # The following parameters only apply if using the :phantomjs webdriver
37
37
 
38
38
  # Make phantom load images when requesting documents
39
- # set_phantom_load_images false
39
+ # set_phantom_load_images true
40
+
41
+ # Set phantom log level, defaults to warning
42
+ # set_phantom_log_level :warn
40
43
 
41
44
  # Set phantom ssl mode, defaults to :any, posible options are sslv3, sslv2, tlsv1 or any
42
45
  # set_phantom_ssl 'any'
@@ -70,10 +73,3 @@ set_webdriver_dsl :pincers
70
73
 
71
74
  # Change the browser used for the recording command, available options are 'firefox' or 'chrome'
72
75
  # set_recorder_driver :firefox
73
-
74
-
75
- # Live mode configuration
76
- ########################################
77
-
78
- # Build a new webdriver session on each reload
79
- # set_live_full_reload false
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "crabfarm", '<%= version %>'
4
- gem "pincers", '~> 0.2.1'
4
+ gem "pincers", '~> 0.6'
5
5
 
6
6
  # Comment this if not using a nokogiri based parser or browser
7
7
  gem 'nokogiri', "~> 1.6.6"
@@ -1,3 +1,5 @@
1
+ require 'benchmark'
2
+
1
3
  module Crabfarm
2
4
  class TransitionService
3
5
 
@@ -5,7 +7,7 @@ module Crabfarm
5
7
  self.new(_context).transition(_name, _params)
6
8
  end
7
9
 
8
- attr_reader :document, :navigator
10
+ attr_reader :document, :navigator, :elapsed
9
11
 
10
12
  def initialize(_context)
11
13
  @context = _context
@@ -14,10 +16,11 @@ module Crabfarm
14
16
  def transition(_name_or_class, _params={})
15
17
  navigator_class = Utils::Resolve.navigator_class _name_or_class
16
18
 
17
- @context.prepare
18
- @navigator = Factories::Navigator.build navigator_class, @context, _params
19
- @document = @navigator.run
20
- @document = @document.as_json if @document.respond_to? :as_json
19
+ @elapsed = Benchmark.measure do
20
+ @context.prepare
21
+ @navigator = Factories::Navigator.build navigator_class, @context, _params
22
+ @document = @navigator.run
23
+ end.real
21
24
 
22
25
  self
23
26
  end
@@ -1,30 +1,33 @@
1
1
  require 'childprocess'
2
+ require 'crabfarm/utils/stream_dumper'
2
3
 
3
4
  ChildProcess.posix_spawn = true
4
5
 
5
- module Crabfarm
6
- module Utils
7
- module Processes
6
+ module Crabfarm::Utils
8
7
 
9
- def self.start_logged_process(_name, _cmd, _logger, _env={})
10
- ro, wo = IO.pipe
11
- re, we = IO.pipe
8
+ module Processes
9
+ def self.start_logged_process(_name, _cmd, _logger, _env={})
12
10
 
13
- proc = ChildProcess.build(*_cmd)
14
- proc.environment.merge! _env
15
- proc.io.stdout = wo
16
- proc.io.stderr = we
17
- proc.start
11
+ ro, wo = IO.pipe
12
+ re, we = IO.pipe
18
13
 
19
- wo.close
20
- we.close
14
+ proc = ChildProcess.build(*_cmd)
15
+ proc.environment.merge! _env
16
+ proc.io.stdout = wo
17
+ proc.io.stderr = we
18
+ proc.start
21
19
 
22
- Thread.new { ro.each_line { |l| _logger.info "[#{_name.upcase}] #{l}" } }
23
- Thread.new { re.each_line { |l| _logger.warn "[#{_name.upcase}] #{l}" } }
20
+ # close write endpoints after fork
21
+ wo.close
22
+ we.close
24
23
 
25
- proc
26
- end
24
+ # register log consumers
25
+ StreamDumper.register_stream(ro) { |l| _logger.info "[#{_name.upcase}] #{l}" }
26
+ StreamDumper.register_stream(re) { |l| _logger.warn "[#{_name.upcase}] #{l}" }
27
27
 
28
+ proc
28
29
  end
29
30
  end
31
+
30
32
  end
33
+
@@ -0,0 +1,142 @@
1
+ require 'thwait'
2
+
3
+ module Crabfarm::Utils
4
+
5
+ class StreamDumper
6
+
7
+ class Reload < StandardError; end
8
+
9
+ def self.consumer
10
+ @@consumer ||= self.new
11
+ end
12
+
13
+ def self.register_stream(_stream, &_block)
14
+ consumer.register_stream _stream, &_block
15
+ consumer.restart
16
+ end
17
+
18
+ def initialize
19
+ @streams = []
20
+ @lock = Mutex.new
21
+ @worker = nil
22
+ end
23
+
24
+ def register_stream(_stream, &_block)
25
+ @lock.synchronize { @streams << Wrapper.new(_stream, _block) }
26
+ end
27
+
28
+ def restart
29
+ @lock.synchronize do
30
+ if @worker and @worker.alive?
31
+ @worker.raise Reload # signal worker to reload streams
32
+ else
33
+ @worker = load_worker
34
+ end
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def load_worker
41
+ Thread.new do
42
+ looped = 0
43
+ begin
44
+ while @streams.count > 0
45
+ all_streams = dump_streams
46
+ result = IO.select(all_streams << $stdin, [], all_streams)
47
+ if result
48
+ process_ready_streams result[0]
49
+ discard_errored_streams result[2]
50
+ end
51
+ looped += 1
52
+ end
53
+ rescue Reload
54
+ retry
55
+ rescue SystemExit
56
+ # nothing
57
+ end
58
+ end
59
+ end
60
+
61
+ def process_ready_streams(_streams)
62
+ _streams.each do |stream|
63
+ wrapper = find_stream_wrapper stream
64
+ if wrapper
65
+ wrapper.process_lines
66
+ remove_wrapper wrapper, :eof if wrapper.eof?
67
+ end
68
+ end
69
+ end
70
+
71
+ def discard_errored_streams(_streams)
72
+ _streams.each do |stream|
73
+ wrapper = find_stream_wrapper stream
74
+ remove_wrapper wrapper, :error if wrapper
75
+ end
76
+ end
77
+
78
+ def find_stream_wrapper(_stream)
79
+ @streams.find { |s| s.stream == _stream }
80
+ end
81
+
82
+ def remove_wrapper(_wrapper, _reason)
83
+ @lock.synchronize { @streams.delete _wrapper }
84
+ end
85
+
86
+ def dump_streams
87
+ @streams.map(&:stream)
88
+ end
89
+
90
+ class Wrapper
91
+
92
+ MAX_LENGTH = 2048
93
+
94
+ attr_reader :stream
95
+
96
+ def initialize(_stream, _block)
97
+ @stream = _stream
98
+ @block = _block
99
+ @buffer = []
100
+ @eof = false
101
+ end
102
+
103
+ def eof?
104
+ @eof
105
+ end
106
+
107
+ def process_lines
108
+ begin
109
+ loop do
110
+ chunk = @stream.read_nonblock(MAX_LENGTH)
111
+ process_chunk chunk
112
+ end
113
+ rescue IO::WaitReadable
114
+ # nothing, just stop looping
115
+ rescue EOFError
116
+ @eof = true
117
+ rescue Exception => exc
118
+ puts "Error in stream consumer: #{exc}"
119
+ @eof = true
120
+ end
121
+ end
122
+
123
+ def process_chunk(_chunk)
124
+ index = _chunk.index $/
125
+
126
+ unless index.nil?
127
+ head = _chunk[0..index-1]
128
+ tail = _chunk[index+1..-1]
129
+
130
+ @block.call(@buffer.join + head)
131
+ @buffer.clear
132
+
133
+ process_chunk tail
134
+ else
135
+ @buffer << _chunk
136
+ end
137
+ end
138
+
139
+ end
140
+
141
+ end
142
+ end
@@ -1,3 +1,3 @@
1
1
  module Crabfarm
2
- VERSION = "0.6.2"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/crabfarm.rb CHANGED
@@ -50,9 +50,13 @@ module Crabfarm
50
50
 
51
51
  def self.logger
52
52
  if @@logger.nil?
53
- @@logger = Logger.new(@@config.log_path.nil? ? STDOUT : File.join(@@config.log_path, 'crawler.log'))
54
- @@logger.level = Logger::INFO
53
+ if @@config.log_path.nil? or @@config.log_path.empty?
54
+ @@logger = Logger.new STDOUT
55
+ else
56
+ @@logger = Logger.new File.join(@@config.log_path, 'crawler.log')
57
+ end
55
58
  end
59
+
56
60
  @@logger
57
61
  end
58
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crabfarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Baixas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-20 00:00:00.000000000 Z
11
+ date: 2015-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0
19
+ version: '3.0'
20
20
  - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 3.0.0
29
+ version: '3.0'
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5'
@@ -36,61 +36,64 @@ dependencies:
36
36
  requirements:
37
37
  - - ~>
38
38
  - !ruby/object:Gem::Version
39
- version: 2.12.0
39
+ version: '2.12'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: 2.12.0
46
+ version: '2.12'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: inquirer
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.2.0
53
+ version: '0.2'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ~>
59
59
  - !ruby/object:Gem::Version
60
- version: 0.2.0
60
+ version: '0.2'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rainbow
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ~>
66
66
  - !ruby/object:Gem::Version
67
- version: 2.0.0
67
+ version: '2.0'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ~>
73
73
  - !ruby/object:Gem::Version
74
- version: 2.0.0
74
+ version: '2.0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: grape
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ~>
80
80
  - !ruby/object:Gem::Version
81
- version: 0.10.0
81
+ version: '0.10'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ~>
87
87
  - !ruby/object:Gem::Version
88
- version: 0.10.0
88
+ version: '0.10'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: puma
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ~>
94
+ - !ruby/object:Gem::Version
95
+ version: '2.10'
96
+ - - '>='
94
97
  - !ruby/object:Gem::Version
95
98
  version: 2.10.2
96
99
  type: :runtime
@@ -98,27 +101,33 @@ dependencies:
98
101
  version_requirements: !ruby/object:Gem::Requirement
99
102
  requirements:
100
103
  - - ~>
104
+ - !ruby/object:Gem::Version
105
+ version: '2.10'
106
+ - - '>='
101
107
  - !ruby/object:Gem::Version
102
108
  version: 2.10.2
103
109
  - !ruby/object:Gem::Dependency
104
110
  name: git
105
111
  requirement: !ruby/object:Gem::Requirement
106
112
  requirements:
107
- - - '>='
113
+ - - ~>
108
114
  - !ruby/object:Gem::Version
109
- version: '0'
115
+ version: '2.12'
110
116
  type: :runtime
111
117
  prerelease: false
112
118
  version_requirements: !ruby/object:Gem::Requirement
113
119
  requirements:
114
- - - '>='
120
+ - - ~>
115
121
  - !ruby/object:Gem::Version
116
- version: '0'
122
+ version: '2.12'
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: childprocess
119
125
  requirement: !ruby/object:Gem::Requirement
120
126
  requirements:
121
127
  - - ~>
128
+ - !ruby/object:Gem::Version
129
+ version: '0.5'
130
+ - - '>='
122
131
  - !ruby/object:Gem::Version
123
132
  version: 0.5.5
124
133
  type: :runtime
@@ -126,6 +135,9 @@ dependencies:
126
135
  version_requirements: !ruby/object:Gem::Requirement
127
136
  requirements:
128
137
  - - ~>
138
+ - !ruby/object:Gem::Version
139
+ version: '0.5'
140
+ - - '>='
129
141
  - !ruby/object:Gem::Version
130
142
  version: 0.5.5
131
143
  - !ruby/object:Gem::Dependency
@@ -146,16 +158,16 @@ dependencies:
146
158
  name: pry-byebug
147
159
  requirement: !ruby/object:Gem::Requirement
148
160
  requirements:
149
- - - '>='
161
+ - - ~>
150
162
  - !ruby/object:Gem::Version
151
- version: '0'
163
+ version: '3.2'
152
164
  type: :runtime
153
165
  prerelease: false
154
166
  version_requirements: !ruby/object:Gem::Requirement
155
167
  requirements:
156
- - - '>='
168
+ - - ~>
157
169
  - !ruby/object:Gem::Version
158
- version: '0'
170
+ version: '3.2'
159
171
  - !ruby/object:Gem::Dependency
160
172
  name: selenium-webdriver
161
173
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +187,9 @@ dependencies:
175
187
  requirement: !ruby/object:Gem::Requirement
176
188
  requirements:
177
189
  - - ~>
190
+ - !ruby/object:Gem::Version
191
+ version: '1.6'
192
+ - - '>='
178
193
  - !ruby/object:Gem::Version
179
194
  version: 1.6.6
180
195
  type: :development
@@ -182,6 +197,9 @@ dependencies:
182
197
  version_requirements: !ruby/object:Gem::Requirement
183
198
  requirements:
184
199
  - - ~>
200
+ - !ruby/object:Gem::Version
201
+ version: '1.6'
202
+ - - '>='
185
203
  - !ruby/object:Gem::Version
186
204
  version: 1.6.6
187
205
  - !ruby/object:Gem::Dependency
@@ -190,14 +208,14 @@ dependencies:
190
208
  requirements:
191
209
  - - ~>
192
210
  - !ruby/object:Gem::Version
193
- version: 0.2.1
211
+ version: '0.6'
194
212
  type: :development
195
213
  prerelease: false
196
214
  version_requirements: !ruby/object:Gem::Requirement
197
215
  requirements:
198
216
  - - ~>
199
217
  - !ruby/object:Gem::Version
200
- version: 0.2.1
218
+ version: '0.6'
201
219
  - !ruby/object:Gem::Dependency
202
220
  name: bundler
203
221
  requirement: !ruby/object:Gem::Requirement
@@ -216,77 +234,80 @@ dependencies:
216
234
  name: rake
217
235
  requirement: !ruby/object:Gem::Requirement
218
236
  requirements:
219
- - - '>='
237
+ - - ~>
220
238
  - !ruby/object:Gem::Version
221
- version: '0'
239
+ version: '10.4'
222
240
  type: :development
223
241
  prerelease: false
224
242
  version_requirements: !ruby/object:Gem::Requirement
225
243
  requirements:
226
- - - '>='
244
+ - - ~>
227
245
  - !ruby/object:Gem::Version
228
- version: '0'
246
+ version: '10.4'
229
247
  - !ruby/object:Gem::Dependency
230
248
  name: rspec
231
249
  requirement: !ruby/object:Gem::Requirement
232
250
  requirements:
233
- - - '>='
251
+ - - ~>
234
252
  - !ruby/object:Gem::Version
235
- version: '0'
253
+ version: '3.1'
236
254
  type: :development
237
255
  prerelease: false
238
256
  version_requirements: !ruby/object:Gem::Requirement
239
257
  requirements:
240
- - - '>='
258
+ - - ~>
241
259
  - !ruby/object:Gem::Version
242
- version: '0'
260
+ version: '3.1'
243
261
  - !ruby/object:Gem::Dependency
244
262
  name: rspec-nc
245
263
  requirement: !ruby/object:Gem::Requirement
246
264
  requirements:
247
- - - '>='
265
+ - - ~>
248
266
  - !ruby/object:Gem::Version
249
- version: '0'
267
+ version: '0.2'
250
268
  type: :development
251
269
  prerelease: false
252
270
  version_requirements: !ruby/object:Gem::Requirement
253
271
  requirements:
254
- - - '>='
272
+ - - ~>
255
273
  - !ruby/object:Gem::Version
256
- version: '0'
274
+ version: '0.2'
257
275
  - !ruby/object:Gem::Dependency
258
276
  name: guard
259
277
  requirement: !ruby/object:Gem::Requirement
260
278
  requirements:
261
- - - '>='
279
+ - - ~>
262
280
  - !ruby/object:Gem::Version
263
- version: '0'
281
+ version: '2.11'
264
282
  type: :development
265
283
  prerelease: false
266
284
  version_requirements: !ruby/object:Gem::Requirement
267
285
  requirements:
268
- - - '>='
286
+ - - ~>
269
287
  - !ruby/object:Gem::Version
270
- version: '0'
288
+ version: '2.11'
271
289
  - !ruby/object:Gem::Dependency
272
290
  name: guard-rspec
273
291
  requirement: !ruby/object:Gem::Requirement
274
292
  requirements:
275
- - - '>='
293
+ - - ~>
276
294
  - !ruby/object:Gem::Version
277
- version: '0'
295
+ version: '4.5'
278
296
  type: :development
279
297
  prerelease: false
280
298
  version_requirements: !ruby/object:Gem::Requirement
281
299
  requirements:
282
- - - '>='
300
+ - - ~>
283
301
  - !ruby/object:Gem::Version
284
- version: '0'
302
+ version: '4.5'
285
303
  - !ruby/object:Gem::Dependency
286
304
  name: terminal-notifier-guard
287
305
  requirement: !ruby/object:Gem::Requirement
288
306
  requirements:
289
307
  - - ~>
308
+ - !ruby/object:Gem::Version
309
+ version: '1.6'
310
+ - - '>='
290
311
  - !ruby/object:Gem::Version
291
312
  version: 1.6.1
292
313
  type: :development
@@ -294,55 +315,61 @@ dependencies:
294
315
  version_requirements: !ruby/object:Gem::Requirement
295
316
  requirements:
296
317
  - - ~>
318
+ - !ruby/object:Gem::Version
319
+ version: '1.6'
320
+ - - '>='
297
321
  - !ruby/object:Gem::Version
298
322
  version: 1.6.1
299
323
  - !ruby/object:Gem::Dependency
300
324
  name: pry
301
325
  requirement: !ruby/object:Gem::Requirement
302
326
  requirements:
303
- - - '>='
327
+ - - ~>
304
328
  - !ruby/object:Gem::Version
305
- version: '0'
329
+ version: '0.10'
306
330
  type: :development
307
331
  prerelease: false
308
332
  version_requirements: !ruby/object:Gem::Requirement
309
333
  requirements:
310
- - - '>='
334
+ - - ~>
311
335
  - !ruby/object:Gem::Version
312
- version: '0'
336
+ version: '0.10'
313
337
  - !ruby/object:Gem::Dependency
314
338
  name: pry-remote
315
339
  requirement: !ruby/object:Gem::Requirement
316
340
  requirements:
317
- - - '>='
341
+ - - ~>
318
342
  - !ruby/object:Gem::Version
319
- version: '0'
343
+ version: '0.1'
320
344
  type: :development
321
345
  prerelease: false
322
346
  version_requirements: !ruby/object:Gem::Requirement
323
347
  requirements:
324
- - - '>='
348
+ - - ~>
325
349
  - !ruby/object:Gem::Version
326
- version: '0'
350
+ version: '0.1'
327
351
  - !ruby/object:Gem::Dependency
328
352
  name: pry-nav
329
353
  requirement: !ruby/object:Gem::Requirement
330
354
  requirements:
331
- - - '>='
355
+ - - ~>
332
356
  - !ruby/object:Gem::Version
333
- version: '0'
357
+ version: '0.2'
334
358
  type: :development
335
359
  prerelease: false
336
360
  version_requirements: !ruby/object:Gem::Requirement
337
361
  requirements:
338
- - - '>='
362
+ - - ~>
339
363
  - !ruby/object:Gem::Version
340
- version: '0'
364
+ version: '0.2'
341
365
  - !ruby/object:Gem::Dependency
342
366
  name: pdf-reader
343
367
  requirement: !ruby/object:Gem::Requirement
344
368
  requirements:
345
369
  - - ~>
370
+ - !ruby/object:Gem::Version
371
+ version: '1.3'
372
+ - - '>='
346
373
  - !ruby/object:Gem::Version
347
374
  version: 1.3.3
348
375
  type: :development
@@ -351,54 +378,46 @@ dependencies:
351
378
  requirements:
352
379
  - - ~>
353
380
  - !ruby/object:Gem::Version
354
- version: 1.3.3
355
- - !ruby/object:Gem::Dependency
356
- name: capybara
357
- requirement: !ruby/object:Gem::Requirement
358
- requirements:
359
- - - '>='
360
- - !ruby/object:Gem::Version
361
- version: '0'
362
- type: :development
363
- prerelease: false
364
- version_requirements: !ruby/object:Gem::Requirement
365
- requirements:
381
+ version: '1.3'
366
382
  - - '>='
367
383
  - !ruby/object:Gem::Version
368
- version: '0'
384
+ version: 1.3.3
369
385
  - !ruby/object:Gem::Dependency
370
386
  name: watir-webdriver
371
387
  requirement: !ruby/object:Gem::Requirement
372
388
  requirements:
373
- - - '>='
389
+ - - ~>
374
390
  - !ruby/object:Gem::Version
375
- version: '0'
391
+ version: '0.7'
376
392
  type: :development
377
393
  prerelease: false
378
394
  version_requirements: !ruby/object:Gem::Requirement
379
395
  requirements:
380
- - - '>='
396
+ - - ~>
381
397
  - !ruby/object:Gem::Version
382
- version: '0'
398
+ version: '0.7'
383
399
  - !ruby/object:Gem::Dependency
384
400
  name: jbuilder
385
401
  requirement: !ruby/object:Gem::Requirement
386
402
  requirements:
387
403
  - - ~>
388
404
  - !ruby/object:Gem::Version
389
- version: 2.2.0
405
+ version: '2.2'
390
406
  type: :development
391
407
  prerelease: false
392
408
  version_requirements: !ruby/object:Gem::Requirement
393
409
  requirements:
394
410
  - - ~>
395
411
  - !ruby/object:Gem::Version
396
- version: 2.2.0
412
+ version: '2.2'
397
413
  - !ruby/object:Gem::Dependency
398
414
  name: fakefs
399
415
  requirement: !ruby/object:Gem::Requirement
400
416
  requirements:
401
417
  - - ~>
418
+ - !ruby/object:Gem::Version
419
+ version: '0.6'
420
+ - - '>='
402
421
  - !ruby/object:Gem::Version
403
422
  version: 0.6.7
404
423
  type: :development
@@ -406,9 +425,15 @@ dependencies:
406
425
  version_requirements: !ruby/object:Gem::Requirement
407
426
  requirements:
408
427
  - - ~>
428
+ - !ruby/object:Gem::Version
429
+ version: '0.6'
430
+ - - '>='
409
431
  - !ruby/object:Gem::Version
410
432
  version: 0.6.7
411
- description:
433
+ description: "\n Crabfarm lets you build web scrappers using TDD, it is also very
434
+ opinionated about\n the way a scrapper should be structured. Scrappers created
435
+ by crabfarm can be hosted\n and monitored in the Crabfarm grid infrastructure.\n
436
+ \ "
412
437
  email:
413
438
  - ignacio@platan.us
414
439
  executables:
@@ -416,6 +441,14 @@ executables:
416
441
  extensions: []
417
442
  extra_rdoc_files: []
418
443
  files:
444
+ - assets/live-tools/instructions.html
445
+ - assets/live-tools/selectorgadget_combined.css
446
+ - assets/live-tools/selectorgadget_combined.js
447
+ - assets/live-tools/tools.css
448
+ - assets/live-tools/tools.js
449
+ - assets/live-tools/welcome.html
450
+ - bin/crabfarm
451
+ - lib/crabfarm.rb
419
452
  - lib/crabfarm/adapters/browser/abstract_webdriver.rb
420
453
  - lib/crabfarm/adapters/browser/base.rb
421
454
  - lib/crabfarm/adapters/browser/chrome.rb
@@ -475,25 +508,25 @@ files:
475
508
  - lib/crabfarm/modes/server.rb
476
509
  - lib/crabfarm/modes/shared/interactive_decorator.rb
477
510
  - lib/crabfarm/modes/shared/snapshot_decorator.rb
511
+ - lib/crabfarm/rspec.rb
478
512
  - lib/crabfarm/rspec/navigator_spec_helpers.rb
479
513
  - lib/crabfarm/rspec/reducer_spec_helpers.rb
480
514
  - lib/crabfarm/rspec/reducer_spy.rb
481
515
  - lib/crabfarm/rspec/reducer_spy_manager.rb
482
- - lib/crabfarm/rspec.rb
483
516
  - lib/crabfarm/state_store.rb
484
517
  - lib/crabfarm/strategies.rb
485
518
  - lib/crabfarm/support/custom_puma.rb
486
519
  - lib/crabfarm/support/gli.rb
487
520
  - lib/crabfarm/support/phantom_runner.rb
488
521
  - lib/crabfarm/support/webdriver_factory.rb
522
+ - lib/crabfarm/templates/Crabfile.erb
523
+ - lib/crabfarm/templates/Gemfile.erb
489
524
  - lib/crabfarm/templates/boot.rb.erb
490
525
  - lib/crabfarm/templates/crabfarm_bin.erb
491
- - lib/crabfarm/templates/Crabfile.erb
492
526
  - lib/crabfarm/templates/dot_crabfarm.erb
493
527
  - lib/crabfarm/templates/dot_gitignore.erb
494
528
  - lib/crabfarm/templates/dot_gitkeep.erb
495
529
  - lib/crabfarm/templates/dot_rspec.erb
496
- - lib/crabfarm/templates/Gemfile.erb
497
530
  - lib/crabfarm/templates/navigator.rb.erb
498
531
  - lib/crabfarm/templates/navigator_spec.rb.erb
499
532
  - lib/crabfarm/templates/reducer.rb.erb
@@ -507,16 +540,9 @@ files:
507
540
  - lib/crabfarm/utils/processes.rb
508
541
  - lib/crabfarm/utils/resolve.rb
509
542
  - lib/crabfarm/utils/rspec_runner.rb
543
+ - lib/crabfarm/utils/stream_dumper.rb
510
544
  - lib/crabfarm/utils/webdriver.rb
511
545
  - lib/crabfarm/version.rb
512
- - lib/crabfarm.rb
513
- - bin/crabfarm
514
- - assets/live-tools/instructions.html
515
- - assets/live-tools/selectorgadget_combined.css
516
- - assets/live-tools/selectorgadget_combined.js
517
- - assets/live-tools/tools.css
518
- - assets/live-tools/tools.js
519
- - assets/live-tools/welcome.html
520
546
  homepage: https://github.com/platanus/crabfarm-gem
521
547
  licenses:
522
548
  - MIT
@@ -537,9 +563,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
537
563
  version: '0'
538
564
  requirements: []
539
565
  rubyforge_project:
540
- rubygems_version: 2.0.14
566
+ rubygems_version: 2.4.8
541
567
  signing_key:
542
568
  specification_version: 4
543
- summary: Crabfarm crawler creation framework
569
+ summary: Crabfarm is a TDD oriented web scrapping framework
544
570
  test_files: []
545
571
  has_rdoc: