forked from sidaf/homebrew-pentest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpscan.rb
40 lines (34 loc) · 1.33 KB
/
wpscan.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require "formula"
class Wpscan < Formula
homepage "https://github.com/wpscanteam/wpscan"
head 'https://github.com/wpscanteam/wpscan', :using => :git
url "https://github.com/wpscanteam/wpscan", :using => :git, :revision => '641108e'
version "2.9.3"
revision 1
depends_on "ruby@2.3"
depends_on "libxml2"
depends_on "libxslt"
depends_on "curl"
resource "bundler" do
url "https://rubygems.org/downloads/bundler-1.14.3.gem"
sha256 "9d61c7d983b99eb0b16d64658b182e045bcdd74ef3b139e849777f780782dbfe"
end
def install
(buildpath/"vendor/bundle").mkpath
resources.each do |r|
r.verify_download_integrity(r.fetch)
system("#{HOMEBREW_PREFIX}/opt/ruby@2.3/bin/gem", "install", r.cached_download, "--no-document",
"--install-dir", "vendor/bundle")
end
ENV["GEM_HOME"] = "#{buildpath}/vendor/bundle"
system "#{HOMEBREW_PREFIX}/opt/ruby@2.3/bin/ruby", "#{buildpath}/vendor/bundle/bin/bundle", "install", "--no-cache", "--path", "vendor/bundle"
(bin/"wpscan.rb").write <<~EOS
#!/usr/bin/env bash
export GEM_HOME="#{libexec}/vendor/bundle"
export BUNDLE_GEMFILE="#{libexec}/Gemfile"
#{libexec}/vendor/bundle/bin/bundle exec #{HOMEBREW_PREFIX}/opt/ruby@2.3/bin/ruby #{libexec}/wpscan.rb "$@"
EOS
libexec.install Dir['*']
libexec.install ".bundle"
end
end