hydra-head 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/GIT_WORKFLOW.textile CHANGED
@@ -1,3 +1,25 @@
1
+ h1. Using a checkout from git as your hydra-head or active-fedora gem:
2
+
3
+ h2. Advanced usage: Running against the freshest version of the hydra-head code from Github
4
+
5
+ *We don't recommend this for new users or for production applications*, but it is very useful during active development.
6
+
7
+ If you are in a position where you want/need to run your application with the very latest hydra-head code from Github, this is easy to do. Simply update the line in your Gemfile that lists hydra-head as a dependency and enter this instead:
8
+
9
+ <pre>
10
+ gem "hydra-head", :git => "git://github.com/projecthydra/hydra-head.git"
11
+ </pre>
12
+
13
+ After updating the Gemfile, re-run 'bundle install'.
14
+
15
+ You can also do this with other gems. For example, if you want to force your app to use the latest active-fedora code from the "HYDRA-721" branch on GitHub, you can put this in your Gemfile:
16
+
17
+ <pre>
18
+ gem "active-fedora", :git=>'git://github.com/mediashelf/active_fedora.git'
19
+ </pre>
20
+
21
+
22
+
1
23
  h1. Git Workflow (with command line examples) for working on Hydra Projects
2
24
 
3
25
  h2. Reference Material/Reading:
data/HISTORY.textile CHANGED
@@ -1,3 +1,7 @@
1
+ h3. 3.2.1
2
+ * SubmissionWorkflow was not being required
3
+ * Removed JettyCleaner (broken and unused)
4
+
1
5
  h3. 3.2.0
2
6
  * Update to Blacklight 3.1.2
3
7
  * Update to ActiveFedora 3.2.0
data/README.textile CHANGED
@@ -16,32 +16,12 @@ This is a Ruby on Rails 3 gem.
16
16
 
17
17
  h2. Installation/Setup
18
18
 
19
- h3. Use RVM (for your own Sanity)
20
-
21
- This isn't absolutely required, but working without RVM makes life really difficult.
22
-
23
- See "https://rvm.beginrescueend.com/rvm/install/":https://rvm.beginrescueend.com/rvm/install/ for instructions on installing and running RVM.
24
-
25
- After installing RVM, set it up to use "rvmrc":http://beginrescueend.com/workflow/rvmrc/ files when they're available. This will cause RVM to automatically switch Ruby versions and gemsets when you cd into different code bases. Currently all Hydra software uses Ruby Enterprise Edition 1.8.7 (ree-1.8.7) and each component or Hydra Head uses its own gemsets (ie. hydra-head uses a gemset called hyhead, hypatia uses a gemset called hypatia so that you can install a different set of dependencies for each. )
26
-
27
- For information about using and setting up RVM to use .rvmrc files, see "http://beginrescueend.com/workflow/rvmrc/":http://beginrescueend.com/workflow/rvmrc/
28
-
29
- h3. Make sure you have the right version of Ruby
30
-
31
- Currently all Hydra software uses Ruby Enterprise Edition 1.8.7 (ree-1.8.7)
32
-
33
- If you are using RVM, you can install ree-1.8.7 with the following call:
34
-
35
- <pre>rvm install ree-1.8.7</pre>
36
-
37
- If you are not using RVM, consult the appropriate online documentation for installing Ruby on your operating system.
38
-
39
19
  h3. Install Rails, Bundler and Devise
40
20
 
41
21
  Currently hydra-head is compatible with Rails 3.0.x and incompatible with Rails 3.1
42
22
 
43
23
  <pre>
44
- gem install 'rails' --version '~>3.0.10'
24
+ gem install 'rails' --version '~>3.0.11'
45
25
  gem install 'bundler'
46
26
  </pre>
47
27
 
@@ -52,18 +32,6 @@ rails new my_hydra_head
52
32
  cd my_hydra_head
53
33
  </pre>
54
34
 
55
- h3. Init the git Repository
56
-
57
- First, put a .gitignore file into the root of your project to keep your repository clean. You could start with the ".gitignore file from the hydra-head gem":https://github.com/projecthydra/hydra-head/blob/master/.gitignore
58
-
59
- Now init the git repository and add the initial set of files
60
-
61
- <pre>
62
- git init
63
- git add .
64
- git commit -m"Initial Commit: empty rails app"
65
- </pre>
66
-
67
35
  h3. Install Dependencies
