Giter Club home page Giter Club logo

hydra_curate's Introduction

Curate Version Build Status Coverage Status

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 Application

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

Or Install By Hand

Add the following line to your application's Gemfile:

gem 'curate'

And then execute:

$ bundle
$ rails generate curate

Developing and Contributing for the Curate gem

Prerequisites

You may need to have the following installed ‡

‡ - Why "you may need"? Some of these are only optionally used in development and tests; But production will need it.

Clone the Curate repository

From the command line:

git clone https://github.com/projecthydra/curate.git ./path/to/local

Jetty

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

Install jetty, you should only need to do this once (unless you remove the ./jetty directory)

$ rake jetty:unzip

Running the Specs

Inside the Curate directory (i.e. ./path/to/local):

All of Them

  1. Make sure jetty is running (rake jetty:start); It will take a bit to spin up jetty.
  2. Make sure you have a dummy app ‡
  3. Run rake regenerate build the to get a clean app ./spec/dummy
  4. 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.

Some of Them

In some cases you want to know the results of a single test. Here's how you do it.

  1. Make sure jetty is running (rake jetty:start); It will take a bit to spin up jetty.
  2. Make sure you have a dummy app ‡
  3. Run rake regenerate build the to get a clean app ./spec/dummy
  4. 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

With Zeus

Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second. ‡

  1. In terminal window #1 run zeus start
  2. In terminal window #2, once Zeus is started: run zeus rake spec for all tests; or zeus 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.

Contributing Back

There is an existing CONTRIBUTING.md document which is currently under review.

Coding Guidelines

The Ruby Style Guide is an excellent resource for how to craft your Ruby code, in particular the Naming section.

Can I break these guidelines? Yes. But you may need to convince the person merging your changes.

Writing Your Code

We are going to do our best to follow Sandi Metz' Rules for Developers

Here are the rules:

  • Classes can be no longer than one hundred lines of code.
  • Methods can be no longer than five lines of code.
  • Pass no more than four parameters into a method. Hash options are parameters.
  • Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed).

Ruby File Structure

  • Use soft-tabs with a two space indent.
  • Never leave trailing whitespace (unless it is meaningful in the language)
  • End each file with a blank newline.
  • Please do your best to keep lines to 80 characters or fewer.

Source Control Guidelines

This is a placeholder for things to come

Processing JIRA issues with commit messages

First line is 50 characters or less

Description of work done; wrap at 72 characters.

HYDRASIR-123 #close Any comment to post to JIRA

Make sure your JIRA email matches your Git config email (~/.gitconfig)

Working on Curate while working on my Application

Assuming you are wanting to work on your Curate-based application and make modifications to the Curate gem, follow these instructions.

Replace the folliwing 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.

Standing up your Curate-based Rails application in Production

We are working on this and have more to come.

hydra_curate's People

Contributors

jeremyf avatar jcoyne avatar rbalekai avatar val99erie avatar danhorst avatar banurekha avatar flyingzumwalt avatar mstroming avatar dbrower avatar paclough avatar spr7b avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.