Skip to content

Commit 3c645b1

Browse files
author
Zuhaib Siddique
committed
Merge branch 'master' of github.com:launchdarkly/ruby-client
2 parents 6c49856 + ba355ed commit 3c645b1

File tree

6 files changed

+50
-16
lines changed

6 files changed

+50
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Change log
22

33
All notable changes to the LaunchDarkly Ruby SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4+
## [2.2.5] - 2017-05-08
5+
## Changed
6+
- Added proxy support to streaming and http connections. Respects `HTTP_PROXY` and `http_proxy` environment variables as well as the `:proxy => protocol://user:pass@host` configuration parameter.
47

58
## [2.1.5] - 2017-03-28
69
## Changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ About LaunchDarkly
116116
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
117117
* LaunchDarkly provides feature flag SDKs for
118118
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
119-
* [JavaScript] (http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
120-
* [PHP] (http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
121-
* [Python] (http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
122-
* [Python Twisted] (http://docs.launchdarkly.com/docs/python-twisted-sdk-reference "LaunchDarkly Python Twisted SDK")
123-
* [Go] (http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
124-
* [Node.JS] (http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
125-
* [.NET] (http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
126-
* [Ruby] (http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
127-
* [iOS] (http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
128-
* [Android] (http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
119+
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
120+
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
121+
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
122+
* [Python Twisted](http://docs.launchdarkly.com/docs/python-twisted-sdk-reference "LaunchDarkly Python Twisted SDK")
123+
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
124+
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
125+
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
126+
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
127+
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
128+
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
129129
* Explore LaunchDarkly
130-
* [launchdarkly.com] (http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
131-
* [docs.launchdarkly.com] (http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
132-
* [apidocs.launchdarkly.com] (http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
133-
* [blog.launchdarkly.com] (http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
134-
* [Feature Flagging Guide] (https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
130+
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
131+
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
132+
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
133+
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
134+
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies

lib/ldclient-rb/config.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ def offline?
145145
#
146146
attr_reader :feature_store
147147

148+
<<<<<<< HEAD
149+
=======
150+
151+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
148152
# The proxy configuration string
149153
#
150154
attr_reader :proxy

lib/ldclient-rb/stream.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@ def start
2727
return unless @started.make_true
2828

2929
@config.logger.info("[LDClient] Initializing stream connection")
30+
<<<<<<< HEAD
3031
headers =
3132
{
3233
"Authorization" => @sdk_key,
3334
"User-Agent" => "RubyClient/" + LaunchDarkly::VERSION
3435
}
3536
opts = { headers: headers, with_credentials: true, proxy: @config.proxy }
37+
=======
38+
39+
headers =
40+
{
41+
'Authorization' => @sdk_key,
42+
'User-Agent' => 'RubyClient/' + LaunchDarkly::VERSION
43+
}
44+
opts = {:headers => headers, :with_credentials => true, :proxy => @config.proxy}
45+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
3646
@es = Celluloid::EventSource.new(@config.stream_uri + "/flags", opts) do |conn|
3747
conn.on(PUT) { |message| process_message(message, PUT) }
3848
conn.on(PATCH) { |message| process_message(message, PATCH) }

lib/ldclient-rb/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module LaunchDarkly
2-
VERSION = "2.1.5"
2+
VERSION = "2.2.5"
33
end

spec/requestor_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,25 @@
88
LaunchDarkly::Requestor.new(
99
"key",
1010
LaunchDarkly::Config.new({
11+
<<<<<<< HEAD
1112
proxy: "http://proxy.com",
1213
base_uri: "http://ld.com"
14+
=======
15+
:proxy => "http://proxy.com",
16+
:base_uri => "http://ld.com"
17+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
1318
})
1419
)
1520
}
1621
it "converts the proxy option" do
1722
faraday = Faraday.new
1823
requestor.instance_variable_set(:@client, faraday)
1924
allow(faraday).to receive(:get) do |*args, &block|
25+
<<<<<<< HEAD
2026
req = double(Faraday::Request, headers: {}, options: Faraday::RequestOptions.new)
27+
=======
28+
req = double(Faraday::Request, :headers => {}, :options => Faraday::RequestOptions.new)
29+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
2130
block.call(req)
2231
expect(args).to eq ['http://ld.com/sdk/latest-flags']
2332
expect(req.options.proxy[:uri]).to eq URI("http://proxy.com")
@@ -32,15 +41,23 @@
3241
LaunchDarkly::Requestor.new(
3342
"key",
3443
LaunchDarkly::Config.new({
44+
<<<<<<< HEAD
3545
base_uri: "http://ld.com"
46+
=======
47+
:base_uri => "http://ld.com"
48+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
3649
})
3750
)
3851
}
3952
it "converts the proxy option" do
4053
faraday = Faraday.new
4154
requestor.instance_variable_set(:@client, faraday)
4255
allow(faraday).to receive(:get) do |*args, &block|
56+
<<<<<<< HEAD
4357
req = double(Faraday::Request, headers: {}, options: Faraday::RequestOptions.new)
58+
=======
59+
req = double(Faraday::Request, :headers => {}, :options => Faraday::RequestOptions.new)
60+
>>>>>>> ba355ed1fc08c6162e2335f60480c0d658b04964
4461
block.call(req)
4562
expect(args).to eq ['http://ld.com/sdk/latest-flags']
4663
expect(req.options.proxy).to eq nil

0 commit comments

Comments
 (0)