68
36
 
69
37
  First, add them to the "Gemfile":http://gembundler.com/gemfile.html of your application:
@@ -71,14 +39,14 @@ First, add them to the "Gemfile":http://gembundler.com/gemfile.html of your appl
71
39
  <pre>
72
40
  source 'http://rubygems.org'
73
41
 
74
- gem 'rails', '~>3.0.10'
42
+ gem 'rails', '~>3.0.11'
75
43
 
76
- gem 'blacklight', '~> 3.0.0'
77
- gem 'hydra-head', '~> 3.1.0'
44
+ gem 'blacklight', '~> 3.1.2'
45
+ gem 'hydra-head', '~> 3.2.0'
78
46
 
79
47
  # We will assume that you're using sqlite3 for testing/demo,
80
48
  # but in a production setup you probably want to use a real sql database like mysql or postgres
81
- gem 'sqlite3-ruby', :require => 'sqlite3'
49
+ gem 'sqlite3'
82
50
 
83
51
  # We will assume you're using devise in tutorials/documentation.
84
52
  # You are free to implement your own User/Authentication solution in its place.
@@ -111,29 +79,11 @@ Even if all of the dependencies are satisfied, this will take a _very_ long time
111
79
 
112
80
  <pre>
113
81
  gem install blacklight
114
- gem install hydra-head -v 3.1.4
82
+ gem install hydra-head -v 3.2.0
115
83
  </pre>
116
84
 
117
85
  Then re-run bundle install and it will run slightly faster.
118
86
 
119
- h3. Advanced usage: Running against the freshest version of the hydra-head code from Github
120
-
121
- *We don't recommend this for new users or for production applications*, but it is very useful during active development.
122
-
123
- If you are in a position where you want/need to run your application with the very latest hydra-head code from Github, this is easy to do. Simply update the line in your Gemfile that lists hydra-head as a dependency and enter this instead:
124
-
125
- <pre>
126
- gem "hydra-head", :git => "git://github.com/projecthydra/hydra-head.git", :branch=>'rails3'
127
- </pre>
128
-
129
- After updating the Gemfile, re-run 'bundle install'.
130
-
131
- You can also do this with other gems. For example, if you want to force your app to use the latest active-fedora code from the "HYDRA-721" branch on GitHub, you can put this in your Gemfile:
132
-
133
- <pre>
134
- gem "active-fedora", :git=>'git://github.com/mediashelf/active_fedora.git', :branch=>'HYDRA-721'
135
- </pre>
136
-
137
87
  h3. Run the generators and migrations:
138
88
 
139
89
  Run the blacklight generator
@@ -151,100 +101,11 @@ rake db:migrate
151
101
  rake db:test:prepare
152
102
  </pre>
153
103
 
154
- h3. Add all the generated code to the Git repository
155
-
156
- <pre>
157
- git add .
158
- git commit -m"Ran Blacklight, Hydra-Head, and Cucumber Generators"
159
- </pre>
160
-
161
104
  h3. You're done.
162
105
 
163
106
  Congratulations. You've set up the code for your Hydra Head.
164
107
 
