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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46b076008cee61a9a62811da5a448d4d67584867944789863fad1c8ed9463e7c
4
- data.tar.gz: 3d61813f2caa7d34308f6cdced0458ff88964fdda77496197747f37c1eecaf4d
3
+ metadata.gz: e90c7665d0f2aed22d9e22fe98598c4e93a086cd4062594bc0ae7e2ca159cfbb
4
+ data.tar.gz: f9aaf7ffc9bac9bb91415a07c24144e56e841aa3d51d0562ae4b9b229f465ce0
5
5
  SHA512:
6
- metadata.gz: 9bed1161ce8242f20335fc8ad03bff03629936bd2f965bc25570d351b542f6b178abb4df7c186c67b70a0543d451cf1398fab32db635b3ebad6873de698911bd
7
- data.tar.gz: f71ddaf63e56078256009e72fdadd539c53069d9bbb5e615907e2b2c152059c0f9b442d7dac3c1d9d2820990101bce2307b5e0476ee42d257f59609fafbe29e2
6
+ metadata.gz: 8ae08fab3b426ee42757dcfb87df09cda5d6e5b5eb2ffa4abbba341b4feb1cf9669e967bea5cd4bb10c7e2b815c5949173959a34524a1df57f52f0cad67f45e4
7
+ data.tar.gz: 8d00f374dd99771a76091332ea2770cdda613729916ad8c55dc384879aef4d74f9e3961dc59a8db6616e0093e98b63e476931eed2c90b23e133d4de682f70ee8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sheetsy (1.2.0)
4
+ sheetsy (1.3.0)
5
5
  rake (~> 13.0)
6
6
  roo
7
7
  rspec (~> 3.0)
@@ -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
@@ -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.each do |file|
19
- ret[file] = process_file(file)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sheetsy
4
- VERSION = "1.2.0"
4
+ VERSION = "1.3.0"
5
5
  end
data/lib/sheetsy.rb CHANGED
@@ -8,6 +8,7 @@ require "ruby-progressbar"
8
8
 
9
9
  require_relative "sheetsy/version"
10
10
  require_relative "sheetsy/converter"
11
+ require_relative "sheetsy/json_file"
11
12
  require_relative "sheetsy/reader"
12
13
  require_relative "sheetsy/cli"
13
14
 
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.2.0
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