fedora_generator 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Manifest.txt +6 -0
- data/README.txt +47 -0
- data/fedora_generator.rb +21 -0
- data/lib/fedora_generator.rb +6 -0
- data/templates/fedinit.erb +13 -0
- metadata +91 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
= FedoraGenerator
|
2
|
+
|
3
|
+
* http://www.bitbucket.org/mediashelf/fedora_generator
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
A simple generator to automatically configure a Rails application to use ActiveFedora
|
8
|
+
|
9
|
+
|
10
|
+
== SYNOPSIS:
|
11
|
+
|
12
|
+
Basically, this generator creates an initializer which defines
|
13
|
+
some ActiveFedora required constants and reopens the
|
14
|
+
ApplicationController definition to include some filters to
|
15
|
+
configure Fedora on each request
|
16
|
+
|
17
|
+
== REQUIREMENTS:
|
18
|
+
|
19
|
+
* ActiveFedora >= 1.0.1
|
20
|
+
== INSTALL:
|
21
|
+
|
22
|
+
gem install fedora-generator
|
23
|
+
|
24
|
+
== LICENSE:
|
25
|
+
|
26
|
+
(The MIT License)
|
27
|
+
|
28
|
+
Copyright (c) 2009 Mediashelf LLC
|
29
|
+
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
31
|
+
a copy of this software and associated documentation files (the
|
32
|
+
'Software'), to deal in the Software without restriction, including
|
33
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
34
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
35
|
+
permit persons to whom the Software is furnished to do so, subject to
|
36
|
+
the following conditions:
|
37
|
+
|
38
|
+
The above copyright notice and this permission notice shall be
|
39
|
+
included in all copies or substantial portions of the Software.
|
40
|
+
|
41
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
42
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
43
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
44
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
45
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
46
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
47
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/fedora_generator.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
class FedoraGenerator < Rails::Generator::Base
|
2
|
+
attr_accessor :fields
|
3
|
+
def manifest
|
4
|
+
record do |m|
|
5
|
+
m.template "fedinit.erb", "config/initializers/fedora.rb"
|
6
|
+
puts <<-EOS
|
7
|
+
An initializer was created which modifies your ApplicationController. You might
|
8
|
+
want to inspect it if strange things start happening.
|
9
|
+
EOS
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
def banner
|
15
|
+
<<-EOS
|
16
|
+
Configures your Rails application to use ActiveFedora
|
17
|
+
|
18
|
+
USAGE: #{$0}
|
19
|
+
EOS
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
FEDORA_URL='http://fedoraAdmin:fedoraAdmin@localhost:8080/fedora'
|
2
|
+
SOLR_URL='http://fedoraAdmin:fedoraAdmin@localhost:8080/solr'
|
3
|
+
|
4
|
+
class ActionController::Base
|
5
|
+
before_filter :configure_fedora
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def configure_fedora
|
10
|
+
Fedora::Repository.register(FEDORA_URL)
|
11
|
+
ActiveFedora::SolrService.register(SOLR_URL)
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fedora_generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- MediaShelf LLC
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-02-26 00:00:00 -06:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: ruby-fedora
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.0.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: active-fedora
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.1
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: hoe
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.8.0
|
44
|
+
version:
|
45
|
+
description: A simple generator to automatically configure a Rails application to use ActiveFedora
|
46
|
+
email:
|
47
|
+
- matt.zumwalt@yourmediashelf.com
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- History.txt
|
54
|
+
- Manifest.txt
|
55
|
+
- README.txt
|
56
|
+
files:
|
57
|
+
- History.txt
|
58
|
+
- Manifest.txt
|
59
|
+
- README.txt
|
60
|
+
- fedora_generator.rb
|
61
|
+
- lib/fedora_generator.rb
|
62
|
+
- templates/fedinit.erb
|
63
|
+
has_rdoc: true
|
64
|
+
homepage: http://www.bitbucket.org/mediashelf/fedora_generator
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options:
|
67
|
+
- --main
|
68
|
+
- README.txt
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
requirements: []
|
84
|
+
|
85
|
+
rubyforge_project: rubyfedora
|
86
|
+
rubygems_version: 1.3.1
|
87
|
+
signing_key:
|
88
|
+
specification_version: 2
|
89
|
+
summary: A simple generator to automatically configure a Rails application to use ActiveFedora
|
90
|
+
test_files: []
|
91
|
+
|