json_to_csv_convertor 0.1.4 → 0.1.5
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 +3 -8
- data/json_to_csv_convertor-0.1.1.gem +0 -0
- data/json_to_csv_convertor-0.1.2.gem +0 -0
- data/json_to_csv_convertor-0.1.3.gem +0 -0
- data/json_to_csv_convertor-0.1.4.gem +0 -0
- data/lib/json_to_csv_convertor/version.rb +1 -1
- data/lib/json_to_csv_convertor.rb +5 -3
- data/services/convert_json.rb +1 -3
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f2ba4a438f233cf12a0100de63906ab8109f829f7e437a0d284077b5c4349d6
|
4
|
+
data.tar.gz: 6cca662625aed9d43e73f559c6bc32a87932f339efb181b416d51c2e55d1cf38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 115722ab52d12540c8da128f481881f5f8d2a04469e9748806dadfcf8e58297a9fe50c60c14e6e201d9640b2ecb51e589ec2a281314703133d2cb50c76f48bc8
|
7
|
+
data.tar.gz: 9c6646444a54a184a97868039e966441dd497ab8067ab908061f68ac102f540709d865756bee444cf6f9abc7fcc14a58ce4f08be021508fe4faba375598fbd19
|
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# JsonToCsvConvertor
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/json_to_csv_convertor`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
@@ -22,13 +18,12 @@ Or install it yourself as:
|
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
require 'json_to_csv_convertor'
|
26
22
|
|
27
|
-
|
23
|
+
include JsonToCsvConvertor
|
28
24
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
25
|
|
31
|
-
|
26
|
+
json_to_csv(json)
|
32
27
|
|
33
28
|
## Contributing
|
34
29
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -7,9 +7,11 @@ module JsonToCsvConvertor
|
|
7
7
|
class Error < StandardError; end
|
8
8
|
|
9
9
|
include ConvertJson
|
10
|
+
include ReadJson
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
|
13
|
+
def convert_json_to_csv(json)
|
14
|
+
json_to_csv make_json_readable(json)
|
13
15
|
end
|
14
16
|
|
15
|
-
end
|
17
|
+
end
|
data/services/convert_json.rb
CHANGED
@@ -3,10 +3,8 @@ require 'json'
|
|
3
3
|
require_relative 'read_json'
|
4
4
|
|
5
5
|
module ConvertJson
|
6
|
-
include ReadJson
|
7
6
|
|
8
|
-
def json_to_csv(
|
9
|
-
json_rows = ReadJson::make_json_readable(json)
|
7
|
+
def json_to_csv(json_rows)
|
10
8
|
header_keys = head_colums(json_rows)
|
11
9
|
csv_string = CSV.generate do |csv|
|
12
10
|
csv << header_keys.keys
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_to_csv_convertor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vasyl.marmash
|
@@ -28,6 +28,10 @@ files:
|
|
28
28
|
- bin/console
|
29
29
|
- bin/setup
|
30
30
|
- json_to_csv_convertor-0.1.0.gem
|
31
|
+
- json_to_csv_convertor-0.1.1.gem
|
32
|
+
- json_to_csv_convertor-0.1.2.gem
|
33
|
+
- json_to_csv_convertor-0.1.3.gem
|
34
|
+
- json_to_csv_convertor-0.1.4.gem
|
31
35
|
- json_to_csv_convertor.gemspec
|
32
36
|
- lib/json_to_csv_convertor.rb
|
33
37
|
- lib/json_to_csv_convertor/version.rb
|