Curate is a Rails engine leveraging ProjectHydra and ProjectBlacklight components to deliver a foundation for an Institutional Repositories. It is released under the Apache 2 License
- Starting a new Curate-based Rails application
- or install by hand
- Developing and contributing back to the Curate gem
- Prerequisites
- Clone the Curate repository
- Jetty
- Running the specs 1. All of them 1. Some of them 1. With Zeus
- Contributing back
When you generate your new Rails application, you can use Curate's application template:
$ rails new my_curate_application -m https://raw.github.com/ndlib/curate/master/lib/generators/curate/application_template.rb
Add the following line to your application's Gemfile:
gem 'curate'
And then execute:
$ bundle
$ rails generate curate
You may need to have the following installed ‡
- imagemagick
- fits.sh
- ffmpeg
- Redis
- rubygems
- ClamAV
‡ - Why "you may need"? Some of these are only optionally used in development and tests; But production will need it.
From the command line:
git clone https://github.com/projecthydra/curate.git ./path/to/local
Curate uses Jetty for development and testing. You could configure it to use an alternate Fedora and SOLR location, but that is an exercise for the reader.
Install jetty, you should only need to do this once (unless you remove the ./jetty directory)
$ rake jetty:unzip
Inside the Curate directory:
- Make sure jetty is running (
rake jetty:start
); It will take a bit to spin up jetty. - Make sure you have a dummy app ‡
- Run
rake regenerate
build the to get a clean app ./spec/dummy - Then run
rake spec
; The tests will take quite a while ‡‡
‡ - A Rails engine requires a Rails application to run.
The dummy app is an generated application inside Curate in the ./spec/internal
directory
‡‡ - Slow tests are a big problem and we are working on speeding them up, but its complicated.
In some cases you want to know the results of a single test. Here's how you do it.
- Make sure jetty is running (
rake jetty:start
); It will take a bit to spin up jetty. - Make sure you have a dummy app ‡
- Run
rake regenerate
build the to get a clean app ./spec/dummy - Then run
BUNDLE_GEMFILE=spec/internal/Gemfile bundle exec rspec path/to/spec.rb:LINE
‡
‡ - With Curate being an Engine we need to point to the Dummy Application's Gemfile.
In full Rails applications you can normally run the following rspec path/to/spec.rb:LINE
Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second. ‡
- In terminal window #1 run
zeus start
- In terminal window #2, once Zeus is started: run
zeus rake spec
for all tests; orzeus test path/to/spec.rb:LINE
for one
‡ - Loading the environment to run your tests takes less than a second. So running an individual test will take less time.
There is an existing CONTRIBUTING.md document which is currently under review. For now, follow those guidelines.