165
- Read the next section on Tools for Developing and Testing, then read "How to Get Started":http://hudson.projecthydra.org/job/hydra-head-rails3-plugin/Documentation/file.HOW_TO_GET_STARTED.html to get a sense of what you can do with your Hydra Head.
166
-
167
- h2. Tools to Help You Develop and Test your Application
168
-
169
- h3. The Hydra Jetty
170
-
171
- The Hydra project provides a copy of Jetty with Fedora and Solr pre-installed. This is useful for running tests against and for running your code against while you're actively working on your hydra head.
172
-
173
- Most projects add hydra jetty to their code as a git submodule
174
-
175
- <pre>
176
- git submodule add git://github.com/projecthydra/hydra-jetty.git jetty
177
- git commit -m"added jetty submodule"
178
- </pre>
179
-
180
- Now that you've added the submodule to your git repository, whenever you grab a new working copy of the code, you can get hydra-jetty by running:
181
-
182
- <pre>
183
- git submodule init
184
- git submodule update
185
- </pre>
186
-
187
- *Important*: To apply the your application's solrconfig.xml and schema.xml to the copy of solr in hydra-jetty, run this:
188
-
189
- <pre>
190
- rake hydra:jetty:config
191
- </pre>
192
-
193
- Now you're ready to start jetty. We've written a useful gem that gives you rake tasks for starting and stopping jetty. Make sure you have jettywrapper in your Gemfile
194
-
195
- <pre>
196
- gem "jettywrapper"
197
- </pre>
198
-
199
- Then run <pre> bundle install <pre>
200
-
201
- Now that you have jettywrapper installed, to start jetty use
202
-
203
- <pre>
204
- rake jetty:start
205
- </pre>
206
-
207
- To stop jetty
208
-
209
- <pre>
210
- rake jetty:stop
211
- </pre>
212
-
213
- For more information about using jettywrapper, see http://hudson.projecthydra.org/job/jettywrapper/Documentation/
214
-
215
- h3. RSpec and Cucumber for Testing
216
-
217
- We STRONGLY recommend that you write tests for every local change you make. This will allow you to ensure that upgrading the core code doesn't break any local changes you have made.
218
-
219
- (when should it be a feature rather than a spec)
220
- very basic rule: if it's testing something created with view, use a cucumber feature to test. If it's not created by view code, use a spec to test.
221
-
222
- h4. RSpec for Functional Tests
223
-
224
- Most Ruby projects use either RSpec or Shoulda to write and run their Functional Tests. We use RSpec for all of the Hydra software.
225
-
226
- To set up all the files you need to use rspec to test your Rails application, simply run the rspec generator. This will create a directory called "spec" and put all of the necessary files into it.
227
-
228
- <pre>
229
- rails g rspec:install
230
- </pre>
231
-
232
- h4. Cucumber to Test User Experience
233
-
234
- If you will be writing cucumber tests, run the cucumber generator. This will create a directory called "features" and populate it with all the basic parts you need to run Cucumber tests on your Rails application.
235
-
236
- <pre>rails g cucumber:install</pre>
237
-
238
- h4. (optional) Move everything into the test_support Directory
239
-
240
- Within the blacklight and hydra-head code bases, we have started putting all of our test-related code into a directory called test_support. If you want to follow this convention, move the generated spec and features directories into test_support, so that you have:
241
-
242
- <pre>
243
- test_support/
244
- features/
245
- fixtures/
246
- spec/
247
- </pre>
108
+ Read "Tools for Developing and Testing":http://hudson.projecthydra.org/job/hydra-head-rails3-plugin/Documentation/file.Tools.html, then read "How to Get Started":http://hudson.projecthydra.org/job/hydra-head-rails3-plugin/Documentation/file.HOW_TO_GET_STARTED.html to get a sense of what you can do with your Hydra Head.
248
109
 
249
110
  h2. Modifying and Testing the hydra-head Gem
250
111
 
data/TESTING.textile CHANGED
@@ -4,7 +4,6 @@ h2. For the Impatient
4
4
 
5
5
  # clone the hydra-head code (to a fresh working copy) <pre>git clone git@github.com:projecthydra/hydra-head.git</pre>
6
6
  # switch tot he hydra-head directory <pre>cd hydra-head</pre>
7
- # checkout the rails3 branch <pre>git checkout rails3</pre>
8
7
  # install bundler gem <pre>gem install bundler</pre>
9
8
  # Get the project dependencies <pre>bundle install</pre>
10
9
  # grab the jetty submodule <pre>git submodule init; git submodule update</pre>
@@ -13,6 +12,7 @@ h2. For the Impatient
13
12
  ## spins up jetty (in jettywrapper)
14
13
  ## imports fixtures
15
14
  ## runs rspec & cucumber tests
15
+ ## kills jetty (in jettywrapper)
16
16
 
17
17
  h2. More Detailed Instructions & Notes
18
18
 
@@ -29,7 +29,7 @@ git submodule update
29
29
  To start the jetty:
30
30
 
31
31
  <pre>
32
- rake hydra:jetty:start
32
+ rake jetty:start
33
33
  </pre>
34
34
 
35
35
  Note: the first time you start the jetty, you must use the following command in order to properly configure the jetty:
@@ -22,7 +22,7 @@ See below to reset jetty when re-running tests, or when running a simultaneous d
22
22
 
23
23
  _Stop any copies of jetty (or anything else using port 8983) before running this command._
24
24
 
