diff --git a/lib/pluginmanager/pack_installer/pack.rb b/lib/pluginmanager/pack_installer/pack.rb index 7b05db5988f..fd3c67ea6c2 100644 --- a/lib/pluginmanager/pack_installer/pack.rb +++ b/lib/pluginmanager/pack_installer/pack.rb @@ -39,7 +39,7 @@ class Pack class GemInformation EXTENSION = ".gem" SPLIT_CHAR = "-" - JAVA_PLATFORM_RE = /-java/ + JAVA_PLATFORM_RE = /-java$/ DEPENDENCIES_DIR_RE = /dependencies/ attr_reader :file, :name, :version, :platform diff --git a/spec/unit/plugin_manager/pack_installer/pack_spec.rb b/spec/unit/plugin_manager/pack_installer/pack_spec.rb index 5467dd2f835..de73a8cf174 100644 --- a/spec/unit/plugin_manager/pack_installer/pack_spec.rb +++ b/spec/unit/plugin_manager/pack_installer/pack_spec.rb @@ -113,4 +113,24 @@ expect(subject.plugin?).to be_falsey end end + + context "when it is Java plugin example from an offline zip file" do + let(:gem) { "/tmp/randomValue/randomValue2/logstash/logstash-filter-java_filter_example-1.0.5.gem"} + + it "#dependency? return false" do + expect(subject.dependency?).to be_falsey + end + + it "#plugin? return true" do + expect(subject.plugin?).to be_truthy + end + + it "returns the version" do + expect(subject.version).to eq("1.0.5") + end + + it "returns the name" do + expect(subject.name).to eq("logstash-filter-java_filter_example") + end + end end