Skip to content

Commit d2a02cc

Browse files
tonytaeli-darkly
authored andcommitted
Add autoloadability via Bundler.require (#137)
1 parent cd20729 commit d2a02cc

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

lib/launchdarkly-server-sdk.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require_relative "ldclient-rb"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require "spec_helper"
2+
require "bundler"
3+
4+
describe LaunchDarkly do
5+
it "can be automatically loaded by Bundler.require" do
6+
ldclient_loaded =
7+
Bundler.with_clean_env do
8+
Kernel.system("ruby", "./spec/launchdarkly-server-sdk_spec_autoloadtest.rb")
9+
end
10+
11+
expect(ldclient_loaded).to be true
12+
end
13+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require "bundler/setup"
2+
require "bundler/inline"
3+
4+
gemfile do
5+
gem "launchdarkly-server-sdk", path: "."
6+
end
7+
8+
Bundler.require(:development)
9+
abort unless $LOADED_FEATURES.any? { |file| file =~ /ldclient-rb\.rb/ }

0 commit comments

Comments
 (0)