purplelight 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5964231e634be4a743207679e349623c275e0b20771b492bbc54c4261238e352
4
- data.tar.gz: 82448e1f4b5ffb8e9846938653b16a4d7008aa29e722d9417863b80362370168
3
+ metadata.gz: 707f5c45aade0603b8a3c500e91015b9850c2c92deb91492f06cb3f8bbee76d5
4
+ data.tar.gz: dd6217a55fa5bcd3f008699bd8710e8e0ac72f9bb0b8bf5dd71d2f2eccbc5d84
5
5
  SHA512:
6
- metadata.gz: 4b8ac2ba82501978bcd1ae1b9db888f7dab387de76a7e473c5b0993a526398a727a029a0597a64c77bbbed976980e6adaad7a08f7e3967c9cfe6c7afa2d996ac
7
- data.tar.gz: 15f536cfc05a0b70f7cdeb6bc7985e56b2e6dad6b2db53922e7aab12a821b8bb1294217390ff00c095b2cacb46c23e027d24d90a083e9e415a0df6e26fec9b59
6
+ metadata.gz: 23da05fd59362787069ae1df5168d85c210d2c7cfc0fd254c064cae26212ee177b84dff8c72ba825a612b3aef3072188e54fad267c60331105dc026e96b42d50
7
+ data.tar.gz: 8b8a728f0002f60d55c31270ee2751aaddab422777aa2a51d6a8b8d3a25a93fe2be27d218316b6fd077103d2901f7561b4983a27a27fde895b80fdc6ee67089f
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Alexander Nicholson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -9,7 +9,7 @@ Purplelight is published on RubyGems: [purplelight on RubyGems](https://rubygems
9
9
  Add to your Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'purplelight', '~> 0.1.3'
12
+ gem 'purplelight', '~> 0.1.4'
13
13
  ```
14
14
 
15
15
  Or install directly:
@@ -203,12 +203,12 @@ module Purplelight
203
203
  last_id = doc['_id']
204
204
  doc = @mapper.call(doc) if @mapper
205
205
  if encode_lines
206
- line = "#{Oj.dump(doc, mode: :compat)}\n"
206
+ line = "#{JSON.generate(doc)}\n"
207
207
  bytes = line.bytesize
208
208
  buffer << line
209
209
  else
210
210
  # For CSV/Parquet keep raw docs to allow schema/row building
211
- bytes = (Oj.dump(doc, mode: :compat).bytesize + 1)
211
+ bytes = (JSON.generate(doc).bytesize + 1)
212
212
  buffer << doc
213
213
  end
214
214
  buffer_bytes += bytes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Purplelight
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'csv'
4
- require 'oj'
4
+ require 'json'
5
5
  require 'zlib'
6
6
  require 'fileutils'
7
7
 
@@ -173,7 +173,7 @@ module Purplelight
173
173
  val = doc[key] || doc[key.to_sym]
174
174
  case val
175
175
  when Hash, Array
176
- Oj.dump(val, mode: :compat)
176
+ JSON.generate(val)
177
177
  else
178
178
  val
179
179
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'oj'
3
+ require 'json'
4
4
  require 'zlib'
5
5
  require 'fileutils'
6
6
 
@@ -44,7 +44,7 @@ module Purplelight
44
44
  buffer = if array_of_docs.first.is_a?(String)
45
45
  array_of_docs.join
46
46
  else
47
- array_of_docs.map { |doc| "#{Oj.dump(doc, mode: :compat)}\n" }.join
47
+ array_of_docs.map { |doc| "#{JSON.generate(doc)}\n" }.join
48
48
  end
49
49
  rows = array_of_docs.size
50
50
  write_buffer(buffer)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: purplelight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Nicholson
@@ -51,20 +51,6 @@ dependencies:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '2.19'
54
- - !ruby/object:Gem::Dependency
55
- name: oj
56
- requirement: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '3.16'
61
- type: :runtime
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '3.16'
68
54
  description: High-throughput, resumable snapshots of MongoDB collections with partitioning,
69
55
  multi-threaded readers, and size-based sharded outputs.
70
56
  email:
@@ -74,6 +60,7 @@ executables:
74
60
  extensions: []
75
61
  extra_rdoc_files: []
76
62
  files:
63
+ - LICENSE
77
64
  - README.md
78
65
  - Rakefile
79
66
  - bin/purplelight