summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-27 15:25:34 -0600
committermo khan <mo@mokhan.ca>2025-03-27 15:25:34 -0600
commit56331a6109300736ebf8f1250f04f06c88e95177 (patch)
tree2e8c85c2a07617d27d376ddac040c843f81b6ba9
parentc55e51eeef2db8a3d4c7796b7d719b05dc46d2fa (diff)
refactor: split csv files into sub directory to simulate separate databases
-rwxr-xr-xbin/api2
-rwxr-xr-xbin/idp2
-rw-r--r--db/api/groups.csv (renamed from db/groups.csv)0
-rw-r--r--db/api/organizations.csv (renamed from db/organizations.csv)0
-rw-r--r--db/api/projects.csv (renamed from db/projects.csv)0
-rw-r--r--db/idp/users.csv (renamed from db/users.csv)0
6 files changed, 2 insertions, 2 deletions
diff --git a/bin/api b/bin/api
index feb00ca..180aa87 100755
--- a/bin/api
+++ b/bin/api
@@ -31,7 +31,7 @@ $host = ENV.fetch("HOST", "localhost:#{$port}")
class Entity
class << self
def all
- @items ||= ::CSV.read(File.join(__dir__, "../db/#{self.name.downcase}s.csv"), headers: true).map do |row|
+ @items ||= ::CSV.read(File.join(__dir__, "../db/api/#{self.name.downcase}s.csv"), headers: true).map do |row|
new(row.to_h.transform_keys(&:to_sym))
end
end
diff --git a/bin/idp b/bin/idp
index bfc30af..c2c5311 100755
--- a/bin/idp
+++ b/bin/idp
@@ -89,7 +89,7 @@ module Authn
class << self
def all
- @all ||= ::CSV.read(File.join(__dir__, "../db/users.csv"), headers: true).map do |row|
+ @all ||= ::CSV.read(File.join(__dir__, "../db/idp/users.csv"), headers: true).map do |row|
new(row.to_h.transform_keys(&:to_sym))
end
end
diff --git a/db/groups.csv b/db/api/groups.csv
index 03fcf60..03fcf60 100644
--- a/db/groups.csv
+++ b/db/api/groups.csv
diff --git a/db/organizations.csv b/db/api/organizations.csv
index 840de05..840de05 100644
--- a/db/organizations.csv
+++ b/db/api/organizations.csv
diff --git a/db/projects.csv b/db/api/projects.csv
index 594cc39..594cc39 100644
--- a/db/projects.csv
+++ b/db/api/projects.csv
diff --git a/db/users.csv b/db/idp/users.csv
index a0194d7..a0194d7 100644
--- a/db/users.csv
+++ b/db/idp/users.csv