Skip to content

Commit 35d67b3

Browse files
committed
read and write
1 parent 53290bd commit 35d67b3

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/manifolds/services/big_query_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def create_dimensions_file(project_name, fields)
4040
tables_directory(project_name).mkpath
4141
dimensions = dimensions_schema(fields)
4242

43-
File.write(dimensions_path(project_name), dimensions)
43+
dimensions_path(project_name).write(dimensions)
4444
@logger.info("Generated BigQuery dimensions table schema for '#{project_name}'.")
4545
end
4646

spec/manifolds/services/big_query_service_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
context "when the project configuration exists" do
2121
before do
2222
Pathname.pwd.join("vectors").mkpath
23-
File.write(Pathname.pwd.join("vectors", "user.yml"), <<~YAML)
23+
Pathname.pwd.join("vectors", "user.yml").write(<<~YAML)
2424
attributes:
2525
user_id: string
2626
email: string
2727
YAML
2828

29-
File.write(Pathname.pwd.join("projects", project_name, "manifold.yml"), <<~YAML)
29+
Pathname.pwd.join("projects", project_name, "manifold.yml").write(<<~YAML)
3030
vectors:
3131
- User
3232
YAML
@@ -39,7 +39,7 @@
3939
end
4040

4141
it "includes the expected schema structure" do
42-
schema = JSON.parse(File.read(dimensions_path))
42+
schema = JSON.parse(dimensions_path.read)
4343
expect(schema).to include({ "type" => "STRING", "name" => "id", "mode" => "REQUIRED" })
4444
end
4545
end

spec/manifolds/services/vector_service_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
before do
3535
Pathname.pwd.join("vectors").mkpath
3636
config_path = Pathname.pwd.join("vectors", "#{vector_name}.yml")
37-
File.write(config_path, YAML.dump(vector_config))
37+
config_path.write(YAML.dump(vector_config))
3838
end
3939

4040
it "loads and transforms vector schema" do

spec/support/shared_contexts/with_template_files.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
before do
55
template_dir.mkpath
66

7-
File.write(workspace_template_path, "vectors:\nmetrics:")
8-
File.write(vector_template_path, "attributes:")
7+
workspace_template_path.write("vectors:\nmetrics:")
8+
vector_template_path.write("attributes:")
99
end
1010

1111
def template_dir

0 commit comments

Comments
 (0)