Module: Iqvoc

Defined in:
lib/iqvoc/version.rb,
lib/iqvoc.rb,
lib/maker.rb,
lib/iqvoc/ability.rb,
lib/iqvoc/rdf_helper.rb,
lib/iqvoc/versioning.rb,
lib/iqvoc/data_helper.rb,
lib/iqvoc/deep_cloning.rb,
lib/iqvoc/skos_importer.rb

Overview

Copyright 2011 innoQ Deutschland GmbH

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defined Under Namespace

Modules: Collection, Concept, DeepCloning, Label, Maker, Versioning Classes: Ability, InlineDataHelper, RdfHelper, SkosImporter

Constant Summary collapse

VERSION =
"3.4.0"

Class Method Summary collapse

Class Method Details

.ability_classObject



88
89
90
# File 'lib/iqvoc.rb', line 88

def self.ability_class
  ability_class_name.constantize
end

.change_note_classObject



76
77
78
# File 'lib/iqvoc.rb', line 76

def self.change_note_class
  change_note_class_name.constantize
end

.first_level_classesObject



84
85
86
# File 'lib/iqvoc.rb', line 84

def self.first_level_classes
  self.first_level_class_configuration_modules.map { |mod| mod.send(:base_class) }
end

.generate_secret_tokenObject



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/iqvoc.rb', line 92

def self.generate_secret_token
  require 'securerandom'

  template = Rails.root.join("config", "initializers", "secret_token.rb.template")
  raise "File not found: #{template}" unless File.exist?(template)

  file_name = "config/initializers/secret_token.rb"

  token = SecureRandom.hex(64)
  txt = File.read(template)
  txt.gsub!("S-E-C-R-E-T", token)

  File.open(file_name, "w") do |f|
    f.write txt
  end

  puts "Secret token configuration has been created in #{file_name}."
end

.searchable_classesObject



80
81
82
# File 'lib/iqvoc.rb', line 80

def self.searchable_classes
  searchable_class_names.map(&:constantize)
end