Skip to content

Add RemoteInput#to_path - #38

Merged
kou merged 1 commit into
red-data-tools:mainfrom
tikkss:add-to-path
Nov 15, 2026
Merged

kou merged 1 commit into
red-data-tools:mainfrom
tikkss:add-to-path

Conversation

@tikkss

@tikkss tikkss commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

GitHub: GH-5

This patch will add RemoteInput#to_path. It's the same as RemoteInput#path.

We need this to pass a RemoteInput with FileUtils.cp. FileUtils.cp calls File.path. File.path calls #to_path if the given object isn't a String:

RemoteInput.open("https://example.com/data.csv") do |input|
  FileUtils.cp(input, "data.csv")
end

GitHub: red-data-toolsGH-5

This patch will add `RemoteInput#to_path`. It's the same as
`RemoteInput#path`.

We need this to pass a `RemoteInput` with `FileUtils.cp`. `FileUtils.cp`
calls `File.path`. `File.path` calls `#to_path` if the given object
isn't a `String`:

```ruby
RemoteInput.open("https://example.com/data.csv") do |input|
  FileUtils.cp(input, "data.csv")
end
```
@kou
kou merged commit 0643d8f into red-data-tools:main Nov 15, 2026
9 checks passed
@tikkss
tikkss deleted the add-to-path branch November 16, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants