Skip to content

Commit

Permalink
Anchor the -java match pattern at the end of the string. (#16626)
Browse files Browse the repository at this point in the history
This fixes the offline install problem of the logstash-input-java_filter_example off-line install.
  • Loading branch information
a03nikki authored Nov 5, 2024
1 parent 6703aec commit 113585d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pluginmanager/pack_installer/pack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions spec/unit/plugin_manager/pack_installer/pack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 113585d

Please sign in to comment.