sheetsy 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sheetsy/json_file.rb +23 -0
- data/lib/sheetsy/reader.rb +3 -15
- data/lib/sheetsy/version.rb +1 -1
- data/lib/sheetsy.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90c7665d0f2aed22d9e22fe98598c4e93a086cd4062594bc0ae7e2ca159cfbb
|
4
|
+
data.tar.gz: f9aaf7ffc9bac9bb91415a07c24144e56e841aa3d51d0562ae4b9b229f465ce0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ae08fab3b426ee42757dcfb87df09cda5d6e5b5eb2ffa4abbba341b4feb1cf9669e967bea5cd4bb10c7e2b815c5949173959a34524a1df57f52f0cad67f45e4
|
7
|
+
data.tar.gz: 8d00f374dd99771a76091332ea2770cdda613729916ad8c55dc384879aef4d74f9e3961dc59a8db6616e0093e98b63e476931eed2c90b23e133d4de682f70ee8
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Sheetsy
|
4
|
+
class JSONFile
|
5
|
+
attr_reader :file_path, :data
|
6
|
+
|
7
|
+
def initialize(file_path)
|
8
|
+
@file_path = file_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def data
|
12
|
+
@data ||= JSON.parse(File.read(file_path))
|
13
|
+
end
|
14
|
+
|
15
|
+
def inspect
|
16
|
+
to_s
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_s
|
20
|
+
"#<#{self.class}:#{file_path}>"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/sheetsy/reader.rb
CHANGED
@@ -13,14 +13,12 @@ module Sheetsy
|
|
13
13
|
debug "Files found: #{files.count}"
|
14
14
|
|
15
15
|
progress_bar.progress = 0
|
16
|
-
ret = {}
|
17
16
|
|
18
|
-
files.
|
19
|
-
ret
|
17
|
+
@data = files.map do |file|
|
18
|
+
ret = JSONFile.new(file)
|
20
19
|
progress_bar.increment
|
20
|
+
ret
|
21
21
|
end
|
22
|
-
|
23
|
-
@data = ret
|
24
22
|
end
|
25
23
|
|
26
24
|
def overwrite?
|
@@ -46,15 +44,5 @@ module Sheetsy
|
|
46
44
|
|
47
45
|
progress_bar.log str
|
48
46
|
end
|
49
|
-
|
50
|
-
def process_file(file)
|
51
|
-
debug "File: #{file}"
|
52
|
-
|
53
|
-
JSON.parse(File.read(file))
|
54
|
-
end
|
55
|
-
|
56
|
-
def progress_bar
|
57
|
-
@progress_bar ||= ProgressBar.create(title: "Files", total: files.count)
|
58
|
-
end
|
59
47
|
end
|
60
48
|
end
|
data/lib/sheetsy/version.rb
CHANGED
data/lib/sheetsy.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheetsy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/sheetsy.rb
|
116
116
|
- lib/sheetsy/cli.rb
|
117
117
|
- lib/sheetsy/converter.rb
|
118
|
+
- lib/sheetsy/json_file.rb
|
118
119
|
- lib/sheetsy/reader.rb
|
119
120
|
- lib/sheetsy/version.rb
|
120
121
|
- sig/sheetsy.rbs
|