diff --git a/lib/paneron/register/register.rb b/lib/paneron/register/register.rb index 5863227..da9e273 100644 --- a/lib/paneron/register/register.rb +++ b/lib/paneron/register/register.rb @@ -4,7 +4,7 @@ module Paneron module Register class Register attr_reader :register_path, :register_root_path, :register_yaml_path, - :register_name + :register_name def initialize(register_root_path, register_name) register_path = File.join(register_root_path, register_name) @@ -13,7 +13,7 @@ def initialize(register_root_path, register_name) @register_root_path = register_root_path @register_path = register_path @register_yaml_path = File.join(register_path, - REGISTER_METADATA_FILENAME) + REGISTER_METADATA_FILENAME) @item_classes = {} @item_class_names = nil @item_uuids = nil @@ -24,17 +24,17 @@ def initialize(register_root_path, register_name) def self.validate_register_path(register_path) unless File.exist?(register_path) raise Paneron::Register::Error, - "Register path does not exist" + "Register path does not exist" end unless File.directory?(register_path) raise Paneron::Register::Error, - "Register path is not a directory" + "Register path is not a directory" end unless File.exist?(File.join( - register_path, REGISTER_METADATA_FILENAME - )) + register_path, REGISTER_METADATA_FILENAME + )) raise Paneron::Register::Error, - "Register metadata file does not exist" + "Register metadata file does not exist" end end @@ -46,16 +46,16 @@ def item_classes(item_class_name = nil) end else @item_classes[item_class_name] ||= - Paneron::Register::ItemClass.new( - register_root_path, register_name, item_class_name - ) + Paneron::Register::ItemClass.new( + register_root_path, register_name, item_class_name + ) end end def item_class_names @item_class_names ||= - Dir.glob(File.join(register_path, "*/*.yaml")) - .map { |file| File.basename(File.dirname(file)) }.uniq + Dir.glob(File.join(register_path, "*/*.yaml")) + .map { |file| File.basename(File.dirname(file)) }.uniq end def item_uuids diff --git a/lib/paneron/register/register_root.rb b/lib/paneron/register/register_root.rb index 397eb17..110cddd 100644 --- a/lib/paneron/register/register_root.rb +++ b/lib/paneron/register/register_root.rb @@ -9,7 +9,7 @@ def initialize(register_root_path) self.class.validate_root_path(register_root_path) @register_root_path = register_root_path @register_root_yaml_path = File.join(register_root_path, - REGISTER_ROOT_METADATA_FILENAME) + REGISTER_ROOT_METADATA_FILENAME) @register_names = nil @registries = {} end @@ -19,17 +19,17 @@ def initialize(register_root_path) def self.validate_root_path(register_root_path) unless File.exist?(register_root_path) raise Paneron::Register::Error, - "Register root path does not exist" + "Register root path does not exist" end unless File.directory?(register_root_path) raise Paneron::Register::Error, - "Register root path is not a directory" + "Register root path is not a directory" end unless File.exist?(File.join( - register_root_path, REGISTER_ROOT_METADATA_FILENAME - )) + register_root_path, REGISTER_ROOT_METADATA_FILENAME + )) raise Paneron::Register::Error, - "Register root metadata file does not exist" + "Register root metadata file does not exist" end end @@ -61,8 +61,8 @@ def registries(register_name = nil) end else @registries[register_name] ||= - Paneron::Register::Register.new(register_root_path, - register_name) + Paneron::Register::Register.new(register_root_path, + register_name) end end diff --git a/spec/item_class_spec.rb b/spec/item_class_spec.rb index 3a8c619..16c0662 100644 --- a/spec/item_class_spec.rb +++ b/spec/item_class_spec.rb @@ -1,7 +1,7 @@ RSpec.describe Paneron::Register::ItemClass do let(:item_class) do Paneron::Register::ItemClass.new("spec/fixtures/test-register", "reg-1", - "item-class-1") + "item-class-1") end it "lists out item UUIDs" do