Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ GEM
mutex_m
tzinfo (~> 2.0)
ansi (1.5.0)
ast (2.4.2)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.5.0)
benchmark-ips (2.14.0)
Expand Down Expand Up @@ -126,8 +126,8 @@ GEM
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.9.1)
language_server-protocol (3.17.0.3)
json (2.21.2)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
logger (1.7.0)
loofah (2.25.2)
Expand Down Expand Up @@ -166,8 +166,8 @@ GEM
nokogiri (1.19.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
parallel (2.2.0)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
pp (0.6.4)
Expand Down Expand Up @@ -232,27 +232,31 @@ GEM
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
regexp_parser (2.10.0)
regexp_parser (2.12.0)
reline (0.7.0)
io-console (~> 0.5)
rubocop (1.70.0)
rubocop (1.88.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-minitest (0.40.0)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (1.13.0)
simplecov (0.22.0)
docile (~> 1.1)
Expand All @@ -261,25 +265,25 @@ GEM
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
spring (2.1.1)
standard (1.44.0)
standard (1.56.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.70.0)
rubocop (~> 1.88.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.6)
standard-performance (~> 1.8)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.6.0)
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.23.0)
rubocop-performance (~> 1.26.0)
thor (1.5.0)
timeout (0.4.0)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand Down
7 changes: 7 additions & 0 deletions test/file_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def test_write
assert_content path, "Hello\nWorld"
end

def test_write_nested_content
path = root.join("write_nested")
write(path, "Hello\n", ["World", "!"])

assert_content path, "Hello\nWorld!"
end

def test_append
path = root.join("append.rb")
content = <<~CONTENT
Expand Down
2 changes: 1 addition & 1 deletion vite_ruby/lib/vite_ruby/cli/file_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class << self
def write(path, *content)
mkdir_p(path)
File.open(path, File::CREAT | File::WRONLY | File::TRUNC) do |file|
file.write(Array(content).flatten.join)
file.write(Array(content).join)
end
end

Expand Down
Loading