Skip to content

Commit 252956a

Browse files
authored
Update README.md (#9)
1 parent 62d8b26 commit 252956a

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
1-
# Red DataStock
1+
# Red Remote Input
22

3-
:alembic: This project is currently under preparation :canned_food: The project name will be changed.
4-
5-
## Description
6-
7-
Red DataStock is a Ruby library designed to manage data download, cache, and extraction from specific URLs.
3+
Red Remote Input is a Ruby library designed to manage data download, cache, and extraction from specific URLs.
84
Useful when you need to consistently retrieve, cache, and process data files from the Internet.
95

106
## Installation
117

12-
To install Red DataStock:
8+
To install Red Remote Input:
139

1410
```
15-
gem install red-datastock
11+
gem install red-remote-input
1612
```
1713

1814
## Usage
1915

20-
To use Red DataStock in your code, you need to require it first:
16+
To use Red Remote Input in your code, you need to require it first:
2117

2218
```rb
23-
require 'datastock'
19+
require 'remote_input'
2420
```
2521

2622
Now you can use the `Downloader`, `CachePath`, and `ZipExtractor` classes for managing your data.
2723

28-
Here's an example of how to download, cache, and extract a zip file using Red DataStock:
24+
Here's an example of how to download, cache, and extract a zip file using Red Remote Input:
2925

3026
```rb
31-
require 'datastock'
27+
require 'remote_input'
3228

3329
# Prepare the Downloader with your desired URL
34-
downloader = DataStock::Downloader.new("http://example.com/data.zip")
30+
downloader = RemoteInput::Downloader.new("http://example.com/data.zip")
3531

3632
# Define where you want to cache the downloaded data
37-
cache_path = DataStock::CachePath.new("my_data_id")
33+
cache_path = RemoteInput::CachePath.new("my_data_id")
3834

3935
# Define your output path
4036
output_path = cache_path.base_dir + "data.zip"
4137

4238
# Download and cache the data if it's not already cached
43-
downloader.download(cache_path) unless File.exist?(output_path)
39+
downloader.download(output_path) unless File.exist?(output_path)
4440

4541
# Prepare the ZipExtractor with your cached data
46-
zip_extractor = DataStock::ZipExtractor.new(output_path)
42+
zip_extractor = RemoteInput::ZipExtractor.new(output_path)
4743

4844
# Extract files from the zip
4945
zip_extractor.extract_files do |input|
5046
# Your code to process each input file
5147
end
5248

5349
# Clean up the cache directory
54-
cache_path.clean
50+
cache_path.remove
5551
```
5652

5753
In this example, we download a zip file from `http://example.com/data.zip`, store it in a cache directory, and then extract all files from the zip. You can replace the URL with your actual data source.

0 commit comments

Comments
 (0)