Cran
Installation
Checkout the repository:
git co https://github.com/nakedmoon/cran
and do
bundle
Or install it yourself as:
$ gem install cran
Usage
cran_indexer (or bundle exec bin/cran_indexer from the project directory)
Commands:
cran_indexer help [COMMAND] # Describe available commands or one specific command
cran_indexer info -U, --url=URL # Get Package Info
cran_indexer list # List Indexed Files
cran_indexer reset # Reset Indexed Files
cran_indexer start # Start Cran Indexer
Indexer
cran_indexer help start (or bundle exec bin/cran_indexer from the project directory)
Usage:
cran_indexer start
Options:
-U, [--url=URL] # Repository URL
# Default: http://cran.r-project.org/src/contrib/
-E, [--raise-error], [--no-raise-error] # Skip invalid files without raise an error
-L, [--limit=N] # Limit results items
# Default: 100
-P, [--processes=N] # Number of parallel processes during indexing
# Default: 4
Note
- Indexer index new files on each launch
- You can run it periodically at fixed times, dates, or intervals:
- Put the command in your crontab
- Use background service (DelayedJob, Sidekick, Resque) and instantiate the Repository class
- Use of PStore as Key/Value storage (the closest filesystem structure)
- You can easily create a new adapter (for example for Redis) extending the Cran::Adapter
- Default logs in the log directory
- Use semantic versioning (use semver CL to increase major/minor/patch)
- It use parallel gem to parallelize the index process (speed up blocking operations like downloads)
- Fully customizable log severity/adapters with Yell (you can change the severity updating the file cran.yaml)
Test
rake spec (from the project directory)
TODO
- Check for process running writing a pid file
- Move db file and logs in a system folder