Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix to allow configuration of other values via uri #54

Merged
merged 1 commit into from
Jul 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/logstash-logger/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def self.new(opts)

def self.build_device(opts)
if parsed_uri_opts = parse_uri_config(opts)
opts = parsed_uri_opts
opts.delete(:uri)
opts.merge!(parsed_uri_opts)
end

type = opts.delete(:type) || DEFAULT_TYPE
Expand Down
6 changes: 6 additions & 0 deletions spec/device_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
context "when URI config is redis" do
let(:uri_config) { redis_uri_config }
it { is_expected.to be_a LogStashLogger::Device::Redis }
context "list specified" do
let(:uri_config) { redis_uri_config.merge({list: 'mylist'}) }
it 'is expected to have the list option set' do
expect(new_device.list).to eq('mylist')
end
end
end

context "when URI config is kafka" do
Expand Down