crabfarm 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crabfarm/configuration.rb +6 -2
- data/lib/crabfarm/live/manager.rb +9 -2
- data/lib/crabfarm/templates/Crabfile.erb +7 -0
- data/lib/crabfarm/version.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89af60fe404e36fbc112ab5325ad3bbc618e25f1
|
4
|
+
data.tar.gz: 2930de41a6c3c9725533d1a9f84fc6d0b89b0ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31c2d828b6c7351f2efa1a7b79ba0762a21770b12f66560cc310a7ce1e0c91a574adfc1a3c8193937fed2d63a7f7d35d891c4b4c419e9b87a8e73d192c61d167
|
7
|
+
data.tar.gz: de65bef60361d0c7fa3365d8c1e05a82ed702bfbce0224c54f2ea5d94fd4a32d572e775d9321b388b0b46460fbba5c691a7c472f19ca213f45d64f1b4cf4f8ff
|
@@ -29,7 +29,10 @@ module Crabfarm
|
|
29
29
|
[:crabtrap_bin_path, :string, 'Crabtrap binary path.'],
|
30
30
|
|
31
31
|
# Recorder configuration
|
32
|
-
[:recorder_driver, :string, 'Recorder driver name, defaults to \'firefox\'']
|
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']
|
33
36
|
]
|
34
37
|
.map { |o| Option.new(*o) }
|
35
38
|
|
@@ -65,7 +68,8 @@ module Crabfarm
|
|
65
68
|
phantom_ssl: 'any',
|
66
69
|
phantom_bin_path: 'phantomjs',
|
67
70
|
crabtrap_bin_path: 'crabtrap',
|
68
|
-
recorder_driver: :firefox
|
71
|
+
recorder_driver: :firefox,
|
72
|
+
live_full_reload: false
|
69
73
|
}
|
70
74
|
end
|
71
75
|
|
@@ -22,6 +22,7 @@ module Crabfarm
|
|
22
22
|
def start
|
23
23
|
set_memento
|
24
24
|
load_primary_driver
|
25
|
+
primary_driver.get('https://www.crabtrap.io/welcome.html')
|
25
26
|
end
|
26
27
|
|
27
28
|
def stop
|
@@ -34,7 +35,14 @@ module Crabfarm
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def reset_driver_status
|
37
|
-
|
38
|
+
if Crabfarm.config.live_full_reload
|
39
|
+
# recreate driver if configured to do so
|
40
|
+
release_primary_driver
|
41
|
+
load_primary_driver
|
42
|
+
else
|
43
|
+
primary_driver.manage.delete_all_cookies
|
44
|
+
end
|
45
|
+
|
38
46
|
primary_driver.get('https://www.crabtrap.io/instructions.html')
|
39
47
|
end
|
40
48
|
|
@@ -122,7 +130,6 @@ module Crabfarm
|
|
122
130
|
|
123
131
|
def load_primary_driver
|
124
132
|
@driver = build_driver
|
125
|
-
@driver.get('https://www.crabtrap.io/welcome.html')
|
126
133
|
end
|
127
134
|
|
128
135
|
def release_primary_driver
|
@@ -70,3 +70,10 @@ set_webdriver_dsl :watir
|
|
70
70
|
|
71
71
|
# Change the browser used for the recording command, available options are 'firefox' or 'chrome'
|
72
72
|
# 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
|
data/lib/crabfarm/version.rb
CHANGED
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.5.
|
4
|
+
version: 0.5.3
|
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-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -402,14 +402,6 @@ executables:
|
|
402
402
|
extensions: []
|
403
403
|
extra_rdoc_files: []
|
404
404
|
files:
|
405
|
-
- assets/live-tools/instructions.html
|
406
|
-
- assets/live-tools/selectorgadget_combined.css
|
407
|
-
- assets/live-tools/selectorgadget_combined.js
|
408
|
-
- assets/live-tools/tools.css
|
409
|
-
- assets/live-tools/tools.js
|
410
|
-
- assets/live-tools/welcome.html
|
411
|
-
- bin/crabfarm
|
412
|
-
- lib/crabfarm.rb
|
413
405
|
- lib/crabfarm/adapters/browser/abstract_webdriver.rb
|
414
406
|
- lib/crabfarm/adapters/browser/chrome.rb
|
415
407
|
- lib/crabfarm/adapters/browser/firefox.rb
|
@@ -436,9 +428,9 @@ files:
|
|
436
428
|
- lib/crabfarm/crabtrap_context.rb
|
437
429
|
- lib/crabfarm/crabtrap_runner.rb
|
438
430
|
- lib/crabfarm/driver_pool.rb
|
439
|
-
- lib/crabfarm/dsl/surfer.rb
|
440
431
|
- lib/crabfarm/dsl/surfer/search_context.rb
|
441
432
|
- lib/crabfarm/dsl/surfer/surf_context.rb
|
433
|
+
- lib/crabfarm/dsl/surfer.rb
|
442
434
|
- lib/crabfarm/engines/async_state_manager.rb
|
443
435
|
- lib/crabfarm/engines/sync_state_manager.rb
|
444
436
|
- lib/crabfarm/errors.rb
|
@@ -469,25 +461,25 @@ files:
|
|
469
461
|
- lib/crabfarm/modes/server.rb
|
470
462
|
- lib/crabfarm/modes/shared/interactive_decorator.rb
|
471
463
|
- lib/crabfarm/modes/shared/snapshot_decorator.rb
|
472
|
-
- lib/crabfarm/rspec.rb
|
473
464
|
- lib/crabfarm/rspec/navigator_spec_helpers.rb
|
474
465
|
- lib/crabfarm/rspec/reducer_spec_helpers.rb
|
475
466
|
- lib/crabfarm/rspec/reducer_spy.rb
|
476
467
|
- lib/crabfarm/rspec/reducer_spy_manager.rb
|
468
|
+
- lib/crabfarm/rspec.rb
|
477
469
|
- lib/crabfarm/state_store.rb
|
478
470
|
- lib/crabfarm/strategies.rb
|
479
471
|
- lib/crabfarm/support/custom_puma.rb
|
480
472
|
- lib/crabfarm/support/gli.rb
|
481
473
|
- lib/crabfarm/support/phantom_runner.rb
|
482
474
|
- lib/crabfarm/support/webdriver_factory.rb
|
483
|
-
- lib/crabfarm/templates/Crabfile.erb
|
484
|
-
- lib/crabfarm/templates/Gemfile.erb
|
485
475
|
- lib/crabfarm/templates/boot.rb.erb
|
486
476
|
- lib/crabfarm/templates/crabfarm_bin.erb
|
477
|
+
- lib/crabfarm/templates/Crabfile.erb
|
487
478
|
- lib/crabfarm/templates/dot_crabfarm.erb
|
488
479
|
- lib/crabfarm/templates/dot_gitignore.erb
|
489
480
|
- lib/crabfarm/templates/dot_gitkeep.erb
|
490
481
|
- lib/crabfarm/templates/dot_rspec.erb
|
482
|
+
- lib/crabfarm/templates/Gemfile.erb
|
491
483
|
- lib/crabfarm/templates/navigator.rb.erb
|
492
484
|
- lib/crabfarm/templates/navigator_spec.rb.erb
|
493
485
|
- lib/crabfarm/templates/reducer.rb.erb
|
@@ -503,6 +495,14 @@ files:
|
|
503
495
|
- lib/crabfarm/utils/rspec_runner.rb
|
504
496
|
- lib/crabfarm/utils/webdriver.rb
|
505
497
|
- lib/crabfarm/version.rb
|
498
|
+
- lib/crabfarm.rb
|
499
|
+
- bin/crabfarm
|
500
|
+
- assets/live-tools/instructions.html
|
501
|
+
- assets/live-tools/selectorgadget_combined.css
|
502
|
+
- assets/live-tools/selectorgadget_combined.js
|
503
|
+
- assets/live-tools/tools.css
|
504
|
+
- assets/live-tools/tools.js
|
505
|
+
- assets/live-tools/welcome.html
|
506
506
|
homepage: https://github.com/platanus/crabfarm-gem
|
507
507
|
licenses:
|
508
508
|
- MIT
|
@@ -523,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
523
523
|
version: '0'
|
524
524
|
requirements: []
|
525
525
|
rubyforge_project:
|
526
|
-
rubygems_version: 2.
|
526
|
+
rubygems_version: 2.0.14
|
527
527
|
signing_key:
|
528
528
|
specification_version: 4
|
529
529
|
summary: Crabfarm crawler creation framework
|