Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crawlberg.cr

Crystal bindings for crawlberg, generated by alef. The native libcrawlberg_ffi is downloaded from the crawlberg GitHub release (Go-style download_ffi), since Crystal has no registry for prebuilt native shards.

Install

dependencies:
  crawlberg:
    github: dsisnero/crawlberg.cr
shards install
./scripts/download_ffi.sh   # fetches libcrawlberg_ffi.so/.dylib/.dll for your platform

Usage

Link against the staged native library and require the shard:

crystal build --link-flags="-L.lib -Wl,-rpath,$(pwd)/.lib" src/app.cr
require "crawlberg"

engine = Crawlberg.create_engine(Crawlberg::CrawlConfig.from_json("{\"max_concurrent\":2}"))

Test

make spec   # = download_ffi + crystal spec

The FFI library is cached in .lib/ (gitignored). Set CRAWLBERG_FFI_VERSION / CRAWLBERG_FFI_REPO to override the release source.

About

Crystal shard for crawlberg — FFI bindings via alef

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages