source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/config/initializers/devise.rb | Ruby | apache-2.0 | 197 | main | 472 | Devise.setup do |config|
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
require 'devise/orm/active_record'
config.case_insensitive_keys = [:email]
config.strip_whitespace_keys = [:email]
config.reconfirmable = true
config.expire_all_remember_me_on_sign_out = true
con... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/config/initializers/simple_form.rb | Ruby | apache-2.0 | 197 | main | 947 | # frozen_string_literal: true
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.wrappers :default, class: :input,
hint_class: :field_with_hint,
error_class: :field_with_errors do |b|
b.use :html5
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/config/initializers/hydra_config.rb | Ruby | apache-2.0 | 197 | main | 243 | # windows doesn't properly require hydra-head (from the gemfile), so we need to require it explicitly here:
require 'hydra/head' unless defined? Hydra
Hydra.configure do |config|
config.user_key_field = Devise.authentication_keys.first
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/config/initializers/hyrax.rb | Ruby | apache-2.0 | 197 | main | 3,819 | # frozen_string_literal: true
Hyrax.config do |config|
# Hyrax can integrate with Zotero's Arkivo service for automatic deposit
# of Zotero-managed research items.
# Defaults to false. See README for more info
config.arkivo_api = true
config.analytics = ActiveModel::Type::Boolean.new.cast(ENV.fetch('HYRAX_A... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/spec/views/generic_work_resources/_generic_work_resource.html.erb_spec.rb | Ruby | apache-2.0 | 197 | main | 282 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
RSpec.describe 'generic_work_resources/generic_work_resource.html.erb', type: :view do # rubocop:disable RSpec/EmptyExampleGroup
# add generic_work_resource view specs
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/spec/forms/collection_resource_form_spec.rb | Ruby | apache-2.0 | 197 | main | 361 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
require 'rails_helper'
require 'valkyrie/specs/shared_specs'
RSpec.describe CollectionResourceForm do
let(:change_set) { described_class.new(resource) }
let(:resource) { CollectionResource.new }
it_... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/spec/models/generic_work_resource_spec.rb | Ruby | apache-2.0 | 197 | main | 296 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
require 'rails_helper'
require 'hyrax/specs/shared_specs/hydra_works'
RSpec.describe GenericWorkResource do
subject(:work) { described_class.new }
it_behaves_like 'a Hyrax::Work'
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/spec/indexers/collection_resource_indexer_spec.rb | Ruby | apache-2.0 | 197 | main | 411 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
require 'rails_helper'
require 'hyrax/specs/shared_specs/indexers'
RSpec.describe CollectionResourceIndexer do
let(:indexer_class) { described_class }
let(:resource) { CollectionResource.new }
it... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/spec/indexers/generic_work_resource_indexer_spec.rb | Ruby | apache-2.0 | 197 | main | 358 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
require 'rails_helper'
require 'hyrax/specs/shared_specs/indexers'
RSpec.describe GenericWorkResourceIndexer do
let(:indexer_class) { described_class }
let(:resource) { GenericWorkResource.new }
it_behaves... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/forms/generic_work_resource_form.rb | Ruby | apache-2.0 | 197 | main | 839 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
#
# @see https://github.com/samvera/hyrax/wiki/Hyrax-Valkyrie-Usage-Guide#forms
# @see https://github.com/samvera/valkyrie/wiki/ChangeSets-and-Dirty-Tracking
class GenericWorkResourceForm < Hyrax::Forms::ResourceF... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/forms/admin_set_resource_form.rb | Ruby | apache-2.0 | 197 | main | 227 | # frozen_string_literal: true
class AdminSetResourceForm < Hyrax::Forms::AdministrativeSetForm
include Hyrax::FormFields(:basic_metadata) if Hyrax.config.admin_set_include_metadata?
check_if_flexible(AdminSetResource)
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/forms/hyrax/generic_work_form.rb | Ruby | apache-2.0 | 197 | main | 238 | # Generated via
# `rails generate hyrax:work GenericWork`
module Hyrax
# Generated form for GenericWork
class GenericWorkForm < Hyrax::Forms::WorkForm
self.model_class = ::GenericWork
self.terms += [:resource_type]
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/forms/hyrax/namespaced_works/nested_work_form.rb | Ruby | apache-2.0 | 197 | main | 302 | # Generated via
# `rails generate hyrax:work NamespacedWorks::NestedWork`
module Hyrax
# Generated form for NamespacedWorks::NestedWork
class NamespacedWorks::NestedWorkForm < Hyrax::Forms::WorkForm
self.model_class = ::NamespacedWorks::NestedWork
self.terms += [:resource_type]
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/controllers/catalog_controller.rb | Ruby | apache-2.0 | 197 | main | 13,140 | # frozen_string_literal: true
class CatalogController < ApplicationController
include Hydra::Catalog
include Hydra::Controller::ControllerBehavior
include Hyrax::FlexibleCatalogBehavior if Hyrax.config.flexible?
# This filter applies the hydra access controls
before_action :enforce_show_permissions, only: :s... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/controllers/application_controller.rb | Ruby | apache-2.0 | 197 | main | 500 | class ApplicationController < ActionController::Base
helper Openseadragon::OpenseadragonHelper
# Adds a few additional behaviors into the application controller
include Blacklight::Controller
include Hydra::Controller::ControllerBehavior
# Adds Hyrax behaviors into the application controller
include Hyrax:... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/controllers/hyrax/generic_work_resources_controller.rb | Ruby | apache-2.0 | 197 | main | 569 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
module Hyrax
# Generated controller for GenericWorkResource
class GenericWorkResourcesController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/controllers/hyrax/generic_works_controller.rb | Ruby | apache-2.0 | 197 | main | 638 | # Generated via
# `rails generate hyrax:work GenericWork`
module Hyrax
# Generated controller for GenericWork
class GenericWorksController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyrax::BreadcrumbsForWorks
if Hyrax.config.valk... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/controllers/hyrax/namespaced_works/nested_works_controller.rb | Ruby | apache-2.0 | 197 | main | 546 | # Generated via
# `rails generate hyrax:work NamespacedWorks::NestedWork`
module Hyrax
# Generated controller for NamespacedWorks::NestedWork
class NamespacedWorks::NestedWorksController < ApplicationController
# Adds Hyrax behaviors to the controller.
include Hyrax::WorksControllerBehavior
include Hyr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/indexers/generic_work_indexer.rb | Ruby | apache-2.0 | 197 | main | 615 | # Generated via
# `rails generate hyrax:work GenericWork`
class GenericWorkIndexer < Hyrax::WorkIndexer
# This indexes the default metadata. You can remove it if you want to
# provide your own metadata and indexing.
include Hyrax::IndexesBasicMetadata
# Fetch remote labels for based_near. You can remove this ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/indexers/generic_work_resource_indexer.rb | Ruby | apache-2.0 | 197 | main | 684 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
class GenericWorkResourceIndexer < Hyrax::ValkyrieWorkIndexer
if Hyrax.config.work_include_metadata?
include Hyrax::Indexer(:core_metadata)
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Inde... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/indexers/collection_resource_indexer.rb | Ruby | apache-2.0 | 197 | main | 316 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
class CollectionResourceIndexer < Hyrax::Indexers::PcdmCollectionIndexer
include Hyrax::Indexer(:basic_metadata) if Hyrax.config.collection_include_metadata?
check_if_flexible(CollectionResource)
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/indexers/namespaced_works/nested_work_indexer.rb | Ruby | apache-2.0 | 197 | main | 647 | # Generated via
# `rails generate hyrax:work NamespacedWorks::NestedWork`
class NamespacedWorks::NestedWorkIndexer < Hyrax::WorkIndexer
# This indexes the default metadata. You can remove it if you want to
# provide your own metadata and indexing.
include Hyrax::IndexesBasicMetadata
# Fetch remote labels for ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/collection.rb | Ruby | apache-2.0 | 197 | main | 287 | # frozen_string_literal: true
# Generated by hyrax:models
class Collection < ActiveFedora::Base
include ::Hyrax::CollectionBehavior
# You can replace these metadata if they're not suitable
include Hyrax::BasicMetadata
self.indexer = Hyrax::CollectionWithBasicMetadataIndexer
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/file_set.rb | Ruby | apache-2.0 | 197 | main | 250 | # frozen_string_literal: true
# Generated by hyrax:models:install
class FileSet < ActiveFedora::Base
include ::Hyrax::FileSetBehavior
end
Hyrax::ValkyrieLazyMigration.migrating(Hyrax::FileSet, from: ::FileSet) if Hyrax.config.valkyrie_transition? |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/solr_document.rb | Ruby | apache-2.0 | 197 | main | 1,050 | # frozen_string_literal: true
class SolrDocument
include Blacklight::Solr::Document
include Blacklight::Gallery::OpenseadragonSolrDocument
# Adds Hyrax behaviors to the SolrDocument.
include Hyrax::SolrDocumentBehavior
# self.unique_key = 'id'
# Email uses the semantic field mappings below to generate t... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/generic_work_resource.rb | Ruby | apache-2.0 | 197 | main | 437 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:work_resource GenericWorkResource`
class GenericWorkResource < Hyrax::Work
if Hyrax.config.work_include_metadata?
include Hyrax::Schema(:core_metadata)
include Hyrax::Schema(:basic_metadata)
include Hyrax::Schema(:generic_work_resourc... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/collection_resource.rb | Ruby | apache-2.0 | 197 | main | 2,013 | # frozen_string_literal: true
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
class CollectionResource < Hyrax::PcdmCollection
# @note Do not directly update `basic_metadata.yaml`. It is also used by works.
#
# To change metadata for collections
# * extend by adding fields to ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/ability.rb | Ruby | apache-2.0 | 197 | main | 749 | class Ability
include Hydra::Ability
include Hyrax::Ability
self.ability_logic += [:everyone_can_create_curation_concerns]
# Define any customized permissions here.
def custom_permissions
# Limits deleting objects to a the admin user
#
# if current_user.admin?
# can [:destroy], ActiveFed... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/admin_set_resource.rb | Ruby | apache-2.0 | 197 | main | 293 | # frozen_string_literal: true
class AdminSetResource < Hyrax::AdministrativeSet
include Hyrax::ArResource
include Hyrax::Permissions::Readable
Hyrax::ValkyrieLazyMigration.migrating(self, from: ::AdminSet) if Hyrax.config.valkyrie_transition?
# include WithPermissionTemplateShim
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/generic_work.rb | Ruby | apache-2.0 | 197 | main | 500 | # Generated via
# `rails generate hyrax:work GenericWork`
class GenericWork < ActiveFedora::Base
include ::Hyrax::WorkBehavior
self.indexer = GenericWorkIndexer
# Change this to restrict which works can be added as a child.
# self.valid_child_concerns = []
validates :title, presence: { message: 'Your work m... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/time_span.rb | Ruby | apache-2.0 | 197 | main | 550 | class TimeSpan < ActiveTriples::Resource
def initialize(uri = RDF::Node.new, _parent = ActiveTriples::Resource.new)
uri = if uri.try(:node?)
RDF::URI("#timespan_#{uri.to_s.gsub('_:', '')}")
elsif uri.to_s.include?('#')
RDF::URI(uri)
end
super
end
def persisted?... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/app/models/namespaced_works/nested_work.rb | Ruby | apache-2.0 | 197 | main | 668 | # Generated via
# `rails generate hyrax:work NamespacedWorks::NestedWork`
class NamespacedWorks::NestedWork < ActiveFedora::Base
property :created, predicate: ::RDF::Vocab::DC.created, class_name: TimeSpan
include ::Hyrax::WorkBehavior
self.indexer = NamespacedWorks::NestedWorkIndexer
# Change this to restric... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/db/seeds.rb | Ruby | apache-2.0 | 197 | main | 3,790 | wipe_data = ActiveModel::Type::Boolean.new.cast(ENV.fetch('WIPE_DATA', false))
seed_release_testing = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SEED_RELEASE_TESTING', false))
seed_dassie = ActiveModel::Type::Boolean.new.cast(ENV.fetch('SEED_DASSIE', false))
unless wipe_data || seed_release_testing
puts 'NAME'
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/db/schema.rb | Ruby | apache-2.0 | 197 | main | 31,004 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/db/migrate/20230725222727_create_hyrax_counter_metrics.hyrax.rb | Ruby | apache-2.0 | 197 | main | 340 | class CreateHyraxCounterMetrics < ActiveRecord::Migration[5.2]
def change
create_table :hyrax_counter_metrics do |t|
t.string :worktype
t.string :resource_type
t.integer :work_id
t.date :date
t.integer :total_item_investigations
t.integer :total_item_requests
t.timestamp... |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/db/migrate/20230808102105_add_indices_to_hyrax_counter_metrics.hyrax.rb | Ruby | apache-2.0 | 197 | main | 284 | class AddIndicesToHyraxCounterMetrics < ActiveRecord::Migration[5.2]
def change
add_index :hyrax_counter_metrics, :worktype
add_index :hyrax_counter_metrics, :resource_type
add_index :hyrax_counter_metrics, :work_id
add_index :hyrax_counter_metrics, :date
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | .dassie/db/migrate/20230821153635_add_fields_to_counter_metric.rb | Ruby | apache-2.0 | 197 | main | 364 | class AddFieldsToCounterMetric < ActiveRecord::Migration[5.2]
def change
add_column :hyrax_counter_metrics, :title, :string
add_column :hyrax_counter_metrics, :year_of_publication, :integer, index: true
add_column :hyrax_counter_metrics, :publisher, :string, index: true
add_column :hyrax_counter_metri... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings.rb | Ruby | apache-2.0 | 197 | main | 4,464 | # frozen_string_literal: true
# Short circuit loading if Wings is disabled
return if Hyrax.config.disable_wings
##
# Wings is a toolkit integrating Valkyrie into Hyrax as a bridge away from the
# hard dependency on ActiveFedora.
#
# Requiring this module with `require 'wings'` injects a variety of behavior
# supporti... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/frigg.rb | Ruby | apache-2.0 | 197 | main | 285 | # frozen_string_literal: true
require 'wings'
require 'goddess/metadata'
require 'goddess/query'
require 'goddess/custom_query_container'
require 'frigg/metadata_adapter'
require 'frigg/custom_query_container'
require 'frigg/persister'
require 'frigg/query_service'
module Frigg
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/freyja.rb | Ruby | apache-2.0 | 197 | main | 324 | # frozen_string_literal: true
require 'wings'
require 'goddess/metadata'
require 'goddess/query'
require 'goddess/custom_query_container'
require 'freyja/metadata_adapter'
require 'freyja/custom_query_container'
require 'freyja/resource_factory'
require 'freyja/persister'
require 'freyja/query_service'
module Freyja
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/hyrax.rb | Ruby | apache-2.0 | 197 | main | 5,886 | # frozen_string_literal: true
require 'select2-rails'
require 'nest'
require 'redis-namespace'
require 'mailboxer'
require 'carrierwave'
require 'rails_autolink'
require 'font-awesome-rails'
require 'tinymce-rails'
require 'blacklight'
require 'blacklight/gallery'
require 'iiif_manifest'
require 'noid-rails'
require 'h... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/frigg/query_service.rb | Ruby | apache-2.0 | 197 | main | 379 | # frozen_string_literal: true
module Frigg
class QueryService
include Goddess::Query
##
# Constructs a Valkyrie::Persistence::CustomQueryContainer using this
# query service
#
# @return [Valkyrie::Persistence::CustomQueryContainer]
def custom_queries
@custom_queries ||= Frigg::Custo... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/frigg/persister.rb | Ruby | apache-2.0 | 197 | main | 1,557 | # frozen_string_literal: true
module Frigg
# Persister for Postgres MetadataAdapter.
class Persister < Valkyrie::Persistence::Fedora::Persister
# Persists a resource within the database
#
# Modified from the upstream to skip previously persisted check
#
# @param [Valkyrie::Resource] resource
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/frigg/metadata_adapter.rb | Ruby | apache-2.0 | 197 | main | 559 | # frozen_string_literal: true
require_relative 'persister'
require_relative 'query_service'
module Frigg
class MetadataAdapter
include Goddess::Metadata
def persister
@persister ||= Frigg::Persister.new(adapter: self)
end
# @return [Class] +Valkyrie::Persistence::Postgres::QueryService+
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/valkyrie/indexing_adapter.rb | Ruby | apache-2.0 | 197 | main | 1,117 | # frozen_string_literal: true
module Valkyrie
# IndexingAdapter is the primary DataMapper object for indexing.
# Used to register and locate adapters, for individual
# indexing backends (such as solr, elasticsearch, etc)
class IndexingAdapter
class_attribute :adapters
self.adapters = {}
class << s... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/valkyrie/indexing/null_indexing_adapter.rb | Ruby | apache-2.0 | 197 | main | 811 | # frozen_string_literal: true
module Valkyrie
module Indexing
# A Valkyrie indexer that does nothing for all index requests. This is
# useful for applications using alternate/legacy (e.g. ActiveFedora)
# indexing strategies that don't want the overhead of running separate
# index requests.
#
#... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/valkyrie/indexing/solr/indexing_adapter.rb | Ruby | apache-2.0 | 197 | main | 3,307 | # frozen_string_literal: true
require 'rsolr'
module Valkyrie
module Indexing
module Solr
class IndexingAdapter
COMMIT_PARAMS = { softCommit: true }.freeze
##
# @!attribute [r] connection
# @return [RSolr::Client]
attr_accessor :connection
##
# @pa... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/valkyrie/indexing/redis_queue/indexing_adapter.rb | Ruby | apache-2.0 | 197 | main | 5,190 | # frozen_string_literal: true
module Valkyrie
module Indexing
module RedisQueue
class IndexingAdapter
##
# @!attribute [r] connection
# @return [RSolr::Client]
attr_writer :connection
attr_accessor :index_queue_name, :delete_queue_name, :index_error_name, :delete_er... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/goddess/query.rb | Ruby | apache-2.0 | 197 | main | 6,333 | # frozen_string_literal: true
module Goddess
module Query
##
# This module provides the mechanisms for the four different query strategies:
#
# - {#find_multiple}
# - {#find_single} :: find an instance and if none is found, raise an exception
# - {#count_multiple}
# - {#find_single_or_nil}... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/goddess/custom_query_container.rb | Ruby | apache-2.0 | 197 | main | 3,322 | # frozen_string_literal: true
module Goddess
class CustomQueryContainer < Valkyrie::Persistence::CustomQueryContainer
include Goddess::Query::MethodMissingMachinations
##
# @!group Class Attributes
#
# @!attribute :known_custom_queries_and_their_strategies [r|w]
# @return [Hash<Symbol,Symbol... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/goddess/metadata.rb | Ruby | apache-2.0 | 197 | main | 309 | # frozen_string_literal: true
module Goddess
module Metadata
# @return [Valkyrie::ID] Identifier for this metadata adapter.
def id
@id ||= begin
to_hash = "migrate_adapter"
::Valkyrie::ID.new(Digest::MD5.hexdigest(to_hash))
end
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/controlled_vocabularies.rake | Ruby | apache-2.0 | 197 | main | 325 | # frozen_string_literal: true
namespace :hyrax do
namespace :controlled_vocabularies do
desc "Load the lexvo vocabulary into the database"
task language: :environment do
require 'hyrax/controlled_vocabulary/importer/language'
Hyrax::ControlledVocabulary::Importer::Language.new.import
end
end... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/migrate.rake | Ruby | apache-2.0 | 197 | main | 2,576 | # frozen_string_literal: true
namespace :hyrax do
namespace :migrate do
desc 'Move all works to default AdminSet'
task move_all_works_to_admin_set: :environment do
require 'hyrax/move_all_works_to_admin_set'
MoveAllWorksToAdminSet.run(AdminSet.find(AdminSet::DEFAULT_ID))
end
desc 'Add the... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/hyrax_user.rake | Ruby | apache-2.0 | 197 | main | 687 | # frozen_string_literal: true
namespace :hyrax do
namespace :user do
desc "list user's email"
task "list_emails", [:file_name] => :environment do |_cmd, args|
file_name = args[:file_name]
file_name ||= "user_emails.txt"
users = User.all.map(&:email).reject(&:blank?)
f = File.new(file_n... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/m3_profile_cleanup.rake | Ruby | apache-2.0 | 197 | main | 1,723 | # frozen_string_literal: true
require 'yaml'
require 'pathname'
namespace :hyrax do
namespace :metadata do
desc "Clean up display_label attributes in M3 profile YAML file"
task :update_labels, [:profile_path] => :environment do |_task, args|
# Force i18n to load
I18n.t('blacklight.search.fields.... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/hyrax.rake | Ruby | apache-2.0 | 197 | main | 316 | # frozen_string_literal: true
namespace :hyrax do
desc 'Print a count of each object type'
task count: [:environment] do
Rails.application.eager_load!
puts "Number of objects in the repository:"
ActiveFedora::Base.descendants.each do |model|
puts " #{model}: #{model.count}"
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/collection_type_global_id.rake | Ruby | apache-2.0 | 197 | main | 977 | # frozen_string_literal: true
namespace :hyrax do
namespace :collections do
desc 'Update CollectionType global id references for Hyrax 3.0.0'
task update_collection_type_global_ids: :environment do
puts 'Updating collection -> collection type GlobalId references.'
count = 0
Hyrax.query_ser... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/embargo_lease.rake | Ruby | apache-2.0 | 197 | main | 1,026 | # frozen_string_literal: true
namespace :hyrax do
namespace :embargo do
desc 'Deactivate embargoes for which the lift date has past'
task deactivate_expired: :environment do
ids = Hyrax::EmbargoService.assets_with_expired_embargoes.map(&:id)
Hyrax.query_service.find_many_by_ids(ids: ids).each do... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/regenerate_derivatives.rake | Ruby | apache-2.0 | 197 | main | 331 | # frozen_string_literal: true
namespace :hyrax do
namespace :file_sets do
desc 'Regenerate derivatives for all FileSets in the repository'
task regenerate_derivatives: :environment do
FileSet.all.each do |fs|
fs.files.each { |fi| CreateDerivativesJob.perform_later(fs, fi.id) }
end
end... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/stats_tasks.rake | Ruby | apache-2.0 | 197 | main | 298 | # frozen_string_literal: true
namespace :hyrax do
namespace :stats do
desc "Cache work view, file view & file download stats for all users"
task user_stats: :environment do
importer = Hyrax::UserStatImporter.new(verbose: true, logging: true)
importer.import
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/universal_viewer.rake | Ruby | apache-2.0 | 197 | main | 870 | # frozen_string_literal: true
namespace :hyrax do
namespace :universal_viewer do
desc "Install Universal Viewer"
task install: :environment do
# Copy the files into place
hyrax_templates_path = File.join(Gem.loaded_specs['hyrax'].full_gem_path, 'lib', 'generators', 'hyrax', 'templates')
copy... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/install.rake | Ruby | apache-2.0 | 197 | main | 217 | # frozen_string_literal: true
namespace :hyrax do
namespace :install do
desc 'Copy migrations from Hyrax to application'
task migrations: :environment do
Hyrax::DatabaseMigrator.copy
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/default_collection_type.rake | Ruby | apache-2.0 | 197 | main | 790 | # frozen_string_literal: true
namespace :hyrax do
namespace :default_collection_types do
desc "Create Default Collection Types"
task create: :environment do
default = Hyrax::CollectionType.find_or_create_default_collection_type
admin_set = Hyrax::CollectionType.find_or_create_admin_set_type
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/workflow.rake | Ruby | apache-2.0 | 197 | main | 480 | # frozen_string_literal: true
namespace :hyrax do
namespace :workflow do
desc "Load workflow configuration into the database"
task load: :environment do
logger = Hyrax.logger || Logger.new(STDOUT, level: Logger::DEBUG)
Hyrax::Workflow::WorkflowImporter.load_workflows(logger: logger)
errors =... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/tasks/default_admin_set.rake | Ruby | apache-2.0 | 197 | main | 1,407 | # frozen_string_literal: true
namespace :hyrax do
namespace :default_admin_set do
desc "Create the Default Admin Set"
task create: :environment do
id = Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id
if Hyrax::PermissionTemplate.find_by(source_id: id.to_s)
puts "Successful... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/freyja/query_service.rb | Ruby | apache-2.0 | 197 | main | 477 | # frozen_string_literal: true
module Freyja
class QueryService
include Goddess::Query
def orm_class
services.first.orm_class
end
##
# Constructs a Valkyrie::Persistence::CustomQueryContainer using this
# query service
#
# @return [Valkyrie::Persistence::CustomQueryContainer]
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/freyja/resource_factory.rb | Ruby | apache-2.0 | 197 | main | 271 | # frozen_string_literal: true
module Freyja
# Provides access to generic methods for converting to/from
# {Valkyrie::Resource} and {Valkyrie::Persistence::Postgres::ORM::Resource}.
class ResourceFactory < Valkyrie::Persistence::Postgres::ResourceFactory
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/freyja/persister.rb | Ruby | apache-2.0 | 197 | main | 3,361 | # frozen_string_literal: true
module Freyja
# Persister for Postgres MetadataAdapter.
class Persister < Valkyrie::Persistence::Postgres::Persister
attr_reader :wings_service
def initialize(adapter:, wings_service:)
@wings_service = wings_service
super(adapter: adapter)
end
# Persists ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/freyja/metadata_adapter.rb | Ruby | apache-2.0 | 197 | main | 876 | # frozen_string_literal: true
require_relative 'persister'
require_relative 'query_service'
require_relative 'resource_factory'
module Freyja
class MetadataAdapter
include Goddess::Metadata
##
# @return [Freyja::Persister]
def persister
@persister ||= Freyja::Persister.new(adapter: self, wing... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/arkivo_api_generator.rb | Ruby | apache-2.0 | 197 | main | 1,105 | # frozen_string_literal: true
class Hyrax::ArkivoApiGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc """
This generator sets up Zotero/Arkivo API integration for your application:
"""
def banner
say_status("info", "ADDING ZOTERO/ARKIVO API INTEGRATION", ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/clamav_generator.rb | Ruby | apache-2.0 | 197 | main | 477 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::ClamavGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc '
This generator makes the following changes to your application:
1. Generates clamav initializer
'
def banner
say_status('info... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/health_check_generator.rb | Ruby | apache-2.0 | 197 | main | 324 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::HealthCheckGenerator < Rails::Generators::Base
desc """
Installs Hyrax's default health check endpoints at `/healthz`.
"""
source_root File.expand_path('../templates', __FILE__)
def add_to_gemfile
gem 'okcomputer', '~> 1.18'
end
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/install_generator.rb | Ruby | apache-2.0 | 197 | main | 8,092 | # frozen_string_literal: true
module Hyrax
class Install < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :model_name, type: :string, default: "user", desc: "Model name for User model (primarily passed to devise, but also used elsewhere)"
class_option :'skip-riii... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/riiif_generator.rb | Ruby | apache-2.0 | 197 | main | 1,908 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::RiiifGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc '
This generator makes the following changes to your application:
1. Adds riiif dependency to application Gemfile
2. Copies rii... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/listeners_generator.rb | Ruby | apache-2.0 | 197 | main | 522 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::ListenersGenerator < Rails::Generators::Base
desc """
This generator adds templates for Hyrax::Publisher listeners to your application
"""
source_root File.expand_path('../templates', __FILE__)
def inject_listener
copy_file 'a... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/sample_data_generator.rb | Ruby | apache-2.0 | 197 | main | 362 | # frozen_string_literal: true
require 'rails/generators'
module Hyrax
class SampleDataGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc 'This generator copies over a file that creates sample data via `rake db:seed`'
def copy_sample_data
copy_file 'db/s... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/config_generator.rb | Ruby | apache-2.0 | 197 | main | 1,945 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::ConfigGenerator < Rails::Generators::Base
desc """
This generator installs the hyrax configuration files into your application for:
* Hyrax initializers
* Citations
* SimpleForm
* controlled authorities
* Admin stats
* ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/assets_generator.rb | Ruby | apache-2.0 | 197 | main | 864 | # frozen_string_literal: true
require 'rails/generators'
class Hyrax::AssetsGenerator < Rails::Generators::Base
desc """
This generator installs the hyrax CSS assets into your application
"""
source_root File.expand_path('../templates', __FILE__)
def remove_blacklight_css
remove_file "app/assets... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/models_generator.rb | Ruby | apache-2.0 | 197 | main | 1,675 | # frozen_string_literal: true
class Hyrax::ModelsGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :model_name, type: :string, default: 'user'
desc 'This generator makes the following changes to your application:
1. Copies database migrations
2. Inject... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/collection_generator.rb | Ruby | apache-2.0 | 197 | main | 411 | # frozen_string_literal: true
require 'rails/generators'
module Hyrax
class CollectionGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc 'This generator makes the following changes to your application:
1. Creates a collection model.
'
def create_collectio... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/work/work_generator.rb | Ruby | apache-2.0 | 197 | main | 4,425 | # frozen_string_literal: true
require 'rails/generators'
require 'rails/generators/model_helpers'
class Hyrax::WorkGenerator < Rails::Generators::NamedBase
# ActiveSupport can interpret models as plural which causes
# counter-intuitive route paths. Pull in ModelHelpers from
# Rails which warns users about plural... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/collection_resource/collection_resource_generator.rb | Ruby | apache-2.0 | 197 | main | 4,563 | # frozen_string_literal: true
require 'rails/generators'
require 'rails/generators/model_helpers'
class Hyrax::CollectionResourceGenerator < Rails::Generators::NamedBase # rubocop:disable Metrics/ClassLength
# ActiveSupport can interpret models as plural which causes
# counter-intuitive route paths. Pull in ModelH... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/catalog_controller.rb | Ruby | apache-2.0 | 197 | main | 12,692 | # frozen_string_literal: true
class CatalogController < ApplicationController
include Hydra::Catalog
include Hydra::Controller::ControllerBehavior
# This filter applies the hydra access controls
before_action :enforce_show_permissions, only: :show
def self.uploaded_field
"system_create_dtsi"
end
de... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/db/seeds.rb | Ruby | apache-2.0 | 197 | main | 16,384 | # frozen_string_literal: true
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: ... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/arkivo_constraint.rb | Ruby | apache-2.0 | 197 | main | 359 | # frozen_string_literal: true
module Hyrax
class ArkivoConstraint
def self.matches?(_request)
# Add your own logic here to authorize trusted connections to
# the API e.g., if your installation of Arkivo runs on a host
# with the 10.0.0.3 IP address, you could use:
# request.remote_ip == '1... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/action_dispatch_http_upload_monkey_patch.rb | Ruby | apache-2.0 | 197 | main | 212 | # frozen_string_literal: true
module ActionDispatch
module Http
class UploadedFile
def closed?
@tempfile.closed?
end
def close
@tempfile.close
end
end
end
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/mime_types.rb | Ruby | apache-2.0 | 197 | main | 295 | # frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register 'application/x-endnote-refer', :endnote |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/initializers/riiif.rb | Ruby | apache-2.0 | 197 | main | 1,505 | # frozen_string_literal: true
Rails.application.reloader.to_prepare do
Riiif::Image.info_service = lambda do |id, _file|
# id will look like a path to a pcdm:file
# (e.g. rv042t299%2Ffiles%2F6d71677a-4f80-42f1-ae58-ed1063fd79c7)
# but we just want the id for the FileSet it's attached to.
fs_id = id.s... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/initializers/simple_form.rb | Ruby | apache-2.0 | 197 | main | 6,622 | # frozen_string_literal: true
# NOTE: This is a modified version of simple_form's default config file.
# The only changes were to move the input to after the hint and error.
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form bui... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/initializers/file_services.rb | Ruby | apache-2.0 | 197 | main | 231 | # frozen_string_literal: true
ActiveSupport::Reloader.to_prepare do
Hydra::Derivatives.config.output_file_service = Hyrax::ValkyriePersistDerivatives
Hydra::Derivatives.config.source_file_service = Hyrax::LocalFileService
end |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/initializers/1_valkyrie.rb | Ruby | apache-2.0 | 197 | main | 4,309 | # frozen_string_literal: true
require 'faraday/multipart'
# require "shrine/storage/s3"
# require "valkyrie/storage/shrine"
# require "valkyrie/shrine/checksum/s3"
# database = ENV.fetch("METADATA_DB_NAME", "nurax_pg_metadata")
# Rails.logger.info "Establishing connection to postgresql on: " \
# "#{... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/templates/config/initializers/hyrax.rb | Ruby | apache-2.0 | 197 | main | 14,177 | # frozen_string_literal: true
Hyrax.config do |config|
# Register roles that are expected by your implementation.
# @see Hyrax::RoleRegistry for additional details.
# @note there are magical roles as defined in Hyrax::RoleRegistry::MAGIC_ROLES
# config.register_roles do |registry|
# registry.add(name: 'capt... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/iiif_viewer/iiif_viewer_generator.rb | Ruby | apache-2.0 | 197 | main | 1,676 | # frozen_string_literal: true
module Hyrax
class IiifViewerGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :viewer, type: :string
def dest_root
@dest_root ||= Rails.env.test? ? File.join(Hyrax::Engine.root, "tmp") : Rails.root
end
def c... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/generators/hyrax/work_resource/work_resource_generator.rb | Ruby | apache-2.0 | 197 | main | 4,257 | # frozen_string_literal: true
require 'rails/generators'
require 'rails/generators/model_helpers'
class Hyrax::WorkResourceGenerator < Rails::Generators::NamedBase
# ActiveSupport can interpret models as plural which causes
# counter-intuitive route paths. Pull in ModelHelpers from
# Rails which warns users abou... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/model_transformer.rb | Ruby | apache-2.0 | 197 | main | 7,567 | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
module Wings
##
# Transforms ActiveFedora models or objects into Valkyrie::Resource models or
# objects
#
# @see https://github.com/samvera-labs/valkyrie/blob/master/lib/valkyrie/resource.rb
#
# Similar to an orm_converter class in other... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/active_fedora_converter.rb | Ruby | apache-2.0 | 197 | main | 8,173 | # frozen_string_literal: true
require 'wings/converter_value_mapper'
require 'wings/active_fedora_converter/default_work'
require 'wings/active_fedora_converter/file_metadata_node'
require 'wings/active_fedora_converter/instance_builder'
require 'wings/active_fedora_converter/nested_resource'
module Wings
##
# Co... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/orm_converter.rb | Ruby | apache-2.0 | 197 | main | 4,671 | # frozen_string_literal: true
module Wings
##
# @api private
#
# Transform AF object class to Valkyrie::Resource class representation.
class OrmConverter
##
# Selects an existing base class for the generated valkyrie class
#
# @return [Class]
def self.base_for(klass:)
mapped_class =... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/valkyrizable.rb | Ruby | apache-2.0 | 197 | main | 604 | # frozen_string_literal: true
module Wings
##
# A mixin for `ActiveFedora::Base` models providing a convenience method
# mapping to a valkyrie resource.
#
# @example
# GenericWork.include Wings::Valkyrizable
#
# work = GenericWork.new(title: ['Comet in Moominland'])
# resource = work.valkyr... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/active_fedora_classifier.rb | Ruby | apache-2.0 | 197 | main | 369 | # frozen_string_literal: true
module Wings
class ActiveFedoraClassifier < ActiveFedora::ModelClassifier
private
def classify(model_value)
if (match = model_value.match(/Wings\((.*)\)/))
valkyrie_class = match[1].constantize
Wings::ActiveFedoraConverter::DefaultWork(valkyrie_class)
... |
github | samvera/hyrax | https://github.com/samvera/hyrax | lib/wings/model_registry.rb | Ruby | apache-2.0 | 197 | main | 1,643 | # frozen_string_literal: true
module Wings
##
# This registry provides an off-ramp for legacy ActiveFedora models.
#
# New valkyrie models can be defined manually and registered as an analogue
# of an existing `ActiveFedora::Base` implementer. This allows Wings to cast
# the new model to the legacy model w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.