ycv 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/README.md +47 -0
- data/lib/ycv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6aeba34f487d0b2fc57a56829e3a42a3ccc7f23cc98073d0786c3c82ef0c831f
|
4
|
+
data.tar.gz: 0b129c80309ece8c16239335fc7e2153d7ce38b4371dd26a1b6ba580dc152177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee90e10fbcb528ef47912c68bfb8b2995852b67a0bf47a07f9078bdb2dcf04de3d51b9cb0f2cf55639321ed2edf145dcd07dcd315ad36db0707bf1c15383145
|
7
|
+
data.tar.gz: 8a5a816a0c54c4ceb53f22ecb08f9d0fad0f9e70844073c159356b2ff20270ce675efd4971e0cded7eb72372b40b53a3028543887fbd7b3694f58d50278ca739
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
AllCops:
|
2
2
|
TargetRubyVersion: 3.0
|
3
|
+
DefaultFormatter: simple
|
4
|
+
NewCops: disable
|
3
5
|
|
4
6
|
Style/StringLiterals:
|
5
7
|
Enabled: true
|
@@ -11,6 +13,8 @@ Style/StringLiteralsInInterpolation:
|
|
11
13
|
|
12
14
|
Layout/LineLength:
|
13
15
|
Max: 120
|
16
|
+
Exclude:
|
17
|
+
- '*.gemspec'
|
14
18
|
|
15
19
|
Metrics/BlockLength:
|
16
20
|
Max: 50
|
data/README.md
CHANGED
@@ -22,6 +22,7 @@ gem install ycv
|
|
22
22
|
```
|
23
23
|
|
24
24
|
# Usage
|
25
|
+
|
25
26
|
## Command-Line Interface (CLI)
|
26
27
|
The ycv command-line tool is straightforward to use and supports output to both files and standard output (STDOUT), making it versatile for scripting and piping to other commands.
|
27
28
|
|
@@ -54,6 +55,52 @@ This feature allows you to easily integrate ycv into your command-line workflows
|
|
54
55
|
## As a Ruby Library
|
55
56
|
In addition to the CLI, Ycv can be used as a library within Ruby applications.
|
56
57
|
|
58
|
+
## Sample Conversion
|
59
|
+
This section provides a simple example of converting between CSV and YAML formats using the ycv tool.
|
60
|
+
|
61
|
+
### YAML to CSV Conversion
|
62
|
+
Given a YAML file sample.yml with the following content:
|
63
|
+
|
64
|
+
```yml
|
65
|
+
sample_1:
|
66
|
+
id: 1
|
67
|
+
name: Alice
|
68
|
+
age: 30
|
69
|
+
|
70
|
+
sample_2:
|
71
|
+
id: 2
|
72
|
+
name: Bob
|
73
|
+
age: 25
|
74
|
+
```
|
75
|
+
Running `ycv sample.yml sample.csv` will produce a CSV file sample.csv with the following content:
|
76
|
+
```csv
|
77
|
+
id,name,age
|
78
|
+
1,Alice,30
|
79
|
+
2,Bob,25
|
80
|
+
```
|
81
|
+
|
82
|
+
|
83
|
+
### CSV to YAML Conversion
|
84
|
+
Conversely, given a CSV file sample.csv with the following content:
|
85
|
+
```csv
|
86
|
+
id,name,age
|
87
|
+
1,Alice,30
|
88
|
+
2,Bob,25
|
89
|
+
```
|
90
|
+
|
91
|
+
Running `ycv sample.csv sample.yml` will produce a YAML file sample.yml with the following content:
|
92
|
+
```yml
|
93
|
+
sample_1:
|
94
|
+
id: 1
|
95
|
+
name: Alice
|
96
|
+
age: 30
|
97
|
+
|
98
|
+
sample_2:
|
99
|
+
id: 2
|
100
|
+
name: Bob
|
101
|
+
age: 25
|
102
|
+
```
|
103
|
+
These examples demonstrate the straightforward conversion process between CSV and YAML formats, making it easy to integrate ycv into your data handling workflows.
|
57
104
|
|
58
105
|
# Contributing
|
59
106
|
Contributions to Ycv are always welcome, whether it's through bug reports, pull requests, or feature requests.
|
data/lib/ycv/version.rb
CHANGED