paquito 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +26 -0
- data/.gitignore +8 -0
- data/.rubocop.yml +5 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +78 -0
- data/LICENSE.txt +21 -0
- data/README.md +175 -0
- data/Rakefile +19 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/dev.yml +12 -0
- data/lib/paquito/active_record_coder.rb +141 -0
- data/lib/paquito/allow_nil.rb +19 -0
- data/lib/paquito/codec_factory.rb +39 -0
- data/lib/paquito/coder_chain.rb +21 -0
- data/lib/paquito/comment_prefix_version.rb +54 -0
- data/lib/paquito/conditional_compressor.rb +42 -0
- data/lib/paquito/deflater.rb +17 -0
- data/lib/paquito/errors.rb +19 -0
- data/lib/paquito/safe_yaml.rb +74 -0
- data/lib/paquito/serialized_column.rb +52 -0
- data/lib/paquito/single_byte_prefix_version.rb +27 -0
- data/lib/paquito/struct.rb +87 -0
- data/lib/paquito/translate_errors.rb +25 -0
- data/lib/paquito/typed_struct.rb +53 -0
- data/lib/paquito/types/active_record_packer.rb +51 -0
- data/lib/paquito/types.rb +242 -0
- data/lib/paquito/version.rb +5 -0
- data/lib/paquito.rb +47 -0
- data/paquito.gemspec +32 -0
- metadata +90 -0
data/lib/paquito.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "digest/md5"
|
4
|
+
require "bigdecimal"
|
5
|
+
require "date"
|
6
|
+
require "set"
|
7
|
+
require "yaml"
|
8
|
+
|
9
|
+
require "msgpack"
|
10
|
+
|
11
|
+
require "paquito/version"
|
12
|
+
require "paquito/deflater"
|
13
|
+
require "paquito/allow_nil"
|
14
|
+
require "paquito/translate_errors"
|
15
|
+
require "paquito/safe_yaml"
|
16
|
+
require "paquito/conditional_compressor"
|
17
|
+
require "paquito/single_byte_prefix_version"
|
18
|
+
require "paquito/comment_prefix_version"
|
19
|
+
require "paquito/types"
|
20
|
+
require "paquito/codec_factory"
|
21
|
+
require "paquito/struct"
|
22
|
+
require "paquito/typed_struct"
|
23
|
+
require "paquito/serialized_column"
|
24
|
+
|
25
|
+
module Paquito
|
26
|
+
autoload :ActiveRecordCoder, "paquito/active_record_coder"
|
27
|
+
|
28
|
+
class << self
|
29
|
+
def cast(coder)
|
30
|
+
if coder.respond_to?(:load) && coder.respond_to?(:dump)
|
31
|
+
coder
|
32
|
+
elsif coder.respond_to?(:deflate) && coder.respond_to?(:inflate)
|
33
|
+
Deflater.new(coder)
|
34
|
+
else
|
35
|
+
raise TypeError, "Coders must respond to #dump and #load, #{coder.inspect} doesn't"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def chain(*coders)
|
40
|
+
CoderChain.new(*coders)
|
41
|
+
end
|
42
|
+
|
43
|
+
def allow_nil(coder)
|
44
|
+
AllowNil.new(coder)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/paquito.gemspec
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/paquito/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "paquito"
|
7
|
+
spec.version = Paquito::VERSION
|
8
|
+
spec.authors = ["Jean Boussier"]
|
9
|
+
spec.email = ["jean.boussier@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Framework for defining efficient and extendable serializers"
|
12
|
+
spec.description = "Framework for defining efficient and extendable serializers"
|
13
|
+
spec.homepage = "https://github.com/Shopify/paquito"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.7.0"
|
16
|
+
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
|
+
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
spec.metadata["source_code_uri"] = "https://github.com/Shopify/paquito"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
%x{git ls-files -z}.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_dependency("msgpack")
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paquito
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jean Boussier
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: msgpack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Framework for defining efficient and extendable serializers
|
28
|
+
email:
|
29
|
+
- jean.boussier@gmail.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".github/workflows/ci.yml"
|
35
|
+
- ".gitignore"
|
36
|
+
- ".rubocop.yml"
|
37
|
+
- Gemfile
|
38
|
+
- Gemfile.lock
|
39
|
+
- LICENSE.txt
|
40
|
+
- README.md
|
41
|
+
- Rakefile
|
42
|
+
- bin/console
|
43
|
+
- bin/setup
|
44
|
+
- dev.yml
|
45
|
+
- lib/paquito.rb
|
46
|
+
- lib/paquito/active_record_coder.rb
|
47
|
+
- lib/paquito/allow_nil.rb
|
48
|
+
- lib/paquito/codec_factory.rb
|
49
|
+
- lib/paquito/coder_chain.rb
|
50
|
+
- lib/paquito/comment_prefix_version.rb
|
51
|
+
- lib/paquito/conditional_compressor.rb
|
52
|
+
- lib/paquito/deflater.rb
|
53
|
+
- lib/paquito/errors.rb
|
54
|
+
- lib/paquito/safe_yaml.rb
|
55
|
+
- lib/paquito/serialized_column.rb
|
56
|
+
- lib/paquito/single_byte_prefix_version.rb
|
57
|
+
- lib/paquito/struct.rb
|
58
|
+
- lib/paquito/translate_errors.rb
|
59
|
+
- lib/paquito/typed_struct.rb
|
60
|
+
- lib/paquito/types.rb
|
61
|
+
- lib/paquito/types/active_record_packer.rb
|
62
|
+
- lib/paquito/version.rb
|
63
|
+
- paquito.gemspec
|
64
|
+
homepage: https://github.com/Shopify/paquito
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata:
|
68
|
+
allowed_push_host: https://rubygems.org
|
69
|
+
homepage_uri: https://github.com/Shopify/paquito
|
70
|
+
source_code_uri: https://github.com/Shopify/paquito
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.7.0
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubygems_version: 3.2.20
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: Framework for defining efficient and extendable serializers
|
90
|
+
test_files: []
|