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

orientdb 2.2.2 #2004

Closed
wants to merge 9 commits into from
34 changes: 28 additions & 6 deletions Formula/orientdb.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
class Orientdb < Formula
desc "Graph database"
homepage "https://orientdb.com"
url "https://orientdb.com/download.php?email=unknown@unknown.com&file=orientdb-community-2.1.16.tar.gz&os=mac"
version "2.1.16"
sha256 "41ad0db53c418459d0efbf6a7f7e2b39f48467f1ec582efa925ceb38de3f3cc6"
url "https://orientdb.com/download.php?file=orientdb-community-2.2.2.tar.gz"
sha256 "1ae672fc15638526980e132b92fe1896867fa765da79eadf5adf7cdcad946f88"

bottle do
cellar :any_skip_relocation
Expand All @@ -27,9 +26,16 @@ def install
chmod 0755, Dir["bin/*"]
libexec.install Dir["*"]

mkpath "#{libexec}/log"
touch "#{libexec}/log/orientdb.err"
touch "#{libexec}/log/orientdb.log"
(var/"db/orientdb").mkpath
(var/"log/orientdb").mkpath
(var/"run/orientdb").mkpath
touch "#{var}/log/orientdb/orientdb.err"
touch "#{var}/log/orientdb/orientdb.log"
inreplace "#{libexec}/config/orientdb-server-config.xml", "</properties>", " <entry name=\"server.database.path\" value=\"#{var}/db/orientdb\" />\n </properties>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use EOS.undent instead of \ns. Split this into multiple lines so it wraps at ~80 characters.

inreplace "#{libexec}/config/orientdb-server-log.properties", "../log", "#{var}/log/orientdb"
inreplace "#{libexec}/bin/orientdb.sh", "../log", "#{var}/log/orientdb"
inreplace "#{libexec}/bin/server.sh", "ORIENTDB_PID=$ORIENTDB_HOME/bin", "ORIENTDB_PID=#{var}/run/orientdb"
inreplace "#{libexec}/bin/shutdown.sh", "ORIENTDB_PID=$ORIENTDB_HOME/bin", "ORIENTDB_PID=#{var}/run/orientdb"

bin.install_symlink "#{libexec}/bin/orientdb.sh" => "orientdb"
bin.install_symlink "#{libexec}/bin/console.sh" => "orientdb-console"
Expand All @@ -39,4 +45,20 @@ def install
def caveats
"Use `orientdb <start | stop | status>`, `orientdb-console` and `orientdb-gremlin`."
end

test do
ENV["CONFIG_FILE"] = "#{testpath}/orientdb-server-config.xml"

cp "#{libexec}/config/orientdb-server-config.xml", testpath
inreplace "#{testpath}/orientdb-server-config.xml", "</properties>", " <entry name=\"server.database.path\" value=\"#{testpath}\" />\n </properties>"

system "#{bin}/orientdb", "start"
sleep 4

begin
assert_match "OrientDB Server v.2.2.2", shell_output("curl -I localhost:2480")
ensure
system "#{bin}/orientdb", "stop"
end
end
end