25
- You must do this at the root of the <b><i>hydra-head plugin</i> directory</b>, not within the hydra-plugin_test_host directory.
25
+ You must do this at the root of the <b><i>hydra-head plugin</i> directory</b>, not within the tmp/test_app_ directory.
26
26
 
27
27
  Note that java 1.6 must be invoked by the "java" command or Fedora won't work.
28
28
 
@@ -34,7 +34,7 @@ This will start up jetty on port 8983.
34
34
 
35
35
  h4. (2) Load test fixtures into Fedora/Solr.
36
36
 
37
- You must do this at the root of the <b><i>hydra-head plugin</i> directory</b>, not within the hydra-plugin_test_host directory.
37
+ You must do this at the root of the <b><i>hydra-head plugin</i> directory</b>, not within the tmp/test_app directory.
38
38
 
39
39
  NOTE: to ensure that the tests do not rely on non-test data, do this first:
40
40
 
@@ -57,9 +57,8 @@ h4. (3) Run specs.
57
57
  OR
58
58
 
59
59
  <pre>
60
- rake hyhead:remove_plugin_from_host
61
- rake hyhead:copy_plugin_to_host
62
- rake hyhead:rspec
60
+ rake hyhead:setup_test_app
61
+ rake hyhead:spec
63
62
  </pre>
64
63
 
65
64
 
@@ -87,7 +86,7 @@ To stop jetty:
87
86
  From the rails application directory (my-hydra-head-test-app)
88
87
 
89
88
  <pre>
90
- rake hydra:jetty:stop
89
+ rake jetty:stop
91
90
  </pre>
92
91
 
93
92
  Use ps to ensure the java process has stopped. If not, kill it manually.
@@ -97,7 +96,7 @@ h4. Clean out and reload the fixtures:
97
96
  1. Stop jetty
98
97
 
99
98
  <pre>
100
- rake hydra:jetty:stop
99
+ rake jetty:stop
101
100
  </pre>
102
101
 
103
102
  Use ps to ensure the java process has stopped. If not, kill it manually.
data/Tools.textile ADDED
@@ -0,0 +1,72 @@
1
+ h1. Tools to Help You Develop and Test your Application
2
+
3
+ h2. The Hydra Jetty
4
+
5
+ The Hydra project provides a copy of Jetty with Fedora and Solr pre-installed. This is useful for running tests against and for running your code against while you're actively working on your hydra head.
6
+
7
+ Most projects add hydra jetty to their code as a git submodule
8
+
9
+ <pre>
10
+ git submodule add git://github.com/projecthydra/hydra-jetty.git jetty
11
+ git commit -m"added jetty submodule"
12
+ </pre>
13
+
14
+ Now that you've added the submodule to your git repository, whenever you grab a new working copy of the code, you can get hydra-jetty by running:
15
+
16
+ <pre>
17
+ git submodule init
18
+ git submodule update
19
+ </pre>
20
+
21
+ *Important*: To apply the your application's solrconfig.xml and schema.xml to the copy of solr in hydra-jetty, run this:
22
+
23
+ <pre>
24
+ rake hydra:jetty:config
25
+ </pre>
26
+
27
+ Now you're ready to start jetty. We've written a useful gem that gives you rake tasks for starting and stopping jetty. Make sure you have jettywrapper in your Gemfile
28
+
29
+ <pre>
30
+ gem "jettywrapper"
31
+ </pre>
32
+
33
+ Then run <pre>bundle install<pre>
34
+
35
+ Now that you have jettywrapper installed, to start jetty use
36
+
37
+ <pre>
38
+ rake jetty:start
39
+ </pre>
40
+
41
+ To stop jetty
42
+
43
+ <pre>
44
+ rake jetty:stop
45
+ </pre>
46
+
47
+ For more information about using jettywrapper, see http://hudson.projecthydra.org/job/jettywrapper/Documentation/
48
+
49
+ h2. RSpec and Cucumber for Testing
50
+
51
+ We STRONGLY recommend that you write tests for every local change you make. This will allow you to ensure that upgrading the core code doesn't break any local changes you have made.
52
+
53
+ (when should it be a feature rather than a spec)
54
+ very basic rule: if it's testing something created with view, use a cucumber feature to test. If it's not created by view code, use a spec to test.
55
+
56
+ h4. RSpec for Functional Tests
57
+
58
+ Most Ruby projects use either RSpec or Shoulda to write and run their Functional Tests. We use RSpec for all of the Hydra software.
59
+
60
+ To set up all the files you need to use rspec to test your Rails application, simply run the rspec generator. This will create a directory called "spec" and put all of the necessary files into it.
61
+
62
+ <pre>
63
+ rails g rspec:install
64
+ </pre>
65
+
66
+ h4. Cucumber to Test User Experience
67
+
68
+ If you will be writing cucumber tests, run the cucumber generator. This will create a directory called "features" and populate it with all the basic parts you need to run Cucumber tests on your Rails application.
69
+
70
+ <pre>rails g cucumber:install</pre>
71
+
72
+
@@ -1,4 +1,4 @@
1
1
  module HydraHead
