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

plugin-api 2.0 #2

Merged
merged 1 commit into from
May 6, 2016
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
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
sudo: false
jdk:
- oraclejdk8
language: ruby
cache: bundler
rvm:
- jruby-1.7.23
script:
- jruby-1.7.25
before_install:
- git clone -b feature/event_interface https://github.com/elastic/logstash
script:
- bundle exec rspec spec
8 changes: 7 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
source 'https://rubygems.org'
gemspec
gemspec

# this is temporary for the feature/plugin-api-2_0 branch and is meant for travis testing
gem "logstash-core", :path => "./logstash/logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash/logstash-core-plugin-api"
gem "logstash-core-event-java", :path => "./logstash/logstash-core-event-java"
gem "logstash-devutils", :github => "elastic/logstash-devutils", :branch => "feature/plugin-api-2_0"
2 changes: 1 addition & 1 deletion logstash-codec-plain.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "codec" }

# Gem dependencies
s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"

s.add_development_dependency 'logstash-devutils'
end
Expand Down
18 changes: 9 additions & 9 deletions spec/codecs/plain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
insist { data.encoding.name } == "UTF-8"
insist { data.valid_encoding? } == true
subject.decode(data) do |event|
insist { event["message"] } == data
insist { event["message"].encoding.name } == "UTF-8"
insist { event.get("message") } == data
insist { event.get("message").encoding.name } == "UTF-8"
end
end
end
Expand All @@ -30,8 +30,8 @@
insist { data.encoding.name } == "UTF-8"
insist { data.valid_encoding? } == false
subject.decode(data) do |event|
insist { event["message"] } == data.inspect[1..-2]
insist { event["message"].encoding.name } == "UTF-8"
insist { event.get("message") } == data.inspect[1..-2]
insist { event.get("message").encoding.name } == "UTF-8"
end
end
end
Expand All @@ -53,8 +53,8 @@
insist { a.valid_encoding? } == true

subject.decode(a) do |event|
insist { event["message"] } == b
insist { event["message"].encoding.name } == "UTF-8"
insist { event.get("message") } == b
insist { event.get("message").encoding.name } == "UTF-8"
end
end
end
Expand All @@ -75,8 +75,8 @@
insist { a.valid_encoding? } == true

subject.decode(a) do |event|
insist { event["message"] } == b
insist { event["message"].encoding.name } == "UTF-8"
insist { event.get("message") } == b
insist { event.get("message").encoding.name } == "UTF-8"
end
end
end
Expand All @@ -86,7 +86,7 @@
context "#encode" do
it "should return a plain text encoding" do
event = LogStash::Event.new
event["message"] = "Hello World."
event.set("message", "Hello World.")
subject.on_event do |event, data|
insist { data } == event.to_s
end
Expand Down