csv_json_converter 0.1.3 → 0.1.4
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/README.md +25 -2
- data/lib/csv_json_converter/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1f3376d08cdd35e377a8948b5557767c12ecaa6ebb016b211e12d8c13836d8d
|
4
|
+
data.tar.gz: 1f48a73d83e9c365b24ea62f640a9b31690c25ed7aa6e7c8e9d01f9f72992031
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f78b16b10cbc8e594395402d2ce6d3cd8f1041f2e2a689664a644defc62ff4ab8ef7045d82eccd23bac63571ab45b3fc3cbb709d5efebf0a1d18738dde061467
|
7
|
+
data.tar.gz: 6938447a517037a4d10fc481f8073efadd1a2cb9aa971207b9edc349dd94c24faf6cf38ae0e1d9dca3bcaf2f5acf0f3b3f88b2a589436a61d522a52ccee00db9
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<a name="readme-top"></a>
|
4
4
|
# :green_book: Table of Contents
|
5
|
-
[](https://rubygems.org/gems/csv_json_converter)
|
6
6
|
- [:green_book: Table of Contents](#-table-of-contents)
|
7
7
|
- [:book: csv\_json\_converter ](#-csv_json_converter-)
|
8
8
|
- [Installation ](#installation-)
|
@@ -27,7 +27,7 @@ gem install csv_json_converter
|
|
27
27
|
```
|
28
28
|
### Usage
|
29
29
|
`require` this gem on the top of your ruby code.
|
30
|
-
|
30
|
+
### Covert csv to json
|
31
31
|
If you want to convert `csv string`, to json you can use `to_json` method from `CsvJsonConverter`. Let's see how:-
|
32
32
|
|
33
33
|
<i>For example </i>
|
@@ -52,7 +52,30 @@ If you want to convert `csv string`, to json you can use `to_json` method from `
|
|
52
52
|
"hex": "jz40cbafbec8d6f92e93d22ea6ef5b"
|
53
53
|
}
|
54
54
|
```
|
55
|
+
### Covert json to csv
|
56
|
+
If you want to convert `json object`, to json you can use `to_csv` method from `CsvJsonConverter`. Let's see how:-
|
55
57
|
|
58
|
+
<i>For example </i>
|
59
|
+
```ruby
|
60
|
+
|
61
|
+
require 'csv_json_converter'
|
62
|
+
|
63
|
+
data_json={ "file": "test18.csv",
|
64
|
+
"text": "CMkABfAGXvmSFV",
|
65
|
+
"number": 9892576,
|
66
|
+
"hex": "jz40cbafbec8d6f92e93d22ea6ef5b"
|
67
|
+
}
|
68
|
+
|
69
|
+
csv_data = CsvJsonCoverter.to_csv(data_json)
|
70
|
+
|
71
|
+
print csv_data
|
72
|
+
|
73
|
+
```
|
74
|
+
|
75
|
+
**The output looks like below**
|
76
|
+
```
|
77
|
+
"file,text,number,hex\ntest18.csv,CMkABfAGXvmSFV,9892576,jz40cbafbec8d6f92e93d22ea6ef5b
|
78
|
+
```
|
56
79
|
## :busts_in_silhouette: Authors <a name="authors"></a>
|
57
80
|
:bust_in_silhouette: Pablo Zambrano
|
58
81
|
- GitHub: [@alexoid1](https://github.com/melashu)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_json_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alexoid1
|
@@ -27,11 +27,12 @@ files:
|
|
27
27
|
- lib/csv_json_converter.rb
|
28
28
|
- lib/csv_json_converter/version.rb
|
29
29
|
- sig/csv_json_converter.rbs
|
30
|
-
homepage: https://
|
30
|
+
homepage: https://rubygems.org/gems/csv_json_converter
|
31
31
|
licenses:
|
32
32
|
- MIT
|
33
33
|
metadata:
|
34
|
-
homepage_uri: https://
|
34
|
+
homepage_uri: https://rubygems.org/gems/csv_json_converter
|
35
|
+
documentation_uri: https://github.com/Alexoid1/csv_json_converter
|
35
36
|
source_code_uri: https://github.com/Alexoid1/csv_json_converter
|
36
37
|
post_install_message:
|
37
38
|
rdoc_options: []
|