From 237ac40b64d14a80acd71eb74fc6df1eba83a163 Mon Sep 17 00:00:00 2001 From: Antonio Tapiador del Dujo Date: Thu, 28 Nov 2024 13:32:45 +0100 Subject: [PATCH] Rename public/ folder Follow the standard Ruby structure of lib/gem_name This also helps us to understand the difference between resource_registry and schema_registry at first sight --- lib/resource_registry.rb | 20 +++++++++---------- .../capabilities/capability_config.rb | 0 .../capability_factory.rb | 0 .../configuration.rb | 0 .../entity_finder.rb | 0 .../load_resources_from_cache.rb | 0 lib/{public => resource_registry}/registry.rb | 0 .../relationship.rb | 0 .../relationship_type.rb | 0 .../relationship_type_factory.rb | 0 .../relationship_types/belongs_to.rb | 0 .../relationship_types/has_many.rb | 0 .../relationship_types/has_many_through.rb | 0 .../relationship_types/has_one.rb | 0 .../repositories/base.rb | 0 lib/{public => resource_registry}/resource.rb | 0 .../resource_struct_builder.rb | 0 .../serializer.rb | 0 lib/{public => resource_registry}/verb.rb | 0 lib/{public => resource_registry}/versions.rb | 0 .../versions/version.rb | 0 lib/schema_registry/property.rb | 2 +- resource_registry.gemspec | 2 +- spec/capability_factory_spec.rb | 2 +- spec/dummy_repo.rb | 2 +- .../registry_spec.rb | 2 +- .../relationship_spec.rb | 2 +- .../resource_spec.rb | 2 +- .../versions_spec.rb | 2 +- spec/resource_struct_builder_spec.rb | 2 +- 30 files changed, 19 insertions(+), 19 deletions(-) rename lib/{public => resource_registry}/capabilities/capability_config.rb (100%) rename lib/{public => resource_registry}/capability_factory.rb (100%) rename lib/{public => resource_registry}/configuration.rb (100%) rename lib/{public => resource_registry}/entity_finder.rb (100%) rename lib/{public => resource_registry}/load_resources_from_cache.rb (100%) rename lib/{public => resource_registry}/registry.rb (100%) rename lib/{public => resource_registry}/relationship.rb (100%) rename lib/{public => resource_registry}/relationship_type.rb (100%) rename lib/{public => resource_registry}/relationship_type_factory.rb (100%) rename lib/{public => resource_registry}/relationship_types/belongs_to.rb (100%) rename lib/{public => resource_registry}/relationship_types/has_many.rb (100%) rename lib/{public => resource_registry}/relationship_types/has_many_through.rb (100%) rename lib/{public => resource_registry}/relationship_types/has_one.rb (100%) rename lib/{public => resource_registry}/repositories/base.rb (100%) rename lib/{public => resource_registry}/resource.rb (100%) rename lib/{public => resource_registry}/resource_struct_builder.rb (100%) rename lib/{public => resource_registry}/serializer.rb (100%) rename lib/{public => resource_registry}/verb.rb (100%) rename lib/{public => resource_registry}/versions.rb (100%) rename lib/{public => resource_registry}/versions/version.rb (100%) rename spec/{public => resource_registry}/registry_spec.rb (97%) rename spec/{public => resource_registry}/relationship_spec.rb (93%) rename spec/{public => resource_registry}/resource_spec.rb (98%) rename spec/{public => resource_registry}/versions_spec.rb (98%) diff --git a/lib/resource_registry.rb b/lib/resource_registry.rb index be3426c..154f1b5 100644 --- a/lib/resource_registry.rb +++ b/lib/resource_registry.rb @@ -3,18 +3,18 @@ require "sorbet-runtime" -require "public/configuration" -require "public/resource" -require "public/versions" -require "public/versions/version" -require "public/entity_finder" -require "public/resource_struct_builder" -require "public/registry" -require "public/serializer" -require "public/repositories/base" -require "schema_registry/registry" +require "resource_registry/configuration" +require "resource_registry/resource" +require "resource_registry/versions" +require "resource_registry/versions/version" +require "resource_registry/entity_finder" +require "resource_registry/resource_struct_builder" +require "resource_registry/registry" +require "resource_registry/serializer" +require "resource_registry/repositories/base" require "schema_registry/json_schema_mapper" require "schema_registry/maybe" +require "schema_registry/generate_from_struct" require "runtime_generic" # Entry point for ResourceRegistry diff --git a/lib/public/capabilities/capability_config.rb b/lib/resource_registry/capabilities/capability_config.rb similarity index 100% rename from lib/public/capabilities/capability_config.rb rename to lib/resource_registry/capabilities/capability_config.rb diff --git a/lib/public/capability_factory.rb b/lib/resource_registry/capability_factory.rb similarity index 100% rename from lib/public/capability_factory.rb rename to lib/resource_registry/capability_factory.rb diff --git a/lib/public/configuration.rb b/lib/resource_registry/configuration.rb similarity index 100% rename from lib/public/configuration.rb rename to lib/resource_registry/configuration.rb diff --git a/lib/public/entity_finder.rb b/lib/resource_registry/entity_finder.rb similarity index 100% rename from lib/public/entity_finder.rb rename to lib/resource_registry/entity_finder.rb diff --git a/lib/public/load_resources_from_cache.rb b/lib/resource_registry/load_resources_from_cache.rb similarity index 100% rename from lib/public/load_resources_from_cache.rb rename to lib/resource_registry/load_resources_from_cache.rb diff --git a/lib/public/registry.rb b/lib/resource_registry/registry.rb similarity index 100% rename from lib/public/registry.rb rename to lib/resource_registry/registry.rb diff --git a/lib/public/relationship.rb b/lib/resource_registry/relationship.rb similarity index 100% rename from lib/public/relationship.rb rename to lib/resource_registry/relationship.rb diff --git a/lib/public/relationship_type.rb b/lib/resource_registry/relationship_type.rb similarity index 100% rename from lib/public/relationship_type.rb rename to lib/resource_registry/relationship_type.rb diff --git a/lib/public/relationship_type_factory.rb b/lib/resource_registry/relationship_type_factory.rb similarity index 100% rename from lib/public/relationship_type_factory.rb rename to lib/resource_registry/relationship_type_factory.rb diff --git a/lib/public/relationship_types/belongs_to.rb b/lib/resource_registry/relationship_types/belongs_to.rb similarity index 100% rename from lib/public/relationship_types/belongs_to.rb rename to lib/resource_registry/relationship_types/belongs_to.rb diff --git a/lib/public/relationship_types/has_many.rb b/lib/resource_registry/relationship_types/has_many.rb similarity index 100% rename from lib/public/relationship_types/has_many.rb rename to lib/resource_registry/relationship_types/has_many.rb diff --git a/lib/public/relationship_types/has_many_through.rb b/lib/resource_registry/relationship_types/has_many_through.rb similarity index 100% rename from lib/public/relationship_types/has_many_through.rb rename to lib/resource_registry/relationship_types/has_many_through.rb diff --git a/lib/public/relationship_types/has_one.rb b/lib/resource_registry/relationship_types/has_one.rb similarity index 100% rename from lib/public/relationship_types/has_one.rb rename to lib/resource_registry/relationship_types/has_one.rb diff --git a/lib/public/repositories/base.rb b/lib/resource_registry/repositories/base.rb similarity index 100% rename from lib/public/repositories/base.rb rename to lib/resource_registry/repositories/base.rb diff --git a/lib/public/resource.rb b/lib/resource_registry/resource.rb similarity index 100% rename from lib/public/resource.rb rename to lib/resource_registry/resource.rb diff --git a/lib/public/resource_struct_builder.rb b/lib/resource_registry/resource_struct_builder.rb similarity index 100% rename from lib/public/resource_struct_builder.rb rename to lib/resource_registry/resource_struct_builder.rb diff --git a/lib/public/serializer.rb b/lib/resource_registry/serializer.rb similarity index 100% rename from lib/public/serializer.rb rename to lib/resource_registry/serializer.rb diff --git a/lib/public/verb.rb b/lib/resource_registry/verb.rb similarity index 100% rename from lib/public/verb.rb rename to lib/resource_registry/verb.rb diff --git a/lib/public/versions.rb b/lib/resource_registry/versions.rb similarity index 100% rename from lib/public/versions.rb rename to lib/resource_registry/versions.rb diff --git a/lib/public/versions/version.rb b/lib/resource_registry/versions/version.rb similarity index 100% rename from lib/public/versions/version.rb rename to lib/resource_registry/versions/version.rb diff --git a/lib/schema_registry/property.rb b/lib/schema_registry/property.rb index 777b2d9..8c8fde0 100644 --- a/lib/schema_registry/property.rb +++ b/lib/schema_registry/property.rb @@ -5,7 +5,7 @@ require "bigdecimal" require_relative "property_type" require_relative "maybe" -require_relative "../public/versions/version" +require_relative "../resource_registry/versions/version" module SchemaRegistry class Property < T::Struct diff --git a/resource_registry.gemspec b/resource_registry.gemspec index efc9e85..0c561bf 100644 --- a/resource_registry.gemspec +++ b/resource_registry.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.email = "genar.factorial@factorial.co" s.files = %w[ lib/resource_registry.rb - lib/public/repositories/base.rb + lib/resource_registry/repositories/base.rb rbi/resource_registry.rbi ] s.homepage = "https://rubygems.org/gems/resource_registry" diff --git a/spec/capability_factory_spec.rb b/spec/capability_factory_spec.rb index 1262aa1..f86a0c9 100644 --- a/spec/capability_factory_spec.rb +++ b/spec/capability_factory_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" require_relative "./dummy_capability" -require_relative "../lib/public/capability_factory" +require_relative "../lib/resource_registry/capability_factory" RSpec.describe ResourceRegistry::CapabilityFactory do let(:capability) { described_class } diff --git a/spec/dummy_repo.rb b/spec/dummy_repo.rb index 50237ca..87e471c 100644 --- a/spec/dummy_repo.rb +++ b/spec/dummy_repo.rb @@ -1,6 +1,6 @@ # typed: false -require_relative "../lib/public/repositories/base" +require_relative "../lib/resource_registry/repositories/base" class DummyEntity < T::Struct const :id, Integer diff --git a/spec/public/registry_spec.rb b/spec/resource_registry/registry_spec.rb similarity index 97% rename from spec/public/registry_spec.rb rename to spec/resource_registry/registry_spec.rb index 203ed4a..ea1d243 100644 --- a/spec/public/registry_spec.rb +++ b/spec/resource_registry/registry_spec.rb @@ -1,7 +1,7 @@ # typed: false require "spec_helper" -require_relative "../../lib/public/registry" +require_relative "../../lib/resource_registry/registry" require_relative "../dummy_repo" class DummyCapability < T::Struct diff --git a/spec/public/relationship_spec.rb b/spec/resource_registry/relationship_spec.rb similarity index 93% rename from spec/public/relationship_spec.rb rename to spec/resource_registry/relationship_spec.rb index c14cefb..6f0fbe6 100644 --- a/spec/public/relationship_spec.rb +++ b/spec/resource_registry/relationship_spec.rb @@ -2,7 +2,7 @@ # typed: false require "spec_helper" -require_relative "../../lib/public/relationship" +require_relative "../../lib/resource_registry/relationship" RSpec.describe ResourceRegistry::Relationship do describe "#load" do diff --git a/spec/public/resource_spec.rb b/spec/resource_registry/resource_spec.rb similarity index 98% rename from spec/public/resource_spec.rb rename to spec/resource_registry/resource_spec.rb index a0f864f..5a5cfb0 100644 --- a/spec/public/resource_spec.rb +++ b/spec/resource_registry/resource_spec.rb @@ -1,7 +1,7 @@ # typed: false require "spec_helper" -require_relative "../../lib/public/resource" +require_relative "../../lib/resource_registry/resource" require_relative "../dummy_repo" require_relative "../dummy_capability" require_relative "../void_capability" diff --git a/spec/public/versions_spec.rb b/spec/resource_registry/versions_spec.rb similarity index 98% rename from spec/public/versions_spec.rb rename to spec/resource_registry/versions_spec.rb index 03a972c..b3debb4 100644 --- a/spec/public/versions_spec.rb +++ b/spec/resource_registry/versions_spec.rb @@ -2,7 +2,7 @@ # typed: false require "spec_helper" -require_relative "../../lib/public/versions" +require_relative "../../lib/resource_registry/versions" RSpec.describe ResourceRegistry::Versions do subject { described_class.new(versions: versions) } diff --git a/spec/resource_struct_builder_spec.rb b/spec/resource_struct_builder_spec.rb index 518c88e..b1b4243 100644 --- a/spec/resource_struct_builder_spec.rb +++ b/spec/resource_struct_builder_spec.rb @@ -2,7 +2,7 @@ # typed: false require "spec_helper" -require_relative "../lib/public/resource_struct_builder" +require_relative "../lib/resource_registry/resource_struct_builder" module ResourceRegistry module DtoBuilderSpec