simple_master 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3767dce67967051739f25da6dc14604e647a65bca3d6a68579b54cc0bad58009
4
- data.tar.gz: ad1ffecd0e636e7072d8f1d928717ca42090a1e01426a1e619fca6a056a1720f
3
+ metadata.gz: 7ae4df97dc89c0f5ba4b6c3d11a61d8b0b0b038946a2c001cfe37e6206ad2163
4
+ data.tar.gz: 233b60856df43b548d8137509ef9731e8f2de6934f4bb138e14806c28893bc40
5
5
  SHA512:
6
- metadata.gz: 28d28d28165fe704e8fa38b99a2a409b8c505c03b31366f2bb5ad7ad9bc033ca10c8e095ce725fe1b67e35cfc28da06f88d10c2dcb81545462f6cce911e2e21c
7
- data.tar.gz: f92e380bbf3ff68fbd9686427d42c32f961342b73e4722f1a2634f6c2f2b72bcd97c919c33c76fdfa1f6afe208a8270b748b246eddedb6f6ee51d8e9baadd178
6
+ metadata.gz: 5c3da47edcc9bb26e1ea4dd12178679d77d26f863c59c79e9175d7cecff85ad19e5438be57f580f1cf4be86d8df8a16393417916b5113d636a5261b9fb0a8f13
7
+ data.tar.gz: df3cf6342b7fd0a476a42ca578263c58dacba632c325351083ad06123118093e2e36c51d32e5f038e2e8609249a72050bc504b9509a80b034a517928715d7e57
@@ -4,10 +4,15 @@ module SimpleMaster
4
4
  class Loader
5
5
  class MarshalLoader < Loader
6
6
  def read_raw(table)
7
- File.read("#{@options[:path]}/#{table.klass.table_name}.marshal")
7
+ path = "#{@options[:path]}/#{table.klass.table_name}.marshal"
8
+ return nil unless File.exist?(path)
9
+
10
+ File.read(path)
8
11
  end
9
12
 
10
13
  def build_records(_klass, raw)
14
+ return [] if raw.nil?
15
+
11
16
  Marshal.load(raw) # rubocop:disable Security/MarshalLoad
12
17
  end
13
18
  end
@@ -42,7 +42,7 @@ module SimpleMaster
42
42
  else
43
43
  record.send(method_name)
44
44
  end
45
- }.join(", ").then { "(#{_1})" }
45
+ }.join(", ").then { "(#{_1})" }
46
46
  }.join(", \n")
47
47
 
48
48
  "INSERT INTO `#{table_name}` \n#{sql_columns} VALUES \n#{values_sql}#{on_duplicate_key_update_sql};\n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleMaster
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jingyuan Zhao