-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dive-into-hydra docs for 7.0.0 release
- Loading branch information
Showing
15 changed files
with
276 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,70 @@ | ||
This lesson is known to work with hydra (gem) version 6.1.0, 6.2.0. | ||
_Please update this wiki to reflect any other versions that have been tested._ | ||
|
||
# Goals | ||
* Add the Hydra software to your application's list of dependencies | ||
* Use bundler to install dependencies | ||
* Add Hydra (Hydra, Blacklight, and Devise) functionality to your Rails Application | ||
|
||
# Explanation | ||
|
||
In order to take advantage of the Hydra code and features in your application, you need to tell the application where to find that code and which versions of that code to use. Rails uses a tool called [bundler](http://bundler.io/) to track dependencies. Bundler looks in the file called `Gemfile` to know what you want installed. | ||
|
||
Hydra builds on and extends the features provided by Blacklight, the hydra generator integrates core hydra and blacklight functionality into your application. To do this, we run the custom [Rails generator](http://guides.rubyonrails.org/generators.html) provided by the hydra gem. The generator creates a number of files in your application that will allow you to build a Hydra application and use and modify Blacklight's features in your application. The default generator also installs [devise](https://github.com/plataformatec/devise) to provide simple user authentication and management. | ||
|
||
# Steps | ||
|
||
Open up ```Gemfile``` in your editor. We're going to add the following lines: | ||
### Step 1: Add the *hydra* gem to your Gemfile | ||
|
||
Open up `Gemfile` in your editor. We're going to add the following lines after the `source` line: | ||
|
||
```ruby | ||
gem 'hydra' | ||
``` | ||
|
||
This declares our application to have a dependency on the hydra6 release version of the hydra-gem and ensures that the hydra-head gem gets included (required) correctly. This includes a dependency for the jettywrapper gem (installed automatically). The jettywrapper gem is used to install and configure a preconfigured instance of jetty that loads and runs local development instances of Fedora and Solr for you to run and test your application against. | ||
This includes the hydra-gem in our application. Bundler will then ensure that the hydra-head, blacklight, active-fedora and other gems required by hydra get included (required) correctly. This includes a dependency for the jettywrapper gem (installed automatically). The jettywrapper gem is used to install and configure a preconfigured instance of jetty that loads and runs local development instances of Fedora and Solr for you to run and test your application against. | ||
|
||
Now save the change and install the dependencies by running bundler: | ||
```text | ||
bundle install | ||
``` | ||
|
||
Check which files have been changed: | ||
```text | ||
git status | ||
``` | ||
|
||
You should see changes to your `Gemfile` and `Gemfile.lock`. Now, go ahead and commit the modified files to your local git repo: | ||
```text | ||
git add . | ||
git commit -m "Add hydra dependency to Gemfile" | ||
``` | ||
|
||
### Step 2: Run the code generator provided by the *hydra* gem. | ||
|
||
> | ||
**Tip:** If you want to see clearly what changes that the generator makes, make sure that all of your current changes have been checked into git before running the generator. I.E. make sure that `git status` reports that there are no changes ("nothing to commit"). Then, after you run the generator, you can list all of the newly created and modified field by running `git status`. | ||
> | ||
Run the hydra generator | ||
|
||
```text | ||
rails generate hydra:install | ||
``` | ||
|
||
The hydra generator invokes both the blacklight generator and the hydra-head generator. Additionally, the blacklight generator installed the devise gem and the bootstrap gem. It's created an important file in our application `app/controllers/catalog_controller.rb`. This is the primary place where you configure the blacklight search. | ||
|
||
When they are done, the generators have created a few database migrations that support saving user data, searches and bookmarks. Normally you would have to run `rake db:migrate` to update your database tables, but the hydra installer does this for you as one of its last steps. | ||
|
||
### Step 3: Review and commit your changes | ||
|
||
See what the hydra generator has done | ||
```text | ||
git status | ||
``` | ||
|
||
After you've viewed which files have been modified, commit the changes: | ||
|
||
Now we save the file and install the dependencies by running bundler: | ||
```text | ||
$ bundle install | ||
git add . | ||
git commit -m "Ran hydra generator" | ||
``` | ||
|
||
# Next Step | ||
Go on to [[Lesson: Run the Hydra generator]] or return to the [[Dive into Hydra]] page. | ||
Go on to [[Lesson: Install hydra-jetty]] or return to the [[Dive into Hydra]] page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.