Module: Crabfarm
- Defined in:
- lib/crabfarm.rb,
lib/crabfarm/cli.rb,
lib/crabfarm/rspec.rb,
lib/crabfarm/errors.rb,
lib/crabfarm/context.rb,
lib/crabfarm/version.rb,
lib/crabfarm/base_state.rb,
lib/crabfarm/dsl/surfer.rb,
lib/crabfarm/strategies.rb,
lib/crabfarm/base_parser.rb,
lib/crabfarm/http_client.rb,
lib/crabfarm/state_store.rb,
lib/crabfarm/support/gli.rb,
lib/crabfarm/forked_state.rb,
lib/crabfarm/global_state.rb,
lib/crabfarm/modes/server.rb,
lib/crabfarm/configuration.rb,
lib/crabfarm/driver_bucket.rb,
lib/crabfarm/modes/console.rb,
lib/crabfarm/modes/recorder.rb,
lib/crabfarm/phantom_runner.rb,
lib/crabfarm/context_factory.rb,
lib/crabfarm/crabtrap_runner.rb,
lib/crabfarm/modes/generator.rb,
lib/crabfarm/modes/publisher.rb,
lib/crabfarm/utils/processes.rb,
lib/crabfarm/crabtrap_context.rb,
lib/crabfarm/assertion/context.rb,
lib/crabfarm/assertion/parsers.rb,
lib/crabfarm/assertion/wrapper.rb,
lib/crabfarm/mocks/noop_driver.rb,
lib/crabfarm/driver_bucket_pool.rb,
lib/crabfarm/transition_service.rb,
lib/crabfarm/support/custom_puma.rb,
lib/crabfarm/adapters/output/hash.rb,
lib/crabfarm/utils/port_discovery.rb,
lib/crabfarm/assertion/validations.rb,
lib/crabfarm/default_driver_factory.rb,
lib/crabfarm/phantom_driver_factory.rb,
lib/crabfarm/adapters/browser/surfer.rb,
lib/crabfarm/adapters/output/ostruct.rb,
lib/crabfarm/dsl/surfer/surf_context.rb,
lib/crabfarm/adapters/output/jbuilder.rb,
lib/crabfarm/adapters/parser/nokogiri.rb,
lib/crabfarm/adapters/browser/capybara.rb,
lib/crabfarm/dsl/surfer/search_context.rb,
lib/crabfarm/adapters/parser/pdf_reader.rb,
lib/crabfarm/engines/sync_state_manager.rb,
lib/crabfarm/engines/async_state_manager.rb,
lib/crabfarm/adapters/browser/watir.rb
Defined Under Namespace
Modules: Assertion, ContextFactory, Dsl, Engines, GlobalState, Mocks, Modes, RSpec, Strategies, Support, Utils
Classes: ApiError, ArgumentError, AssertionError, BaseParser, BaseState, BinaryMissingError, CLI, CapybaraBrowserDsl, Configuration, ConfigurationError, Context, CrabtrapContext, CrabtrapRunner, CrawlerBaseError, CrawlerError, DefaultDriverFactory, DriverBucket, DriverBucketPool, Error, ForkedState, HashOutputBuilder, HttpClient, JbuilderOutputBuilder, NokogiriAdapter, OStructOutputBuilder, PdfReaderAdapter, PhantomDriverFactory, PhantomRunner, ResourceNotFoundError, StateStore, StillWorkingError, SurferBrowserDsl, TimeoutError, TransitionService, WatirBrowserDsl
Constant Summary
collapse
- VERSION =
"0.2.1"
- @@config =
Configuration.new
- @@logger =
nil
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
32
33
34
|
# File 'lib/crabfarm.rb', line 32
def self.config
@@config
end
|
.logger ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/crabfarm.rb', line 36
def self.logger
if @@logger.nil?
@@logger = Logger.new(@@config.log_path.nil? ? STDOUT : File.join(@@config.log_path, 'crawler.log'))
@@logger.level = Logger::INFO
end
@@logger
end
|
.read_crabfile(_path) ⇒ Object
44
45
46
|
# File 'lib/crabfarm.rb', line 44
def self.read_crabfile(_path)
@@config.instance_eval File.read _path
end
|