Skip to content

Commit

Permalink
Allow default_serializers to be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
azimux committed Jan 25, 2025
1 parent cbad5f9 commit 0dbedc9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.0.10] - 2025-01-25

- Allow default_serializers to be changed

## [0.0.9] - 2025-01-07

- Bump Ruby to 3.4.1
Expand Down
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
foobara-http-command-connector (0.0.9)
foobara-http-command-connector (0.0.10)
foobara

GEM
Expand Down Expand Up @@ -54,7 +54,7 @@ GEM
foobara-type-generator
foobara-typescript-react-command-form-generator
foobara-typescript-remote-command-generator
foobara (0.0.47)
foobara (0.0.50)
bigdecimal
foobara-util
foobara-autocrud-generator (0.0.1)
Expand Down Expand Up @@ -145,7 +145,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.4)
logger (1.6.5)
lumberjack (1.2.10)
method_source (1.1.0)
nenv (0.3.0)
Expand All @@ -154,7 +154,7 @@ GEM
shellany (~> 0.0)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.6.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pry (0.14.2)
Expand Down Expand Up @@ -188,7 +188,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.69.2)
rubocop (1.71.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -202,7 +202,7 @@ GEM
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.3.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
ruby-prof (1.7.1)
ruby-progressbar (1.13.0)
Expand All @@ -214,7 +214,7 @@ GEM
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
thor (1.3.2)
unicode-display_width (3.1.3)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
vcr (6.3.1)
Expand Down
2 changes: 1 addition & 1 deletion boot/start.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "bundler/setup"

if ENV["FOOBARA_ENV"] == "development" || ENV["FOOBARA_ENV"] == "test"
if %w[development test].include?(ENV["FOOBARA_ENV"])
require "pry"
require "pry-byebug"
end
Expand Down
16 changes: 11 additions & 5 deletions src/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ module CommandConnectors
class Http < CommandConnector
include TruncatedInspect

class << self
attr_accessor :default_serializers
end

self.default_serializers = [
Foobara::CommandConnectors::Serializers::ErrorsSerializer,
Foobara::CommandConnectors::Serializers::AtomicSerializer,
Foobara::CommandConnectors::Serializers::JsonSerializer
]

attr_accessor :prefix

def initialize(
prefix: nil,
default_serializers: [
Foobara::CommandConnectors::Serializers::ErrorsSerializer,
Foobara::CommandConnectors::Serializers::AtomicSerializer,
Foobara::CommandConnectors::Serializers::JsonSerializer
],
default_serializers: self.class.default_serializers,
**
)
if prefix
Expand Down
2 changes: 1 addition & 1 deletion version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Foobara
module HttpCommandConnector
VERSION = "0.0.9".freeze
VERSION = "0.0.10".freeze

local_ruby_version = File.read("#{__dir__}/.ruby-version").chomp
local_ruby_version_minor = local_ruby_version[/\A(\d+\.\d+)\.\d+\z/, 1]
Expand Down

0 comments on commit 0dbedc9

Please sign in to comment.