Module: Valkyrie
- Defined in:
- lib/valkyrie/engine.rb,
lib/valkyrie.rb,
lib/valkyrie/id.rb,
lib/valkyrie/types.rb,
lib/valkyrie/storage.rb,
lib/valkyrie/version.rb,
lib/valkyrie/resource.rb,
lib/valkyrie/change_set.rb,
lib/valkyrie/persistence.rb,
lib/valkyrie/value_mapper.rb,
lib/valkyrie/storage_adapter.rb,
lib/valkyrie/metadata_adapter.rb,
lib/valkyrie/adapter_container.rb,
lib/valkyrie/specs/shared_specs.rb,
lib/valkyrie/resource/access_controls.rb
Overview
Defined Under Namespace
Modules: Indexers, Persistence, Specs, Storage, Types, Vocab
Classes: AdapterContainer, ChangeSet, Config, Engine, ID, MetadataAdapter, Resource, ResourceGenerator, StorageAdapter, ValueMapper
Constant Summary
collapse
- VERSION =
"2.0.0"
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
32
33
34
35
36
|
# File 'lib/valkyrie.rb', line 32
def config
@config ||= Config.new(
config_hash
)
end
|
.config_file ⇒ Object
38
39
40
41
|
# File 'lib/valkyrie.rb', line 38
def config_file
return unless File.exist?(config_root_path.join("config", "valkyrie.yml"))
File.read(config_root_path.join("config", "valkyrie.yml"))
end
|
.config_hash ⇒ Object
43
44
45
46
|
# File 'lib/valkyrie.rb', line 43
def config_hash
return {} unless config_file
YAML.safe_load(ERB.new(config_file).result)[environment]
end
|
.config_root_path ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/valkyrie.rb', line 56
def config_root_path
if const_defined?(:Rails) && Rails.respond_to?(:root)
Rails.root
else
Pathname.new(Dir.pwd)
end
end
|
.environment ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/valkyrie.rb', line 48
def environment
if const_defined?(:Rails) && Rails.respond_to?(:env)
Rails.env
else
ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
end
end
|
.logger ⇒ Object
64
65
66
|
# File 'lib/valkyrie.rb', line 64
def logger
@logger ||= Logger.new(STDOUT)
end
|
.logger=(logger) ⇒ Object
68
69
70
|
# File 'lib/valkyrie.rb', line 68
def logger=(logger)
@logger = logger
end
|