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
- Developing and contributing for the Curate gem
- Working on Curate while working on my Application
- Integration with CAS, LDAP, Shibboleth
- Standing up your Curate-based Rails application in Production
When you generate your new Rails application, you can use Curate's application template:
$ rails new my_curate_application -m https://raw.github.com/projecthydra-labs/curate/develop/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 (http://www.imagemagick.org/script/index.php)
- fits.sh (https://code.google.com/p/fits/wiki/installing)
- ffmpeg (optional, http://www.ffmpeg.org/)
- Redis (http://redis.io/)
- rubygems (http://rubygems.org/pages/download)
- ClamAV (http://www.clamav.net/)
‡ - 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. The hydra-jetty package should not be use for secure production installations
Install jetty, you should only need to do this once (unless you remove the ./jetty directory)
$ rake jetty:unzip
Inside the Curate directory (i.e. ./path/to/local
):
- 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
to build a clean app in ./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 a 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
to build a clean app in ./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 pre-loads 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.
If you are interested in helping us make Curate better, please take a look at our Contributing resources and guidelines.
Assuming you are wanting to work on your Curate-based application and make modifications to the Curate gem, follow these instructions.
Replace the following line in the Gemfile of your Curate-based application (see Starting a New Curate Based Application):
gem 'curate' ...
with
gem 'curate', path: './path/to/my/clone/of/curate'
More information about Gemfile management at Bundler.io
You can then do concurrent development on both your clone of the Curate gem and your Curate-based application.
NOTE: Any changes you make in the Curate gem will likely require you to restart your web-server.
For integration with CAS, refer: https://github.com/nbudin/devise_cas_authenticatable
For integration with LDAP, refer: https://github.com/cschiewek/devise_ldap_authenticatable
For integration with Shibboleth, refer: https://github.com/jgeorge300/devise_shibboleth_authenticatable
For integration with multiple authentication systems (and for twitter, facebook, etc.), consider using OmniAuth: https://github.com/intridea/omniauth
We are working on this and have more to come.
This software has been developed by and is brought to you by the Hydra community. Learn more at the Project Hydra website