Skip to content

Commit 1bdcf01

Browse files
authored
feat: Add experimental plugin support (#327)
1 parent bdc6bdc commit 1bdcf01

File tree

14 files changed

+1365
-992
lines changed

14 files changed

+1365
-992
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ on:
1010
- "**.md"
1111

1212
jobs:
13-
build-linux-oldest:
13+
build-linux:
1414
uses: ./.github/workflows/build-gem.yml
15+
strategy:
16+
matrix:
17+
version: ["3.2", "jruby-9.4"]
1518
with:
16-
version: "3.2"
17-
18-
build-linux-latest:
19-
uses: ./.github/workflows/build-gem.yml
20-
with:
21-
version: "3.2"
22-
23-
build-linux-jruby:
24-
uses: ./.github/workflows/build-gem.yml
25-
with:
26-
version: "jruby-9.4"
19+
version: ${{ matrix.version }}
2720

2821
build-docs:
2922
runs-on: ubuntu-latest

lib/ldclient-rb/config.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Config
4545
# @option opts [String] :payload_filter_key See {#payload_filter_key}
4646
# @option opts [Boolean] :omit_anonymous_contexts See {#omit_anonymous_contexts}
4747
# @option hooks [Array<Interfaces::Hooks::Hook]
48+
# @option plugins [Array<Interfaces::Plugins::Plugin]
4849
#
4950
def initialize(opts = {})
5051
@base_uri = (opts[:base_uri] || Config.default_base_uri).chomp("/")
@@ -79,6 +80,7 @@ def initialize(opts = {})
7980
@application = LaunchDarkly::Impl::Util.validate_application_info(opts[:application] || {}, @logger)
8081
@payload_filter_key = LaunchDarkly::Impl::Util.validate_payload_filter_key(opts[:payload_filter_key] , @logger)
8182
@hooks = (opts[:hooks] || []).keep_if { |hook| hook.is_a? Interfaces::Hooks::Hook }
83+
@plugins = (opts[:plugins] || []).keep_if { |plugin| plugin.is_a? Interfaces::Plugins::Plugin }
8284
@omit_anonymous_contexts = opts.has_key?(:omit_anonymous_contexts) && opts[:omit_anonymous_contexts]
8385
@data_source_update_sink = nil
8486
@instance_id = nil
@@ -412,6 +414,14 @@ def diagnostic_opt_out?
412414
#
413415
attr_reader :hooks
414416

417+
#
418+
# Initial set of plugins for the client.
419+
#
420+
# Plugins provide an interface which allows for initialization, access to credentials, and hook registration
421+
# in a single interface.
422+
#
423+
attr_reader :plugins
424+
415425
#
416426
# Sets whether anonymous contexts should be omitted from index and identify events.
417427
#

0 commit comments

Comments
 (0)