Skip to content

Commit

Permalink
Merge pull request #54 from yads/fix-uri-opts
Browse files Browse the repository at this point in the history
fix to allow configuration of other values via uri
  • Loading branch information
dwbutler committed Jul 26, 2015
2 parents 8808751 + 7914136 commit 8d1dbbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit 8d1dbbb

Please sign in to comment.