2
- VERSION = "3.2.0"
2
+ VERSION = "3.2.1"
3
3
  end
4
4
 
data/lib/hydra.rb CHANGED
@@ -16,6 +16,7 @@ module Hydra
16
16
  autoload :ModelMixins
17
17
  autoload :ModsGenericContent
18
18
  autoload :ModsImage
19
+ autoload :SubmissionWorkflow
19
20
  autoload :SuperuserAttributes
20
21
  autoload :User
21
22
  end
@@ -0,0 +1 @@
1
+ require "active-fedora" # This causes active-fedora's rake tasks to be loaded
@@ -0,0 +1 @@
1
+ require "active-fedora" # This causes active-fedora's rake tasks to be loaded
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-head
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 0
10
- version: 3.2.0
9
+ - 1
10
+ version: 3.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Zumwalt, Bess Sadler, Julie Meloni, Naomi Dushay, Jessie Keck, John Scofield, Justin Coyne & many more. See https://github.com/projecthydra/hydra-head/contributors
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-09 00:00:00 -06:00
18
+ date: 2012-01-18 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -718,6 +718,7 @@ files:
718
718
  - Rakefile
719
719
  - TESTING.textile
720
720
  - TESTING_PLUGIN.textile
721
+ - Tools.textile
721
722
  - app/controllers/assets_controller.rb
722
723
  - app/controllers/contributors_controller.rb
723
724
  - app/controllers/downloads_controller.rb
@@ -995,11 +996,11 @@ files:
995
996
  - lib/hydra/submission_workflow.rb
996
997
  - lib/hydra/superuser_attributes.rb
997
998
  - lib/hydra/user.rb
998
- - lib/jetty_cleaner.rb
999
999
  - lib/marc_mapper.rb
1000
1000
  - lib/marc_record_ext.rb
1001
1001
  - lib/mediashelf/active_fedora_helper.rb
1002
1002
  - lib/prev_next_links.rb
1003
+ - lib/railties/active-fedora.rake
1003
1004
  - lib/railties/all_tests.rake
1004
1005
  - lib/railties/hydra-fixtures.rake
1005
1006
  - lib/railties/hydra_jetty.rake
@@ -1013,6 +1014,7 @@ files:
1013
1014
  - solr_conf/conf/schema.xml
1014
1015
  - solr_conf/conf/solrconfig.xml
1015
1016
  - solr_conf/solr.xml
1017
+ - tasks/active-fedora.rake
1016
1018
  - tasks/hydra-head-fixtures.rake
1017
1019
  - tasks/hydra-head.rake
1018
1020
  - tasks/hydra_jetty.rake
data/lib/jetty_cleaner.rb DELETED
@@ -1,27 +0,0 @@
1
- class JettyCleaner
2
-
3
- def self.clean(namespace=nil)
4
- objects = Fedora::Repository.instance.find_objects(:limit=>1000000)
5
-
6
- objects.each do |obj|
7
- case obj
8
- when ActiveFedora::Base
9
- puts "deleting #{obj.pid}"
10
- when Fedora::FedoraObject
11
- puts "found FedoraObject #{obj.pid}"
12
- if namespace
13
- if obj.pid.match(/^#{namespace}:/)
14
- puts "deleting #{obj.pid} from namespace #{namespace}"
15
- ActiveFedora::Base.load_instance( obj.pid ).delete
16
- end
17
- else
18
- puts "deleting #{obj.pid}"
19
- ActiveFedora::Base.load_instance( obj.pid ).delete
20
- end
21
- else
22
- puts "#{obj.pid} is a #{obj.class}. Could not load and delete it."
23
- end
24
- end
25
- nil
26
- end
27
- end