CombinedText stringlengths 4 3.42M |
|---|
class Mvnvm < Formula
desc "Maven version manager"
homepage "https://mvnvm.org/"
url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.14.tar.gz"
sha256 "09c61a1a7aa0b7e94db122d0b705267f22dce429d3bbcf2345b08ee7a92564c7"
license "Apache-2.0"
head "https://bitbucket.org/mjensen/mvnvm.git"
bottle :unneeded
depends_on "openjdk"
conflicts_with "maven", because: "also installs a 'mvn' executable"
def install
bin.install "mvn"
bin.install "mvnDebug"
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
end
test do
(testpath/"settings.xml").write <<~EOS
<settings><localRepository>#{testpath}/repository</localRepository></settings>
EOS
(testpath/"mvnvm.properties").write <<~EOS
mvn_version=3.5.2
EOS
(testpath/"pom.xml").write <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.homebrew</groupId>
<artifactId>maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>
EOS
(testpath/"src/main/java/org/homebrew/MavenTest.java").write <<~EOS
package org.homebrew;
public class MavenTest {
public static void main(String[] args) {
System.out.println("Testing Maven with Homebrew!");
}
}
EOS
system "#{bin}/mvn", "-gs", "#{testpath}/settings.xml", "compile"
end
end
mvnvm 1.0.15 (#77159)
class Mvnvm < Formula
desc "Maven version manager"
homepage "https://mvnvm.org/"
url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.15.tar.gz"
sha256 "2d2163b89d918e07146131407751eb7aff9c5fb5ae8c954b912e60860fb1c8ea"
license "Apache-2.0"
head "https://bitbucket.org/mjensen/mvnvm.git"
bottle :unneeded
depends_on "openjdk"
conflicts_with "maven", because: "also installs a 'mvn' executable"
def install
bin.install "mvn"
bin.install "mvnDebug"
bin.env_script_all_files libexec/"bin", Language::Java.overridable_java_home_env
end
test do
(testpath/"settings.xml").write <<~EOS
<settings><localRepository>#{testpath}/repository</localRepository></settings>
EOS
(testpath/"mvnvm.properties").write <<~EOS
mvn_version=3.5.2
EOS
(testpath/"pom.xml").write <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.homebrew</groupId>
<artifactId>maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>
EOS
(testpath/"src/main/java/org/homebrew/MavenTest.java").write <<~EOS
package org.homebrew;
public class MavenTest {
public static void main(String[] args) {
System.out.println("Testing Maven with Homebrew!");
}
}
EOS
system "#{bin}/mvn", "-gs", "#{testpath}/settings.xml", "compile"
end
end
|
class Mycli < Formula
include Language::Python::Virtualenv
desc "CLI for MySQL with auto-completion and syntax highlighting"
homepage "http://mycli.net/"
url "https://files.pythonhosted.org/packages/d3/ba/13b9ca22e77fbe6770c39c6fae912ec2fe95bbbbcc7b1ed287851f04c438/mycli-1.10.0.tar.gz"
sha256 "e3ff390c66dcd9ea15235ea36ee7ad26630197c21d95e78926df54f41ad1fcc7"
bottle do
cellar :any_skip_relocation
sha256 "536fd1d384ca20ac324faf71afd36ec6f843a1bff6d861115c019782eaf7decb" => :sierra
sha256 "56a3c12c4ed9992e7a56e05ed79528dc19793a18c830b454f60e867a342bd203" => :el_capitan
sha256 "b325516f12c51b385a5bf5f25a9f0503eac6dbd1369fd9cc6166041c95cfe80e" => :yosemite
end
depends_on :python
depends_on "openssl"
resource "click" do
url "https://files.pythonhosted.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz"
sha256 "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
end
resource "configobj" do
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
end
resource "prompt_toolkit" do
url "https://files.pythonhosted.org/packages/55/56/8c39509b614bda53e638b7500f12577d663ac1b868aef53426fc6a26c3f5/prompt_toolkit-1.0.14.tar.gz"
sha256 "cc66413b1b4b17021675d9f2d15d57e640b06ddfd99bb724c73484126d22622f"
end
resource "pycryptodome" do
url "https://files.pythonhosted.org/packages/45/ca/f0c2ca6c65084d60f68553cf072de7db0d918c7bb07ece88781f6af24625/pycryptodome-3.4.5.tar.gz"
sha256 "be84544eadc2bb71d4ace39e4984ed2990111f053f24267a07afb4b4e1e5428f"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz"
sha256 "dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
end
resource "PyMySQL" do
url "https://files.pythonhosted.org/packages/29/f8/919a28976bf0557b7819fd6935bfd839118aff913407ca58346e14fa6c86/PyMySQL-0.7.11.tar.gz"
sha256 "56e3f5bcef6501012233620b54f6a7b8a34edc5751e85e4e3da9a0d808df5f68"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
resource "sqlparse" do
url "https://files.pythonhosted.org/packages/45/67/14bdaeff492e6d03a055fe80502bae10b679891c25a0dc59be2fe51002f8/sqlparse-0.2.3.tar.gz"
sha256 "becd7cc7cebbdf311de8ceedfcf2bd2403297024418801947f8c953025beeff8"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz"
sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
end
def install
virtualenv_install_with_resources
end
test do
system bin/"mycli", "--help"
end
end
mycli 1.11.0
Closes #15523.
Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com>
class Mycli < Formula
include Language::Python::Virtualenv
desc "CLI for MySQL with auto-completion and syntax highlighting"
homepage "http://mycli.net/"
url "https://files.pythonhosted.org/packages/7a/b6/332fa148e50c976f49a94deced0c572c243766bf817ceb5b6053276bb370/mycli-1.11.0.tar.gz"
sha256 "0e27ad54e59c5e13ac30ed4bf53556ef57813c38edb56ad099ffad7bc18918de"
bottle do
cellar :any_skip_relocation
sha256 "536fd1d384ca20ac324faf71afd36ec6f843a1bff6d861115c019782eaf7decb" => :sierra
sha256 "56a3c12c4ed9992e7a56e05ed79528dc19793a18c830b454f60e867a342bd203" => :el_capitan
sha256 "b325516f12c51b385a5bf5f25a9f0503eac6dbd1369fd9cc6166041c95cfe80e" => :yosemite
end
depends_on :python
depends_on "openssl"
resource "asn1crypto" do
url "https://files.pythonhosted.org/packages/67/14/5d66588868c4304f804ebaff9397255f6ec5559e46724c2496e0f26e68d6/asn1crypto-0.22.0.tar.gz"
sha256 "cbbadd640d3165ab24b06ef25d1dca09a3441611ac15f6a6b452474fdf0aed1a"
end
resource "backports.csv" do
url "https://files.pythonhosted.org/packages/6a/0b/2071ad285e87dd26f5c02147ba13abf7ec777ff20416a60eb15ea204ca76/backports.csv-1.0.5.tar.gz"
sha256 "8c421385cbc6042ba90c68c871c5afc13672acaf91e1508546d6cda6725ebfc6"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/5b/b9/790f8eafcdab455bcd3bd908161f802c9ce5adbf702a83aa7712fcc345b7/cffi-1.10.0.tar.gz"
sha256 "b3b02911eb1f6ada203b0763ba924234629b51586f72a21faacc638269f4ced5"
end
resource "cli_helpers" do
url "https://files.pythonhosted.org/packages/2b/7e/307131c2c3f3abef2d1e68b7088882c078da6ce5bb57cbe79bac12718c72/cli_helpers-0.2.1.tar.gz"
sha256 "a868e69e780c1fd5091c83e784e8b18e2005cab921f1dfda4ffd376271ee85ac"
end
resource "click" do
url "https://files.pythonhosted.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz"
sha256 "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
end
resource "configobj" do
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/2a/0c/31bd69469e90035381f0197b48bf71032991d9f07a7e444c311b4a23a3df/cryptography-1.9.tar.gz"
sha256 "5518337022718029e367d982642f3e3523541e098ad671672a90b82474c84882"
end
resource "enum34" do
url "https://files.pythonhosted.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz"
sha256 "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/d8/82/28a51052215014efc07feac7330ed758702fc0581347098a81699b5281cb/idna-2.5.tar.gz"
sha256 "3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab"
end
resource "ipaddress" do
url "https://files.pythonhosted.org/packages/4e/13/774faf38b445d0b3a844b65747175b2e0500164b7c28d78e34987a5bfe06/ipaddress-1.0.18.tar.gz"
sha256 "5d8534c8e185f2d8a1fda1ef73f2c8f4b23264e8e30063feeb9511d492a413e1"
end
resource "prompt_toolkit" do
url "https://files.pythonhosted.org/packages/55/56/8c39509b614bda53e638b7500f12577d663ac1b868aef53426fc6a26c3f5/prompt_toolkit-1.0.14.tar.gz"
sha256 "cc66413b1b4b17021675d9f2d15d57e640b06ddfd99bb724c73484126d22622f"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/be/64/1bb257ffb17d01f4a38d7ce686809a736837ad4371bcc5c42ba7a715c3ac/pycparser-2.17.tar.gz"
sha256 "0aac31e917c24cb3357f5a4d5566f2cc91a19ca41862f6c3c22dc60a629673b6"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/71/2a/2e4e77803a8bd6408a2903340ac498cb0a2181811af7c9ec92cb70b0308a/Pygments-2.2.0.tar.gz"
sha256 "dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
end
resource "PyMySQL" do
url "https://files.pythonhosted.org/packages/29/f8/919a28976bf0557b7819fd6935bfd839118aff913407ca58346e14fa6c86/PyMySQL-0.7.11.tar.gz"
sha256 "56e3f5bcef6501012233620b54f6a7b8a34edc5751e85e4e3da9a0d808df5f68"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
resource "sqlparse" do
url "https://files.pythonhosted.org/packages/45/67/14bdaeff492e6d03a055fe80502bae10b679891c25a0dc59be2fe51002f8/sqlparse-0.2.3.tar.gz"
sha256 "becd7cc7cebbdf311de8ceedfcf2bd2403297024418801947f8c953025beeff8"
end
resource "terminaltables" do
url "https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bff/terminaltables-3.1.0.tar.gz"
sha256 "f3eb0eb92e3833972ac36796293ca0906e998dc3be91fbe1f8615b331b853b81"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/55/11/e4a2bb08bb450fdbd42cc709dd40de4ed2c472cf0ccb9e64af22279c5495/wcwidth-0.1.7.tar.gz"
sha256 "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
end
def install
virtualenv_install_with_resources
end
test do
system bin/"mycli", "--help"
end
end
|
class Myman < Formula
desc "Text-mode videogame inspired by Namco's Pac-Man"
homepage "https://myman.sourceforge.io/"
url "https://downloads.sourceforge.net/project/myman/myman-cvs/myman-cvs-2009-10-30/myman-wip-2009-10-30.tar.gz"
sha256 "bf69607eabe4c373862c81bf56756f2a96eecb8eaa8c911bb2abda78b40c6d73"
head ":pserver:anonymous:@myman.cvs.sourceforge.net:/cvsroot/myman", using: :cvs
bottle do
rebuild 2
sha256 arm64_monterey: "7572bde41926ba4a33b300b0e43b890648fb8d19e47e4a50b43608e99c9b8e9a"
sha256 arm64_big_sur: "a38be300e040956aa8f9d997a715c91152868d5aeaadc6406330729523036828"
sha256 monterey: "0b4412e46e30f8970f331f4948e3210b956abceceebbb0b480ace2af2fa3973a"
sha256 big_sur: "651100d0ad19af5ef07a55c1bd0d728211d8810e9da024d9344f3ed5c024e46b"
sha256 catalina: "90c5dee20ff2517495521e588b09678789462a8a63dc6a600da13a76cb5e86b0"
sha256 mojave: "1ff1470d676dabb177f06c2683b67da5e70e39bbab28f7457762d4adda5cffb0"
sha256 high_sierra: "b5f0af51ce1098ea35e48bc50f4097cbb9e647989decd6d7791476b062ef7582"
sha256 sierra: "376c71ad2f5abcc0233b3873d70cc963e54ac0ca00a552eceb025ac09b931ff6"
sha256 el_capitan: "d3b66de7eae03edecb2573524d94239bd013ffd57eeb1980411da12f6d2b2b98"
sha256 yosemite: "b318e0b227a3ad281afe95edc5a0cc7ab0b1d5e46b1699e6221eb201de869b48"
sha256 x86_64_linux: "28f96eb2fba35b8c50f166eecd9b48dc8336229e97425f290209d15e9526eeeb"
end
depends_on "groff" => :build
uses_from_macos "ncurses"
on_macos do
depends_on "coreutils" => :build
depends_on "gnu-sed" => :build
end
on_linux do
depends_on "util-linux" => :build # for `col`
end
def install
if OS.mac?
ENV["RMDIR"] = "grmdir"
ENV["SED"] = "gsed"
ENV["INSTALL"] = "ginstall"
end
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
system bin/"myman", "-k"
end
end
myman: remove Yosemite bottle
Yosemite support was removed in Homebrew 3.5.0.
class Myman < Formula
desc "Text-mode videogame inspired by Namco's Pac-Man"
homepage "https://myman.sourceforge.io/"
url "https://downloads.sourceforge.net/project/myman/myman-cvs/myman-cvs-2009-10-30/myman-wip-2009-10-30.tar.gz"
sha256 "bf69607eabe4c373862c81bf56756f2a96eecb8eaa8c911bb2abda78b40c6d73"
head ":pserver:anonymous:@myman.cvs.sourceforge.net:/cvsroot/myman", using: :cvs
bottle do
rebuild 2
sha256 arm64_monterey: "7572bde41926ba4a33b300b0e43b890648fb8d19e47e4a50b43608e99c9b8e9a"
sha256 arm64_big_sur: "a38be300e040956aa8f9d997a715c91152868d5aeaadc6406330729523036828"
sha256 monterey: "0b4412e46e30f8970f331f4948e3210b956abceceebbb0b480ace2af2fa3973a"
sha256 big_sur: "651100d0ad19af5ef07a55c1bd0d728211d8810e9da024d9344f3ed5c024e46b"
sha256 catalina: "90c5dee20ff2517495521e588b09678789462a8a63dc6a600da13a76cb5e86b0"
sha256 mojave: "1ff1470d676dabb177f06c2683b67da5e70e39bbab28f7457762d4adda5cffb0"
sha256 high_sierra: "b5f0af51ce1098ea35e48bc50f4097cbb9e647989decd6d7791476b062ef7582"
sha256 sierra: "376c71ad2f5abcc0233b3873d70cc963e54ac0ca00a552eceb025ac09b931ff6"
sha256 el_capitan: "d3b66de7eae03edecb2573524d94239bd013ffd57eeb1980411da12f6d2b2b98"
sha256 x86_64_linux: "28f96eb2fba35b8c50f166eecd9b48dc8336229e97425f290209d15e9526eeeb"
end
depends_on "groff" => :build
uses_from_macos "ncurses"
on_macos do
depends_on "coreutils" => :build
depends_on "gnu-sed" => :build
end
on_linux do
depends_on "util-linux" => :build # for `col`
end
def install
if OS.mac?
ENV["RMDIR"] = "grmdir"
ENV["SED"] = "gsed"
ENV["INSTALL"] = "ginstall"
end
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
system bin/"myman", "-k"
end
end
|
class Mysql < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/5.7/en/"
url "https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.15.tar.gz"
sha256 "7342a3a3e40878378dfaee252d42a3a5b06c58237f49c2544424d27316738945"
bottle do
sha256 "84f562c4eda4ce7ecf89f38f480f8a27f23a7500fd0a1b13daadcb16308bc00e" => :sierra
sha256 "378bf7d07c791ee5144a958f1395fdb8838f29b2358ee927f9bc0e3f0673f66d" => :el_capitan
sha256 "03df7e5ebba4674d75c6ec8c5ae68f0ea6df339595c3a5434740ce545296ccbe" => :yosemite
sha256 "cf205231fd0bd4177bf3a94761d4dcc6985d1eb7597592f8e4947e826acf7fd2" => :mavericks
end
option "with-test", "Build with unit tests"
option "with-embedded", "Build the embedded server"
option "with-archive-storage-engine", "Compile with the ARCHIVE storage engine enabled"
option "with-blackhole-storage-engine", "Compile with the BLACKHOLE storage engine enabled"
option "with-local-infile", "Build with local infile loading support"
option "with-debug", "Build with debug support"
deprecated_option "enable-local-infile" => "with-local-infile"
deprecated_option "enable-debug" => "with-debug"
deprecated_option "with-tests" => "with-test"
depends_on "cmake" => :build
depends_on "pidof" unless MacOS.version >= :mountain_lion
depends_on "openssl"
# https://github.com/Homebrew/homebrew-core/issues/1475
# Needs at least Clang 3.3, which shipped alongside Lion.
# Note: MySQL themselves don't support anything below Mavericks.
depends_on :macos => :lion
conflicts_with "mysql-cluster", "mariadb", "percona-server",
:because => "mysql, mariadb, and percona install the same binaries."
conflicts_with "mysql-connector-c",
:because => "both install MySQL client libraries"
conflicts_with "mariadb-connector-c",
:because => "both install plugins"
fails_with :llvm do
build 2326
cause "https://github.com/Homebrew/homebrew/issues/issue/144"
end
def datadir
var/"mysql"
end
def install
# Don't hard-code the libtool path. See:
# https://github.com/Homebrew/homebrew/issues/20185
inreplace "cmake/libutils.cmake",
"COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}",
"COMMAND libtool -static -o ${TARGET_LOCATION}"
# Build without compiler or CPU specific optimization flags to facilitate
# compilation of gems and other software that queries `mysql-config`.
ENV.minimal_optimization
# -DINSTALL_* are relative to `CMAKE_INSTALL_PREFIX` (`prefix`)
args = %W[
-DMYSQL_DATADIR=#{datadir}
-DINSTALL_INCLUDEDIR=include/mysql
-DINSTALL_MANDIR=share/man
-DINSTALL_DOCDIR=share/doc/#{name}
-DINSTALL_INFODIR=share/info
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DWITH_SSL=yes
-DWITH_SSL=system
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DSYSCONFDIR=#{etc}
-DCOMPILATION_COMMENT=Homebrew
-DWITH_EDITLINE=system
-DWITH_BOOST=boost
]
# To enable unit testing at build, we need to download the unit testing suite
if build.with? "test"
args << "-DENABLE_DOWNLOADS=ON"
else
args << "-DWITH_UNIT_TESTS=OFF"
end
# Build the embedded server
args << "-DWITH_EMBEDDED_SERVER=ON" if build.with? "embedded"
# Compile with ARCHIVE engine enabled if chosen
args << "-DWITH_ARCHIVE_STORAGE_ENGINE=1" if build.with? "archive-storage-engine"
# Compile with BLACKHOLE engine enabled if chosen
args << "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" if build.with? "blackhole-storage-engine"
# Make universal for binding to universal applications
if build.universal?
ENV.universal_binary
args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.universal_archs.as_cmake_arch_flags}"
end
# Build with local infile loading support
args << "-DENABLED_LOCAL_INFILE=1" if build.with? "local-infile"
# Build with debug support
args << "-DWITH_DEBUG=1" if build.with? "debug"
system "cmake", ".", *std_cmake_args, *args
system "make"
system "make", "install"
# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
# Perl script was removed in 5.7.9 so install C++ binary instead.
# Binary is deprecated & will be removed in future upstream
# update but is still required for mysql-test-run to pass in test.
(prefix/"scripts").install "client/mysql_install_db"
bin.install_symlink prefix/"scripts/mysql_install_db"
# Fix up the control script and link into bin
inreplace "#{prefix}/support-files/mysql.server" do |s|
s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2")
# pidof can be replaced with pgrep from proctools on Mountain Lion
s.gsub!(/pidof/, "pgrep") if MacOS.version >= :mountain_lion
end
bin.install_symlink prefix/"support-files/mysql.server"
end
def post_install
# Make sure the datadir exists
datadir.mkpath
unless (datadir/"mysql/user.frm").exist?
ENV["TMPDIR"] = nil
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{datadir}", "--tmpdir=/tmp"
end
end
def caveats
s = <<-EOS.undent
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect run:
mysql -uroot
EOS
if File.exist? "/etc/my.cnf"
s += <<-EOS.undent
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end
s
end
plist_options :manual => "mysql.server start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/mysqld_safe</string>
<string>--bind-address=127.0.0.1</string>
<string>--datadir=#{datadir}</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{datadir}</string>
</dict>
</plist>
EOS
end
test do
system "/bin/sh", "-n", "#{bin}/mysqld_safe"
(prefix/"mysql-test").cd do
system "./mysql-test-run.pl", "status", "--vardir=#{testpath}"
end
end
end
mysql 5.7.16
Closes #5945.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
class Mysql < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/5.7/en/"
url "https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-boost-5.7.16.tar.gz"
sha256 "43fc282f807353ff77ead21efb5f85f7f214c2a5362762a8cc370ae1c075095a"
bottle do
sha256 "84f562c4eda4ce7ecf89f38f480f8a27f23a7500fd0a1b13daadcb16308bc00e" => :sierra
sha256 "378bf7d07c791ee5144a958f1395fdb8838f29b2358ee927f9bc0e3f0673f66d" => :el_capitan
sha256 "03df7e5ebba4674d75c6ec8c5ae68f0ea6df339595c3a5434740ce545296ccbe" => :yosemite
sha256 "cf205231fd0bd4177bf3a94761d4dcc6985d1eb7597592f8e4947e826acf7fd2" => :mavericks
end
option "with-test", "Build with unit tests"
option "with-embedded", "Build the embedded server"
option "with-archive-storage-engine", "Compile with the ARCHIVE storage engine enabled"
option "with-blackhole-storage-engine", "Compile with the BLACKHOLE storage engine enabled"
option "with-local-infile", "Build with local infile loading support"
option "with-debug", "Build with debug support"
deprecated_option "enable-local-infile" => "with-local-infile"
deprecated_option "enable-debug" => "with-debug"
deprecated_option "with-tests" => "with-test"
depends_on "cmake" => :build
depends_on "pidof" unless MacOS.version >= :mountain_lion
depends_on "openssl"
# https://github.com/Homebrew/homebrew-core/issues/1475
# Needs at least Clang 3.3, which shipped alongside Lion.
# Note: MySQL themselves don't support anything below Mavericks.
depends_on :macos => :lion
conflicts_with "mysql-cluster", "mariadb", "percona-server",
:because => "mysql, mariadb, and percona install the same binaries."
conflicts_with "mysql-connector-c",
:because => "both install MySQL client libraries"
conflicts_with "mariadb-connector-c",
:because => "both install plugins"
fails_with :llvm do
build 2326
cause "https://github.com/Homebrew/homebrew/issues/issue/144"
end
def datadir
var/"mysql"
end
def install
# Don't hard-code the libtool path. See:
# https://github.com/Homebrew/homebrew/issues/20185
inreplace "cmake/libutils.cmake",
"COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}",
"COMMAND libtool -static -o ${TARGET_LOCATION}"
# Build without compiler or CPU specific optimization flags to facilitate
# compilation of gems and other software that queries `mysql-config`.
ENV.minimal_optimization
# -DINSTALL_* are relative to `CMAKE_INSTALL_PREFIX` (`prefix`)
args = %W[
-DMYSQL_DATADIR=#{datadir}
-DINSTALL_INCLUDEDIR=include/mysql
-DINSTALL_MANDIR=share/man
-DINSTALL_DOCDIR=share/doc/#{name}
-DINSTALL_INFODIR=share/info
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DWITH_SSL=yes
-DWITH_SSL=system
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DSYSCONFDIR=#{etc}
-DCOMPILATION_COMMENT=Homebrew
-DWITH_EDITLINE=system
-DWITH_BOOST=boost
]
# To enable unit testing at build, we need to download the unit testing suite
if build.with? "test"
args << "-DENABLE_DOWNLOADS=ON"
else
args << "-DWITH_UNIT_TESTS=OFF"
end
# Build the embedded server
args << "-DWITH_EMBEDDED_SERVER=ON" if build.with? "embedded"
# Compile with ARCHIVE engine enabled if chosen
args << "-DWITH_ARCHIVE_STORAGE_ENGINE=1" if build.with? "archive-storage-engine"
# Compile with BLACKHOLE engine enabled if chosen
args << "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" if build.with? "blackhole-storage-engine"
# Make universal for binding to universal applications
if build.universal?
ENV.universal_binary
args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.universal_archs.as_cmake_arch_flags}"
end
# Build with local infile loading support
args << "-DENABLED_LOCAL_INFILE=1" if build.with? "local-infile"
# Build with debug support
args << "-DWITH_DEBUG=1" if build.with? "debug"
system "cmake", ".", *std_cmake_args, *args
system "make"
system "make", "install"
# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
# Perl script was removed in 5.7.9 so install C++ binary instead.
# Binary is deprecated & will be removed in future upstream
# update but is still required for mysql-test-run to pass in test.
(prefix/"scripts").install "client/mysql_install_db"
bin.install_symlink prefix/"scripts/mysql_install_db"
# Fix up the control script and link into bin
inreplace "#{prefix}/support-files/mysql.server" do |s|
s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2")
# pidof can be replaced with pgrep from proctools on Mountain Lion
s.gsub!(/pidof/, "pgrep") if MacOS.version >= :mountain_lion
end
bin.install_symlink prefix/"support-files/mysql.server"
end
def post_install
# Make sure the datadir exists
datadir.mkpath
unless (datadir/"mysql/user.frm").exist?
ENV["TMPDIR"] = nil
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{datadir}", "--tmpdir=/tmp"
end
end
def caveats
s = <<-EOS.undent
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect run:
mysql -uroot
EOS
if File.exist? "/etc/my.cnf"
s += <<-EOS.undent
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end
s
end
plist_options :manual => "mysql.server start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/mysqld_safe</string>
<string>--bind-address=127.0.0.1</string>
<string>--datadir=#{datadir}</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{datadir}</string>
</dict>
</plist>
EOS
end
test do
system "/bin/sh", "-n", "#{bin}/mysqld_safe"
(prefix/"mysql-test").cd do
system "./mysql-test-run.pl", "status", "--vardir=#{testpath}"
end
end
end
|
class Mysql < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/8.0/en/"
url "https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-8.0.30.tar.gz"
sha256 "c331ac7a68099a2116097acbb14fd331423d486fe47ce0e346925111b44df69c"
license "GPL-2.0-only" => { with: "Universal-FOSS-exception-1.0" }
revision 1
livecheck do
url "https://dev.mysql.com/downloads/mysql/?tpl=files&os=src"
regex(/href=.*?mysql[._-](?:boost[._-])?v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "087a0ccf2725c577cfe4de6c44d6517145e5a8bfa2bf926ab32b378e0acf4dd6"
sha256 arm64_big_sur: "6078d657be355c5080a14f2a9a600816c9fdc130530ee0d044d3ffafd0d279a9"
sha256 monterey: "084a01b67a7bb5d5fd171a4c318de5f9a621487b19bff7737252e549cbf9c5fe"
sha256 big_sur: "aae3214fe212112289a5e7557d69533409976a60cfb331080f0ca460d3bb0d0f"
sha256 catalina: "f9309cdf8443ac1b763925d275180cc369d59b37fdf268044f2ed5b1ed749833"
sha256 x86_64_linux: "51d635cbaaee4370c605fbb58186983ad5e4e5790a990a682f6e28758d97ca19"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "icu4c"
depends_on "libevent"
depends_on "libfido2"
depends_on "lz4"
depends_on "openssl@1.1"
depends_on "protobuf"
depends_on "zlib" # Zlib 1.2.12+
depends_on "zstd"
uses_from_macos "curl"
uses_from_macos "cyrus-sasl"
uses_from_macos "libedit"
on_linux do
depends_on "patchelf" => :build
depends_on "gcc" # for C++17
end
conflicts_with "mariadb", "percona-server",
because: "mysql, mariadb, and percona install the same binaries"
fails_with gcc: "5"
# Patch out check for Homebrew `boost`.
# This should not be necessary when building inside `brew`.
# https://github.com/Homebrew/homebrew-test-bot/pull/820
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/030f7433e89376ffcff836bb68b3903ab90f9cdc/mysql/boost-check.patch"
sha256 "af27e4b82c84f958f91404a9661e999ccd1742f57853978d8baec2f993b51153"
end
def datadir
var/"mysql"
end
def install
if OS.linux?
# Fix libmysqlgcs.a(gcs_logging.cc.o): relocation R_X86_64_32
# against `_ZN17Gcs_debug_options12m_debug_noneB5cxx11E' can not be used when making
# a shared object; recompile with -fPIC
ENV.append_to_cflags "-fPIC"
# Disable ABI checking
inreplace "cmake/abi_check.cmake", "RUN_ABI_CHECK 1", "RUN_ABI_CHECK 0"
end
# -DINSTALL_* are relative to `CMAKE_INSTALL_PREFIX` (`prefix`)
args = %W[
-DFORCE_INSOURCE_BUILD=1
-DCOMPILATION_COMMENT=Homebrew
-DINSTALL_DOCDIR=share/doc/#{name}
-DINSTALL_INCLUDEDIR=include/mysql
-DINSTALL_INFODIR=share/info
-DINSTALL_MANDIR=share/man
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DINSTALL_PLUGINDIR=lib/plugin
-DMYSQL_DATADIR=#{datadir}
-DSYSCONFDIR=#{etc}
-DWITH_SYSTEM_LIBS=ON
-DWITH_BOOST=boost
-DWITH_EDITLINE=system
-DWITH_FIDO=system
-DWITH_ICU=system
-DWITH_LIBEVENT=system
-DWITH_LZ4=system
-DWITH_PROTOBUF=system
-DWITH_SSL=system
-DWITH_ZLIB=system
-DWITH_ZSTD=system
-DWITH_UNIT_TESTS=OFF
-DENABLED_LOCAL_INFILE=1
-DWITH_INNODB_MEMCACHED=ON
]
system "cmake", ".", *std_cmake_args, *args
system "make"
system "make", "install"
(prefix/"mysql-test").cd do
system "./mysql-test-run.pl", "status", "--vardir=#{Dir.mktmpdir}"
end
# Remove the tests directory
rm_rf prefix/"mysql-test"
# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
# Fix up the control script and link into bin.
inreplace "#{prefix}/support-files/mysql.server",
/^(PATH=".*)(")/,
"\\1:#{HOMEBREW_PREFIX}/bin\\2"
bin.install_symlink prefix/"support-files/mysql.server"
# Install my.cnf that binds to 127.0.0.1 by default
(buildpath/"my.cnf").write <<~EOS
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
EOS
etc.install "my.cnf"
end
def post_install
# Make sure the var/mysql directory exists
(var/"mysql").mkpath
# Don't initialize database, it clashes when testing other MySQL-like implementations.
return if ENV["HOMEBREW_GITHUB_ACTIONS"]
unless (datadir/"mysql/general_log.CSM").exist?
ENV["TMPDIR"] = nil
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{datadir}", "--tmpdir=/tmp"
end
end
def caveats
s = <<~EOS
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
EOS
if (my_cnf = ["/etc/my.cnf", "/etc/mysql/my.cnf"].find { |x| File.exist? x })
s += <<~EOS
A "#{my_cnf}" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end
s
end
service do
run [opt_bin/"mysqld_safe", "--datadir=#{var}/mysql"]
keep_alive true
working_dir var/"mysql"
end
test do
(testpath/"mysql").mkpath
(testpath/"tmp").mkpath
system bin/"mysqld", "--no-defaults", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{testpath}/mysql", "--tmpdir=#{testpath}/tmp"
port = free_port
fork do
system "#{bin}/mysqld", "--no-defaults", "--user=#{ENV["USER"]}",
"--datadir=#{testpath}/mysql", "--port=#{port}", "--tmpdir=#{testpath}/tmp"
end
sleep 5
assert_match "information_schema",
shell_output("#{bin}/mysql --port=#{port} --user=root --password= --execute='show databases;'")
system "#{bin}/mysqladmin", "--port=#{port}", "--user=root", "--password=", "shutdown"
end
end
Fixed a typo
class Mysql < Formula
desc "Open source relational database management system"
homepage "https://dev.mysql.com/doc/refman/8.0/en/"
url "https://cdn.mysql.com/Downloads/MySQL-8.0/mysql-boost-8.0.30.tar.gz"
sha256 "c331ac7a68099a2116097acbb14fd331423d486fe47ce0e346925111b44df69c"
license "GPL-2.0-only" => { with: "Universal-FOSS-exception-1.0" }
revision 1
livecheck do
url "https://dev.mysql.com/downloads/mysql/?tpl=files&os=src"
regex(/href=.*?mysql[._-](?:boost[._-])?v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "087a0ccf2725c577cfe4de6c44d6517145e5a8bfa2bf926ab32b378e0acf4dd6"
sha256 arm64_big_sur: "6078d657be355c5080a14f2a9a600816c9fdc130530ee0d044d3ffafd0d279a9"
sha256 monterey: "084a01b67a7bb5d5fd171a4c318de5f9a621487b19bff7737252e549cbf9c5fe"
sha256 big_sur: "aae3214fe212112289a5e7557d69533409976a60cfb331080f0ca460d3bb0d0f"
sha256 catalina: "f9309cdf8443ac1b763925d275180cc369d59b37fdf268044f2ed5b1ed749833"
sha256 x86_64_linux: "51d635cbaaee4370c605fbb58186983ad5e4e5790a990a682f6e28758d97ca19"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "icu4c"
depends_on "libevent"
depends_on "libfido2"
depends_on "lz4"
depends_on "openssl@1.1"
depends_on "protobuf"
depends_on "zlib" # Zlib 1.2.12+
depends_on "zstd"
uses_from_macos "curl"
uses_from_macos "cyrus-sasl"
uses_from_macos "libedit"
on_linux do
depends_on "patchelf" => :build
depends_on "gcc" # for C++17
end
conflicts_with "mariadb", "percona-server",
because: "mysql, mariadb, and percona install the same binaries"
fails_with gcc: "5"
# Patch out check for Homebrew `boost`.
# This should not be necessary when building inside `brew`.
# https://github.com/Homebrew/homebrew-test-bot/pull/820
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/030f7433e89376ffcff836bb68b3903ab90f9cdc/mysql/boost-check.patch"
sha256 "af27e4b82c84f958f91404a9661e999ccd1742f57853978d8baec2f993b51153"
end
def datadir
var/"mysql"
end
def install
if OS.linux?
# Fix libmysqlgcs.a(gcs_logging.cc.o): relocation R_X86_64_32
# against `_ZN17Gcs_debug_options12m_debug_noneB5cxx11E' can not be used when making
# a shared object; recompile with -fPIC
ENV.append_to_cflags "-fPIC"
# Disable ABI checking
inreplace "cmake/abi_check.cmake", "RUN_ABI_CHECK 1", "RUN_ABI_CHECK 0"
end
# -DINSTALL_* are relative to `CMAKE_INSTALL_PREFIX` (`prefix`)
args = %W[
-DFORCE_INSOURCE_BUILD=1
-DCOMPILATION_COMMENT=Homebrew
-DINSTALL_DOCDIR=share/doc/#{name}
-DINSTALL_INCLUDEDIR=include/mysql
-DINSTALL_INFODIR=share/info
-DINSTALL_MANDIR=share/man
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DINSTALL_PLUGINDIR=lib/plugin
-DMYSQL_DATADIR=#{datadir}
-DSYSCONFDIR=#{etc}
-DWITH_SYSTEM_LIBS=ON
-DWITH_BOOST=boost
-DWITH_EDITLINE=system
-DWITH_FIDO=system
-DWITH_ICU=system
-DWITH_LIBEVENT=system
-DWITH_LZ4=system
-DWITH_PROTOBUF=system
-DWITH_SSL=system
-DWITH_ZLIB=system
-DWITH_ZSTD=system
-DWITH_UNIT_TESTS=OFF
-DENABLED_LOCAL_INFILE=1
-DWITH_INNODB_MEMCACHED=ON
]
system "cmake", ".", *std_cmake_args, *args
system "make"
system "make", "install"
(prefix/"mysql-test").cd do
system "./mysql-test-run.pl", "status", "--vardir=#{Dir.mktmpdir}"
end
# Remove the tests directory
rm_rf prefix/"mysql-test"
# Don't create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
rm_rf prefix/"data"
# Fix up the control script and link into bin.
inreplace "#{prefix}/support-files/mysql.server",
/^(PATH=".*)(")/,
"\\1:#{HOMEBREW_PREFIX}/bin\\2"
bin.install_symlink prefix/"support-files/mysql.server"
# Install my.cnf that binds to 127.0.0.1 by default
(buildpath/"my.cnf").write <<~EOS
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
EOS
etc.install "my.cnf"
end
def post_install
# Make sure the var/mysql directory exists
(var/"mysql").mkpath
# Don't initialize database, it clashes when testing other MySQL-like implementations.
return if ENV["HOMEBREW_GITHUB_ACTIONS"]
unless (datadir/"mysql/general_log.CSM").exist?
ENV["TMPDIR"] = nil
system bin/"mysqld", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{datadir}", "--tmpdir=/tmp"
end
end
def caveats
s = <<~EOS
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -u root
EOS
if (my_cnf = ["/etc/my.cnf", "/etc/mysql/my.cnf"].find { |x| File.exist? x })
s += <<~EOS
A "#{my_cnf}" from another install may interfere with a Homebrew-built
server starting up correctly.
EOS
end
s
end
service do
run [opt_bin/"mysqld_safe", "--datadir=#{var}/mysql"]
keep_alive true
working_dir var/"mysql"
end
test do
(testpath/"mysql").mkpath
(testpath/"tmp").mkpath
system bin/"mysqld", "--no-defaults", "--initialize-insecure", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{testpath}/mysql", "--tmpdir=#{testpath}/tmp"
port = free_port
fork do
system "#{bin}/mysqld", "--no-defaults", "--user=#{ENV["USER"]}",
"--datadir=#{testpath}/mysql", "--port=#{port}", "--tmpdir=#{testpath}/tmp"
end
sleep 5
assert_match "information_schema",
shell_output("#{bin}/mysql --port=#{port} --user=root --password= --execute='show databases;'")
system "#{bin}/mysqladmin", "--port=#{port}", "--user=root", "--password=", "shutdown"
end
end
|
class Nauty < Formula
desc "Automorphism groups of graphs and digraphs"
homepage "https://pallini.di.uniroma1.it/"
url "https://pallini.di.uniroma1.it/nauty27r1.tar.gz"
version "27r1"
sha256 "76ca5d196e402c83a987f90c28ff706bcc5a333bb4a8fbb979a62d3b99c34e77"
livecheck do
url :homepage
regex(/href=.*?nauty[._-]?v?(\d+(?:\.\d+)*(?:r\d+)?)\.t/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "6d7980d67e772addbc5220e4536a1193580253ae2a52fbc7182d12eb73573c6b"
sha256 cellar: :any_skip_relocation, big_sur: "8714e05e1d050933e8571cca1c388a088d11170757fa5b1ae3fe5be7f490f6b5"
sha256 cellar: :any_skip_relocation, catalina: "5d118260b6fdabceb476c1421e4b4dd41d3027943b623ff7a4dc81baf6e284b9"
sha256 cellar: :any_skip_relocation, mojave: "2fa3783663f6e67d9a6e42c492c68412fdeeff7201d81e557b75927ff50b78f1"
sha256 cellar: :any_skip_relocation, high_sierra: "a5333c52eecb023c23be9638ebd916606db43f8f7ef1d7ada4877ca00355d65a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ec5559817e20258d6940c16e36c2b38b2c62430f4d786a2215de9eaae302de5a"
end
def install
system "./configure", "--prefix=#{prefix}"
system "make", "all"
bin.install %w[
NRswitchg addedgeg amtog assembleg biplabg catg complg converseg
copyg countg cubhamg deledgeg delptg directg dreadnaut dretodot
dretog edgetransg genbg genbgL geng gengL genquarticg genrang
genspecialg gentourng gentreeg hamheuristic labelg linegraphg
listg multig newedgeg pickg planarg ranlabg shortg showg
subdivideg twohamg underlyingg vcolg watercluster2
]
(include/"nauty").install Dir["*.h"]
lib.install "nauty.a" => "libnauty.a"
doc.install "nug27.pdf", "README", Dir["*.txt"]
# Ancillary source files listed in README
pkgshare.install %w[sumlines.c sorttemplates.c bliss2dre.c blisstog.c poptest.c dretodot.c]
end
test do
# from ./runalltests
out1 = shell_output("#{bin}/geng -ud1D7t 11 2>&1")
out2 = shell_output("#{bin}/genrang -r3 114 100 | #{bin}/countg --nedDr -q")
assert_match "92779 graphs generated", out1
assert_match "100 graphs : n=114; e=171; mindeg=3; maxdeg=3; regular", out2
# test that the library is installed and linkable-against
(testpath/"test.c").write <<~EOS
#define MAXN 1000
#include <nauty.h>
int main()
{
int n = 12345;
int m = SETWORDSNEEDED(n);
nauty_check(WORDSIZE, m, n, NAUTYVERSIONID);
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}/nauty", "-L#{lib}", "-lnauty", "-o", "test"
system "./test"
end
end
nauty 2.7r2
* nauty 2.7r2
* nauty: improve livecheck
Closes #84618.
Co-authored-by: Sam Ford <0ca8a4bfe5c5e61f6c29b211ba5263c8e9cfe2e1@users.noreply.github.com>
Signed-off-by: Sam Ford <0ca8a4bfe5c5e61f6c29b211ba5263c8e9cfe2e1@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Nauty < Formula
desc "Automorphism groups of graphs and digraphs"
homepage "https://pallini.di.uniroma1.it/"
url "https://pallini.di.uniroma1.it/nauty27r2.tar.gz"
version "2.7r2"
sha256 "69c16c17da1cca90c25f6fb3bb242798af95f096fc3e2ff3e3398f390fcea768"
version_scheme 1
livecheck do
url :homepage
regex(/Current\s+?version:\s*?v?(\d+(?:\.\d+)+(?:r\d+)?)/i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "6d7980d67e772addbc5220e4536a1193580253ae2a52fbc7182d12eb73573c6b"
sha256 cellar: :any_skip_relocation, big_sur: "8714e05e1d050933e8571cca1c388a088d11170757fa5b1ae3fe5be7f490f6b5"
sha256 cellar: :any_skip_relocation, catalina: "5d118260b6fdabceb476c1421e4b4dd41d3027943b623ff7a4dc81baf6e284b9"
sha256 cellar: :any_skip_relocation, mojave: "2fa3783663f6e67d9a6e42c492c68412fdeeff7201d81e557b75927ff50b78f1"
sha256 cellar: :any_skip_relocation, high_sierra: "a5333c52eecb023c23be9638ebd916606db43f8f7ef1d7ada4877ca00355d65a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ec5559817e20258d6940c16e36c2b38b2c62430f4d786a2215de9eaae302de5a"
end
def install
system "./configure", "--prefix=#{prefix}"
system "make", "all"
bin.install %w[
NRswitchg addedgeg amtog assembleg biplabg catg complg converseg
copyg countg cubhamg deledgeg delptg directg dreadnaut dretodot
dretog edgetransg genbg genbgL geng gengL genquarticg genrang
genspecialg gentourng gentreeg hamheuristic labelg linegraphg
listg multig newedgeg pickg planarg ranlabg shortg showg
subdivideg twohamg underlyingg vcolg watercluster2
]
(include/"nauty").install Dir["*.h"]
lib.install "nauty.a" => "libnauty.a"
doc.install "nug27.pdf", "README", Dir["*.txt"]
# Ancillary source files listed in README
pkgshare.install %w[sumlines.c sorttemplates.c bliss2dre.c blisstog.c poptest.c dretodot.c]
end
test do
# from ./runalltests
out1 = shell_output("#{bin}/geng -ud1D7t 11 2>&1")
out2 = shell_output("#{bin}/genrang -r3 114 100 | #{bin}/countg --nedDr -q")
assert_match "92779 graphs generated", out1
assert_match "100 graphs : n=114; e=171; mindeg=3; maxdeg=3; regular", out2
# test that the library is installed and linkable-against
(testpath/"test.c").write <<~EOS
#define MAXN 1000
#include <nauty.h>
int main()
{
int n = 12345;
int m = SETWORDSNEEDED(n);
nauty_check(WORDSIZE, m, n, NAUTYVERSIONID);
return 0;
}
EOS
system ENV.cc, "test.c", "-I#{include}/nauty", "-L#{lib}", "-lnauty", "-o", "test"
system "./test"
end
end
|
require 'formula'
class Ncmpc < Formula
url 'http://downloads.sourceforge.net/project/musicpd/ncmpc/0.16.1/ncmpc-0.16.1.tar.bz2'
homepage 'http://mpd.wikia.com/wiki/Client:Ncmpc'
md5 'f3e53a379bd0bc82d315aa111bfdd17a'
depends_on 'pkg-config' => :build
depends_on 'gettext'
depends_on 'glib'
depends_on 'libmpdclient'
def install
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make install"
end
end
ncmpc 0.19
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Ncmpc < Formula
url 'http://downloads.sourceforge.net/musicpd/ncmpc-0.19.tar.bz2'
homepage 'http://mpd.wikia.com/wiki/Client:Ncmpc'
md5 'd298ad1313ef3a522ef03367f8a1ffc0'
depends_on 'pkg-config' => :build
depends_on 'gettext'
depends_on 'glib'
depends_on 'libmpdclient'
def install
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make install"
end
end
|
class Neo4j < Formula
desc "Robust (fully ACID) transactional property graph database"
homepage "http://neo4j.com"
url "http://dist.neo4j.org/neo4j-community-2.3.2-unix.tar.gz"
version "2.3.2"
sha256 "37e24d95c914c54d5cbbe99473d4beef89da78adb2db04eb87258a489225932a"
devel do
url "http://dist.neo4j.org/neo4j-community-3.0.0-M02-unix.tar.gz"
sha256 "2a20f420e94fe4189363ce8ab327c0e5e054df3fc74a0249e9e2c7fe0455a0d6"
version "3.0.0-M02"
end
bottle :unneeded
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Install jars in libexec to avoid conflicts
libexec.install Dir["*"]
# Symlink binaries
bin.install_symlink Dir["#{libexec}/bin/neo4j{,-shell,-import}"]
# Adjust UDC props
# Suppress the empty, focus-stealing java gui.
(libexec/"conf/neo4j-wrapper.conf").append_lines <<-EOS.undent
wrapper.java.additional=-Djava.awt.headless=true
wrapper.java.additional.4=-Dneo4j.ext.udc.source=homebrew
EOS
end
end
neo4j 2.3.3, 3.0.0-M05 (devel)
neo4j 2.3.3
Closes #202.
Signed-off-by: Andrew Janke <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@apjanke.net>
class Neo4j < Formula
desc "Robust (fully ACID) transactional property graph database"
homepage "http://neo4j.com"
url "http://dist.neo4j.org/neo4j-community-2.3.3-unix.tar.gz"
version "2.3.3"
sha256 "01559c55055516a42ee2dd100137b6b55d63f02959a3c6c6db7a152e045828d9"
devel do
url "http://dist.neo4j.org/neo4j-community-3.0.0-M05-unix.tar.gz"
sha256 "2b7878f424859de6951e86f9abb71701d8d45ab22e1157410504fe6a6bb17a95"
version "3.0.0-M05"
end
bottle :unneeded
depends_on :java => "1.7+"
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Fix Java detection to work with 1.8
# https://github.com/neo4j/neo4j/issues/6895
inreplace "bin/utils", "java_home -v 1.7", "java_home -v 1.7+" if build.stable?
# Install jars in libexec to avoid conflicts
libexec.install Dir["*"]
# Symlink binaries
bin.install_symlink Dir["#{libexec}/bin/neo4j{,-shell,-import}"]
# Adjust UDC props
# Suppress the empty, focus-stealing java gui.
(libexec/"conf/neo4j-wrapper.conf").append_lines <<-EOS.undent
wrapper.java.additional=-Djava.awt.headless=true
wrapper.java.additional.4=-Dneo4j.ext.udc.source=homebrew
EOS
end
test do
ENV.java_cache
ENV["NEO4J_LOG"] = testpath/"libexec/data/log/neo4j.log"
ENV["NEO4J_PIDFILE"] = testpath/"libexec/data/neo4j-service.pid"
mkpath testpath/"libexec/data/log"
assert_match /Neo4j .*is not running/i, shell_output("#{bin}/neo4j status", 3)
end
end
|
require 'formula'
class Nexus < Formula
homepage 'http://www.sonatype.org/'
url 'http://download.sonatype.com/nexus/oss/nexus-2.9.0-04-bundle.tar.gz'
version '2.9.0-04'
sha1 'a46f60f015fdf3f699771962fbb468cdb5d39dcf'
def install
rm_f Dir['bin/*.bat']
# Put the sonatype-work directory in the var directory, to persist across version updates
inreplace "nexus-#{version}/conf/nexus.properties",
'nexus-work=${bundleBasedir}/../sonatype-work/nexus',
"nexus-work=#{var}/nexus"
libexec.install Dir["nexus-#{version}/*"]
bin.install_symlink libexec/'bin/nexus'
end
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/nexus/libexec/bin/nexus start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sonatype.nexus</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nexus</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
end
nexus 2.9.1-02
Closes Homebrew/homebrew#32618.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
require 'formula'
class Nexus < Formula
homepage 'http://www.sonatype.org/'
url 'http://download.sonatype.com/nexus/oss/nexus-2.9.1-02-bundle.tar.gz'
version '2.9.1-02'
sha1 '1635c58922134cfd3a0361fcb7e2d1346162445e'
def install
rm_f Dir['bin/*.bat']
# Put the sonatype-work directory in the var directory, to persist across version updates
inreplace "nexus-#{version}/conf/nexus.properties",
'nexus-work=${bundleBasedir}/../sonatype-work/nexus',
"nexus-work=#{var}/nexus"
libexec.install Dir["nexus-#{version}/*"]
bin.install_symlink libexec/'bin/nexus'
end
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/nexus/libexec/bin/nexus start"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sonatype.nexus</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nexus</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
end
|
class Nginx < Formula
desc "HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server"
homepage "http://nginx.org/"
url "http://nginx.org/download/nginx-1.10.1.tar.gz"
sha256 "1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801"
head "http://hg.nginx.org/nginx/", :using => :hg
bottle do
sha256 "2b67c86454cc67bdeb2a637d9872ae471a810d8a2dae40b6a0c1dad7b253d30d" => :el_capitan
sha256 "6ac0a3e07cad5efb31185998f6cd6754de6d799396ffd872814593ba3430fdb3" => :yosemite
sha256 "c2f67c6b720a2f2c790338e0d30103acf36c757c068bbed8cc4c79734fd3779e" => :mavericks
end
devel do
url "http://nginx.org/download/nginx-1.11.1.tar.gz"
sha256 "5d8dd0197e3ffeb427729c045382182fb28db8e045c635221b2e0e6722821ad0"
end
# Before submitting more options to this formula please check they aren't
# already in Homebrew/homebrew-nginx/nginx-full:
# https://github.com/Homebrew/homebrew-nginx/blob/master/Formula/nginx-full.rb
option "with-passenger", "Compile with support for Phusion Passenger module"
option "with-webdav", "Compile with support for WebDAV module"
option "with-debug", "Compile with support for debug log"
option "with-http2", "Compile with support for the HTTP/2 module"
option "with-gunzip", "Compile with support for gunzip module"
deprecated_option "with-spdy" => "with-http2"
depends_on "pcre"
depends_on "passenger" => :optional
depends_on "openssl" => :recommended
depends_on "libressl" => :optional
def install
# Changes default port to 8080
inreplace "conf/nginx.conf" do |s|
s.gsub! "listen 80;", "listen 8080;"
s.gsub! " #}\n\n}", " #}\n include servers/*;\n}"
end
pcre = Formula["pcre"]
openssl = Formula["openssl"]
libressl = Formula["libressl"]
if build.with? "libressl"
cc_opt = "-I#{pcre.include} -I#{libressl.include}"
ld_opt = "-L#{pcre.lib} -L#{libressl.lib}"
else
cc_opt = "-I#{pcre.include} -I#{openssl.include}"
ld_opt = "-L#{pcre.lib} -L#{openssl.lib}"
end
args = %W[
--prefix=#{prefix}
--with-http_ssl_module
--with-pcre
--with-ipv6
--sbin-path=#{bin}/nginx
--with-cc-opt=#{cc_opt}
--with-ld-opt=#{ld_opt}
--conf-path=#{etc}/nginx/nginx.conf
--pid-path=#{var}/run/nginx.pid
--lock-path=#{var}/run/nginx.lock
--http-client-body-temp-path=#{var}/run/nginx/client_body_temp
--http-proxy-temp-path=#{var}/run/nginx/proxy_temp
--http-fastcgi-temp-path=#{var}/run/nginx/fastcgi_temp
--http-uwsgi-temp-path=#{var}/run/nginx/uwsgi_temp
--http-scgi-temp-path=#{var}/run/nginx/scgi_temp
--http-log-path=#{var}/log/nginx/access.log
--error-log-path=#{var}/log/nginx/error.log
--with-http_gzip_static_module
]
if build.with? "passenger"
nginx_ext = `#{Formula["passenger"].opt_bin}/passenger-config --nginx-addon-dir`.chomp
args << "--add-module=#{nginx_ext}"
end
args << "--with-http_dav_module" if build.with? "webdav"
args << "--with-debug" if build.with? "debug"
args << "--with-http_gunzip_module" if build.with? "gunzip"
args << "--with-http_v2_module" if build.with? "http2"
if build.head?
system "./auto/configure", *args
else
system "./configure", *args
end
system "make", "install"
if build.head?
man8.install "docs/man/nginx.8"
else
man8.install "man/nginx.8"
end
(etc/"nginx/servers").mkpath
(var/"run/nginx").mkpath
end
def post_install
# nginx's docroot is #{prefix}/html, this isn't useful, so we symlink it
# to #{HOMEBREW_PREFIX}/var/www. The reason we symlink instead of patching
# is so the user can redirect it easily to something else if they choose.
html = prefix/"html"
dst = var/"www"
if dst.exist?
html.rmtree
dst.mkpath
else
dst.dirname.mkpath
html.rename(dst)
end
prefix.install_symlink dst => "html"
# for most of this formula's life the binary has been placed in sbin
# and Homebrew used to suggest the user copy the plist for nginx to their
# ~/Library/LaunchAgents directory. So we need to have a symlink there
# for such cases
if rack.subdirs.any? { |d| d.join("sbin").directory? }
sbin.install_symlink bin/"nginx"
end
end
def passenger_caveats; <<-EOS.undent
To activate Phusion Passenger, add this to #{etc}/nginx/nginx.conf, inside the 'http' context:
passenger_root #{Formula["passenger"].opt_libexec}/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
EOS
end
def caveats
s = <<-EOS.undent
Docroot is: #{var}/www
The default port has been set in #{etc}/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in #{etc}/nginx/servers/.
EOS
s << "\n" << passenger_caveats if build.with? "passenger"
s
end
plist_options :manual => "nginx"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nginx</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
(testpath/"nginx.conf").write <<-EOS
worker_processes 4;
error_log #{testpath}/error.log;
pid #{testpath}/nginx.pid;
events {
worker_connections 1024;
}
http {
client_body_temp_path #{testpath}/client_body_temp;
fastcgi_temp_path #{testpath}/fastcgi_temp;
proxy_temp_path #{testpath}/proxy_temp;
scgi_temp_path #{testpath}/scgi_temp;
uwsgi_temp_path #{testpath}/uwsgi_temp;
server {
listen 8080;
root #{testpath};
access_log #{testpath}/access.log;
error_log #{testpath}/error.log;
}
}
EOS
system "#{bin}/nginx", "-t", "-c", testpath/"nginx.conf"
end
end
nginx: use secure urls
class Nginx < Formula
desc "HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server"
homepage "https://nginx.org/"
url "https://nginx.org/download/nginx-1.10.1.tar.gz"
sha256 "1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801"
head "http://hg.nginx.org/nginx/", :using => :hg
bottle do
sha256 "2b67c86454cc67bdeb2a637d9872ae471a810d8a2dae40b6a0c1dad7b253d30d" => :el_capitan
sha256 "6ac0a3e07cad5efb31185998f6cd6754de6d799396ffd872814593ba3430fdb3" => :yosemite
sha256 "c2f67c6b720a2f2c790338e0d30103acf36c757c068bbed8cc4c79734fd3779e" => :mavericks
end
devel do
url "https://nginx.org/download/nginx-1.11.1.tar.gz"
sha256 "5d8dd0197e3ffeb427729c045382182fb28db8e045c635221b2e0e6722821ad0"
end
# Before submitting more options to this formula please check they aren't
# already in Homebrew/homebrew-nginx/nginx-full:
# https://github.com/Homebrew/homebrew-nginx/blob/master/Formula/nginx-full.rb
option "with-passenger", "Compile with support for Phusion Passenger module"
option "with-webdav", "Compile with support for WebDAV module"
option "with-debug", "Compile with support for debug log"
option "with-http2", "Compile with support for the HTTP/2 module"
option "with-gunzip", "Compile with support for gunzip module"
deprecated_option "with-spdy" => "with-http2"
depends_on "pcre"
depends_on "passenger" => :optional
depends_on "openssl" => :recommended
depends_on "libressl" => :optional
def install
# Changes default port to 8080
inreplace "conf/nginx.conf" do |s|
s.gsub! "listen 80;", "listen 8080;"
s.gsub! " #}\n\n}", " #}\n include servers/*;\n}"
end
pcre = Formula["pcre"]
openssl = Formula["openssl"]
libressl = Formula["libressl"]
if build.with? "libressl"
cc_opt = "-I#{pcre.include} -I#{libressl.include}"
ld_opt = "-L#{pcre.lib} -L#{libressl.lib}"
else
cc_opt = "-I#{pcre.include} -I#{openssl.include}"
ld_opt = "-L#{pcre.lib} -L#{openssl.lib}"
end
args = %W[
--prefix=#{prefix}
--with-http_ssl_module
--with-pcre
--with-ipv6
--sbin-path=#{bin}/nginx
--with-cc-opt=#{cc_opt}
--with-ld-opt=#{ld_opt}
--conf-path=#{etc}/nginx/nginx.conf
--pid-path=#{var}/run/nginx.pid
--lock-path=#{var}/run/nginx.lock
--http-client-body-temp-path=#{var}/run/nginx/client_body_temp
--http-proxy-temp-path=#{var}/run/nginx/proxy_temp
--http-fastcgi-temp-path=#{var}/run/nginx/fastcgi_temp
--http-uwsgi-temp-path=#{var}/run/nginx/uwsgi_temp
--http-scgi-temp-path=#{var}/run/nginx/scgi_temp
--http-log-path=#{var}/log/nginx/access.log
--error-log-path=#{var}/log/nginx/error.log
--with-http_gzip_static_module
]
if build.with? "passenger"
nginx_ext = `#{Formula["passenger"].opt_bin}/passenger-config --nginx-addon-dir`.chomp
args << "--add-module=#{nginx_ext}"
end
args << "--with-http_dav_module" if build.with? "webdav"
args << "--with-debug" if build.with? "debug"
args << "--with-http_gunzip_module" if build.with? "gunzip"
args << "--with-http_v2_module" if build.with? "http2"
if build.head?
system "./auto/configure", *args
else
system "./configure", *args
end
system "make", "install"
if build.head?
man8.install "docs/man/nginx.8"
else
man8.install "man/nginx.8"
end
(etc/"nginx/servers").mkpath
(var/"run/nginx").mkpath
end
def post_install
# nginx's docroot is #{prefix}/html, this isn't useful, so we symlink it
# to #{HOMEBREW_PREFIX}/var/www. The reason we symlink instead of patching
# is so the user can redirect it easily to something else if they choose.
html = prefix/"html"
dst = var/"www"
if dst.exist?
html.rmtree
dst.mkpath
else
dst.dirname.mkpath
html.rename(dst)
end
prefix.install_symlink dst => "html"
# for most of this formula's life the binary has been placed in sbin
# and Homebrew used to suggest the user copy the plist for nginx to their
# ~/Library/LaunchAgents directory. So we need to have a symlink there
# for such cases
if rack.subdirs.any? { |d| d.join("sbin").directory? }
sbin.install_symlink bin/"nginx"
end
end
def passenger_caveats; <<-EOS.undent
To activate Phusion Passenger, add this to #{etc}/nginx/nginx.conf, inside the 'http' context:
passenger_root #{Formula["passenger"].opt_libexec}/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
EOS
end
def caveats
s = <<-EOS.undent
Docroot is: #{var}/www
The default port has been set in #{etc}/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in #{etc}/nginx/servers/.
EOS
s << "\n" << passenger_caveats if build.with? "passenger"
s
end
plist_options :manual => "nginx"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/nginx</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
(testpath/"nginx.conf").write <<-EOS
worker_processes 4;
error_log #{testpath}/error.log;
pid #{testpath}/nginx.pid;
events {
worker_connections 1024;
}
http {
client_body_temp_path #{testpath}/client_body_temp;
fastcgi_temp_path #{testpath}/fastcgi_temp;
proxy_temp_path #{testpath}/proxy_temp;
scgi_temp_path #{testpath}/scgi_temp;
uwsgi_temp_path #{testpath}/uwsgi_temp;
server {
listen 8080;
root #{testpath};
access_log #{testpath}/access.log;
error_log #{testpath}/error.log;
}
}
EOS
system "#{bin}/nginx", "-t", "-c", testpath/"nginx.conf"
end
end
|
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.0.5.tar.gz'
head 'http://nginx.org/download/nginx-1.1.0.tar.gz'
unless ARGV.build_head?
md5 '373c7761a7c682b92b164c8ee3d6d243'
else
md5 '3381f34eafc755f935a2d94148500505'
end
depends_on 'pcre'
skip_clean 'logs'
# Changes default port to 8080
# Tell configure to look for pcre in HOMEBREW_PREFIX
def patches
DATA
end
def options
[
['--with-passenger', "Compile with support for Phusion Passenger module"],
['--with-webdav', "Compile with support for WebDAV module"]
]
end
def passenger_config_args
passenger_root = `passenger-config --root`.chomp
if File.directory?(passenger_root)
return "--add-module=#{passenger_root}/ext/nginx"
end
puts "Unable to install nginx with passenger support. The passenger"
puts "gem must be installed and passenger-config must be in your path"
puts "in order to continue."
exit
end
def install
args = ["--prefix=#{prefix}",
"--with-http_ssl_module",
"--with-pcre",
"--conf-path=#{etc}/nginx/nginx.conf",
"--pid-path=#{var}/run/nginx.pid",
"--lock-path=#{var}/nginx/nginx.lock"]
args << passenger_config_args if ARGV.include? '--with-passenger'
args << "--with-http_dav_module" if ARGV.include? '--with-webdav'
system "./configure", *args
system "make install"
(prefix+'org.nginx.nginx.plist').write startup_plist
end
def caveats; <<-EOS.undent
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp #{prefix}/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
EOS
end
def startup_plist
return <<-EOPLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nginx.nginx</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>ProgramArguments</key>
<array>
<string>#{sbin}/nginx</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOPLIST
end
end
__END__
--- a/auto/lib/pcre/conf
+++ b/auto/lib/pcre/conf
@@ -155,6 +155,22 @@ else
. auto/feature
fi
+ if [ $ngx_found = no ]; then
+
+ # Homebrew
+ HOMEBREW_PREFIX=${NGX_PREFIX%Cellar*}
+ ngx_feature="PCRE library in ${HOMEBREW_PREFIX}"
+ ngx_feature_path="${HOMEBREW_PREFIX}/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R${HOMEBREW_PREFIX}/lib -L${HOMEBREW_PREFIX}/lib -lpcre"
+ else
+ ngx_feature_libs="-L${HOMEBREW_PREFIX}/lib -lpcre"
+ fi
+
+ . auto/feature
+ fi
+
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -33,7 +33,7 @@
#gzip on;
server {
- listen 80;
+ listen 8080;
server_name localhost;
#charset koi8-r;
Nginx 1.0.6/1.1.1
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Nginx < Formula
homepage 'http://nginx.org/'
url 'http://nginx.org/download/nginx-1.0.6.tar.gz'
head 'http://nginx.org/download/nginx-1.1.1.tar.gz'
if ARGV.build_head?
md5 '5afe88508dfca83db2cb991dceceb3a3'
else
md5 'bc98bac3f0b85da1045bc02e6d8fc80d'
end
depends_on 'pcre'
skip_clean 'logs'
# Changes default port to 8080
# Tell configure to look for pcre in HOMEBREW_PREFIX
def patches
DATA
end
def options
[
['--with-passenger', "Compile with support for Phusion Passenger module"],
['--with-webdav', "Compile with support for WebDAV module"]
]
end
def passenger_config_args
passenger_root = `passenger-config --root`.chomp
if File.directory?(passenger_root)
return "--add-module=#{passenger_root}/ext/nginx"
end
puts "Unable to install nginx with passenger support. The passenger"
puts "gem must be installed and passenger-config must be in your path"
puts "in order to continue."
exit
end
def install
args = ["--prefix=#{prefix}",
"--with-http_ssl_module",
"--with-pcre",
"--conf-path=#{etc}/nginx/nginx.conf",
"--pid-path=#{var}/run/nginx.pid",
"--lock-path=#{var}/nginx/nginx.lock"]
args << passenger_config_args if ARGV.include? '--with-passenger'
args << "--with-http_dav_module" if ARGV.include? '--with-webdav'
system "./configure", *args
system "make install"
(prefix+'org.nginx.nginx.plist').write startup_plist
end
def caveats; <<-EOS.undent
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp #{prefix}/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
EOS
end
def startup_plist
return <<-EOPLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.nginx.nginx</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>ProgramArguments</key>
<array>
<string>#{sbin}/nginx</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOPLIST
end
end
__END__
--- a/auto/lib/pcre/conf
+++ b/auto/lib/pcre/conf
@@ -155,6 +155,22 @@ else
. auto/feature
fi
+ if [ $ngx_found = no ]; then
+
+ # Homebrew
+ HOMEBREW_PREFIX=${NGX_PREFIX%Cellar*}
+ ngx_feature="PCRE library in ${HOMEBREW_PREFIX}"
+ ngx_feature_path="${HOMEBREW_PREFIX}/include"
+
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R${HOMEBREW_PREFIX}/lib -L${HOMEBREW_PREFIX}/lib -lpcre"
+ else
+ ngx_feature_libs="-L${HOMEBREW_PREFIX}/lib -lpcre"
+ fi
+
+ . auto/feature
+ fi
+
if [ $ngx_found = yes ]; then
CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -33,7 +33,7 @@
#gzip on;
server {
- listen 80;
+ listen 8080;
server_name localhost;
#charset koi8-r;
|
class Nomad < Formula
desc "Distributed, Highly Available, Datacenter-Aware Scheduler"
homepage "https://www.nomadproject.io"
url "https://github.com/hashicorp/nomad/archive/v0.8.2.tar.gz"
sha256 "18a42b02ae548a344a79b10cd34b710f5ab964ce57a58bd516af4b0c3826fdf1"
head "https://github.com/hashicorp/nomad.git"
bottle do
cellar :any_skip_relocation
sha256 "878e086ab495a10d3adf52a41a56551e22e0807ae17d2cb3d93d35716658232c" => :high_sierra
sha256 "03cae4d45075a262e58ef8f32fa00540e4e37b36e8b4436b5ede9b1afad73c51" => :sierra
sha256 "ba5ab3208d3be2f4046e9ad7cbfb2b715132ac217b30dfe85c24d35c7abea177" => :el_capitan
end
option "with-dynamic", "Build dynamic binary with CGO_ENABLED=1"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/hashicorp/nomad").install buildpath.children
cd "src/github.com/hashicorp/nomad" do
ENV["CGO_ENABLED"] = "1" if build.with? "dynamic"
system "go", "build", "-tags", "ui", "-o", bin/"nomad"
prefix.install_metafiles
end
end
test do
begin
pid = fork do
exec "#{bin}/nomad", "agent", "-dev"
end
sleep 10
ENV.append "NOMAD_ADDR", "http://127.0.0.1:4646"
system "#{bin}/nomad", "node-status"
ensure
Process.kill("TERM", pid)
end
end
end
nomad 0.8.3
Closes #27192.
Signed-off-by: commitay <10d69e516de6fc57655a0b77a4a950d85cd2179f@users.noreply.github.com>
class Nomad < Formula
desc "Distributed, Highly Available, Datacenter-Aware Scheduler"
homepage "https://www.nomadproject.io"
url "https://github.com/hashicorp/nomad/archive/v0.8.3.tar.gz"
sha256 "af1aee7bd182a656c846a710b262318b7a10bb31671843697f302606a758fe04"
head "https://github.com/hashicorp/nomad.git"
bottle do
cellar :any_skip_relocation
sha256 "878e086ab495a10d3adf52a41a56551e22e0807ae17d2cb3d93d35716658232c" => :high_sierra
sha256 "03cae4d45075a262e58ef8f32fa00540e4e37b36e8b4436b5ede9b1afad73c51" => :sierra
sha256 "ba5ab3208d3be2f4046e9ad7cbfb2b715132ac217b30dfe85c24d35c7abea177" => :el_capitan
end
option "with-dynamic", "Build dynamic binary with CGO_ENABLED=1"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/hashicorp/nomad").install buildpath.children
cd "src/github.com/hashicorp/nomad" do
ENV["CGO_ENABLED"] = "1" if build.with? "dynamic"
system "go", "build", "-tags", "ui", "-o", bin/"nomad"
prefix.install_metafiles
end
end
test do
begin
pid = fork do
exec "#{bin}/nomad", "agent", "-dev"
end
sleep 10
ENV.append "NOMAD_ADDR", "http://127.0.0.1:4646"
system "#{bin}/nomad", "node-status"
ensure
Process.kill("TERM", pid)
end
end
end
|
# OCaml does not preserve binary compatibility across compiler releases,
# so when updating it you should ensure that all dependent packages are
# also updated by incrementing their revisions.
#
# Specific packages to pay attention to include:
# - camlp4
# - opam
#
# Applications that really shouldn't break on a compiler update are:
# - mldonkey
# - coq
# - coccinelle
# - unison
class Ocaml < Formula
desc "General purpose programming language in the ML family"
homepage "https://ocaml.org/"
head "http://caml.inria.fr/svn/ocaml/trunk", :using => :svn
stable do
url "http://caml.inria.fr/pub/distrib/ocaml-4.03/ocaml-4.03.0.tar.gz"
sha256 "7fdf280cc6c0a2de4fc9891d0bf4633ea417046ece619f011fd44540fcfc8da2"
end
pour_bottle? do
# The ocaml compilers embed prefix information in weird ways that the default
# brew detection doesn't find, and so needs to be explicitly blacklisted.
reason "The bottle needs to be installed into /usr/local."
satisfy { HOMEBREW_PREFIX.to_s == "/usr/local" }
end
bottle do
cellar :any_skip_relocation
sha256 "5a9ad99085350c0ac9a81bb9eb82543580c57069c2e1f6ca85efaf17ad2ab9f6" => :el_capitan
sha256 "495a9536a4b6a3b5bb8d4988f5c2c50d2e961a8cd1bc3b133b5d4f90425bc828" => :yosemite
sha256 "0d7ffe037bb862f141368110578f4c3aed01692ad5473bc222ea18d0cfcbac4a" => :mavericks
end
option "with-x11", "Install with the Graphics module"
option "with-flambda", "Install with flambda support"
depends_on :x11 => :optional
def install
ENV.deparallelize # Builds are not parallel-safe, esp. with many cores
# the ./configure in this package is NOT a GNU autoconf script!
args = ["-prefix", HOMEBREW_PREFIX.to_s, "-with-debug-runtime", "-mandir", man]
args << "-no-graph" if build.without? "x11"
args << "-flambda" if build.with? "flambda"
system "./configure", *args
system "make", "world.opt"
system "make", "install", "PREFIX=#{prefix}"
end
test do
assert_match "val x : int = 1", shell_output("echo 'let x = 1 ;;' | ocaml 2>&1")
assert_match HOMEBREW_PREFIX.to_s, shell_output("ocamlc -where")
end
end
ocaml: style nits
# OCaml does not preserve binary compatibility across compiler releases,
# so when updating it you should ensure that all dependent packages are
# also updated by incrementing their revisions.
#
# Specific packages to pay attention to include:
# - camlp4
# - opam
#
# Applications that really shouldn't break on a compiler update are:
# - mldonkey
# - coq
# - coccinelle
# - unison
class Ocaml < Formula
desc "General purpose programming language in the ML family"
homepage "https://ocaml.org/"
url "http://caml.inria.fr/pub/distrib/ocaml-4.03/ocaml-4.03.0.tar.gz"
sha256 "7fdf280cc6c0a2de4fc9891d0bf4633ea417046ece619f011fd44540fcfc8da2"
head "http://caml.inria.fr/svn/ocaml/trunk", :using => :svn
pour_bottle? do
# The ocaml compilers embed prefix information in weird ways that the default
# brew detection doesn't find, and so needs to be explicitly blacklisted.
reason "The bottle needs to be installed into /usr/local."
satisfy { HOMEBREW_PREFIX.to_s == "/usr/local" }
end
bottle do
cellar :any_skip_relocation
sha256 "5a9ad99085350c0ac9a81bb9eb82543580c57069c2e1f6ca85efaf17ad2ab9f6" => :el_capitan
sha256 "495a9536a4b6a3b5bb8d4988f5c2c50d2e961a8cd1bc3b133b5d4f90425bc828" => :yosemite
sha256 "0d7ffe037bb862f141368110578f4c3aed01692ad5473bc222ea18d0cfcbac4a" => :mavericks
end
option "with-x11", "Install with the Graphics module"
option "with-flambda", "Install with flambda support"
depends_on :x11 => :optional
def install
ENV.deparallelize # Builds are not parallel-safe, esp. with many cores
# the ./configure in this package is NOT a GNU autoconf script!
args = ["-prefix", HOMEBREW_PREFIX.to_s, "-with-debug-runtime", "-mandir", man]
args << "-no-graph" if build.without? "x11"
args << "-flambda" if build.with? "flambda"
system "./configure", *args
system "make", "world.opt"
system "make", "install", "PREFIX=#{prefix}"
end
test do
output = shell_output("echo 'let x = 1 ;;' | #{bin}/ocaml 2>&1")
assert_match "val x : int = 1", output
assert_match HOMEBREW_PREFIX.to_s, shell_output("#{bin}/ocamlc -where")
end
end
|
class Paket < Formula
desc "Dependency manager for .NET with support for NuGet and Git repositories"
homepage "https://fsprojects.github.io/Paket/"
url "https://github.com/fsprojects/Paket/releases/download/5.242.2/paket.exe"
sha256 "e7e27c3f648300d66c7f45ab66c4a9071741a81bb0473d45bd189b354c2ce694"
bottle :unneeded
depends_on "mono"
def install
libexec.install "paket.exe"
(bin/"paket").write <<~EOS
#!/bin/bash
mono #{libexec}/paket.exe "$@"
EOS
end
test do
test_package_id = "Paket.Test"
test_package_version = "1.2.3"
touch testpath/"paket.dependencies"
touch testpath/"testfile.txt"
system bin/"paket", "install"
assert_predicate testpath/"paket.lock", :exist?
(testpath/"paket.template").write <<~EOS
type file
id #{test_package_id}
version #{test_package_version}
authors Test package author
description
Description of this test package
files
testfile.txt ==> lib
EOS
system bin/"paket", "pack", "output", testpath
assert_predicate testpath/"#{test_package_id}.#{test_package_version}.nupkg", :exist?
end
end
paket 5.243.0 (#52244)
class Paket < Formula
desc "Dependency manager for .NET with support for NuGet and Git repositories"
homepage "https://fsprojects.github.io/Paket/"
url "https://github.com/fsprojects/Paket/releases/download/5.243.0/paket.exe"
sha256 "7f3b61fb13ec166996eef275e15f62abcab0656bafc06420a8edf02d596b7bbb"
bottle :unneeded
depends_on "mono"
def install
libexec.install "paket.exe"
(bin/"paket").write <<~EOS
#!/bin/bash
mono #{libexec}/paket.exe "$@"
EOS
end
test do
test_package_id = "Paket.Test"
test_package_version = "1.2.3"
touch testpath/"paket.dependencies"
touch testpath/"testfile.txt"
system bin/"paket", "install"
assert_predicate testpath/"paket.lock", :exist?
(testpath/"paket.template").write <<~EOS
type file
id #{test_package_id}
version #{test_package_version}
authors Test package author
description
Description of this test package
files
testfile.txt ==> lib
EOS
system bin/"paket", "pack", "output", testpath
assert_predicate testpath/"#{test_package_id}.#{test_package_version}.nupkg", :exist?
end
end
|
class Paket < Formula
desc "Dependency manager for .NET with support for NuGet and Git repositories"
homepage "https://fsprojects.github.io/Paket/"
url "https://github.com/fsprojects/Paket/releases/download/5.252.0/paket.exe"
sha256 "ef8ebcc2ed03d38e45cf62f6c092db3eb61a0bb178c37fecfed87181d4d4c60a"
license "MIT"
bottle :unneeded
depends_on "mono"
def install
libexec.install "paket.exe"
(bin/"paket").write <<~EOS
#!/bin/bash
mono #{libexec}/paket.exe "$@"
EOS
end
test do
test_package_id = "Paket.Test"
test_package_version = "1.2.3"
touch testpath/"paket.dependencies"
touch testpath/"testfile.txt"
system bin/"paket", "install"
assert_predicate testpath/"paket.lock", :exist?
(testpath/"paket.template").write <<~EOS
type file
id #{test_package_id}
version #{test_package_version}
authors Test package author
description
Description of this test package
files
testfile.txt ==> lib
EOS
system bin/"paket", "pack", "output", testpath
assert_predicate testpath/"#{test_package_id}.#{test_package_version}.nupkg", :exist?
end
end
paket 5.257.0 (#65150)
class Paket < Formula
desc "Dependency manager for .NET with support for NuGet and Git repositories"
homepage "https://fsprojects.github.io/Paket/"
url "https://github.com/fsprojects/Paket/releases/download/5.257.0/paket.exe"
sha256 "58185853a390c979aedec9fe2b7b2f81c1131ebfae51c5be4121b670b329deef"
license "MIT"
bottle :unneeded
depends_on "mono"
def install
libexec.install "paket.exe"
(bin/"paket").write <<~EOS
#!/bin/bash
mono #{libexec}/paket.exe "$@"
EOS
end
test do
test_package_id = "Paket.Test"
test_package_version = "1.2.3"
touch testpath/"paket.dependencies"
touch testpath/"testfile.txt"
system bin/"paket", "install"
assert_predicate testpath/"paket.lock", :exist?
(testpath/"paket.template").write <<~EOS
type file
id #{test_package_id}
version #{test_package_version}
authors Test package author
description
Description of this test package
files
testfile.txt ==> lib
EOS
system bin/"paket", "pack", "output", testpath
assert_predicate testpath/"#{test_package_id}.#{test_package_version}.nupkg", :exist?
end
end
|
class Pango < Formula
desc "Framework for layout and rendering of i18n text"
homepage "https://www.pango.org/"
url "https://download.gnome.org/sources/pango/1.42/pango-1.42.3.tar.xz"
sha256 "fb3d875305d5143f02cde5c72fec3903e60dc35844759dc14b2df4955b5dde3a"
bottle do
sha256 "49c20497b7779559877d1d9ba6e60bb479d305c09a6301b832f7eba404dcee6e" => :high_sierra
sha256 "3906e3e45e7784e9ec4c2be43b39005770d68534001a0cb2f8625bfe38a325cc" => :sierra
sha256 "6affe3058a7a77093ce2054dca9f2dfbd538222d12f6dff88e829ce588e25200" => :el_capitan
end
head do
url "https://gitlab.gnome.org/GNOME/pango.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
depends_on "gtk-doc" => :build
end
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "fribidi"
depends_on "fontconfig"
depends_on "glib"
depends_on "harfbuzz"
# This fixes a font-size problem in gtk
# For discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=787867
patch do
url "https://gitlab.gnome.org/tschoonj/pango/commit/60df2b006e5d4553abc7bb5fe9a99539c91b0022.patch"
sha256 "d5ece753cf393ef507dd2b0415721b4381159da5e2f40793c6d85741b1b163bc"
end
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-html-dir=#{share}/doc",
"--enable-introspection=yes",
"--enable-static",
"--without-xft"
system "make"
system "make", "install"
end
test do
system "#{bin}/pango-view", "--version"
(testpath/"test.c").write <<~EOS
#include <pango/pangocairo.h>
int main(int argc, char *argv[]) {
PangoFontMap *fontmap;
int n_families;
PangoFontFamily **families;
fontmap = pango_cairo_font_map_get_default();
pango_font_map_list_families (fontmap, &families, &n_families);
g_free(families);
return 0;
}
EOS
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gettext = Formula["gettext"]
glib = Formula["glib"]
libpng = Formula["libpng"]
pixman = Formula["pixman"]
flags = %W[
-I#{cairo.opt_include}/cairo
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/pango-1.0
-I#{libpng.opt_include}/libpng16
-I#{pixman.opt_include}/pixman-1
-D_REENTRANT
-L#{cairo.opt_lib}
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{lib}
-lcairo
-lglib-2.0
-lgobject-2.0
-lpango-1.0
-lpangocairo-1.0
]
flags << "-lintl" if OS.mac?
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
pango: update 1.42.3 bottle for Linuxbrew.
Closes Linuxbrew/homebrew-core#8686.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class Pango < Formula
desc "Framework for layout and rendering of i18n text"
homepage "https://www.pango.org/"
url "https://download.gnome.org/sources/pango/1.42/pango-1.42.3.tar.xz"
sha256 "fb3d875305d5143f02cde5c72fec3903e60dc35844759dc14b2df4955b5dde3a"
bottle do
sha256 "49c20497b7779559877d1d9ba6e60bb479d305c09a6301b832f7eba404dcee6e" => :high_sierra
sha256 "3906e3e45e7784e9ec4c2be43b39005770d68534001a0cb2f8625bfe38a325cc" => :sierra
sha256 "6affe3058a7a77093ce2054dca9f2dfbd538222d12f6dff88e829ce588e25200" => :el_capitan
sha256 "d373d4ea65432327bad7bfb2d091ec7727aab03ade8a12d6e23a71e10f38d2b9" => :x86_64_linux
end
head do
url "https://gitlab.gnome.org/GNOME/pango.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
depends_on "gtk-doc" => :build
end
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "fribidi"
depends_on "fontconfig"
depends_on "glib"
depends_on "harfbuzz"
# This fixes a font-size problem in gtk
# For discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=787867
patch do
url "https://gitlab.gnome.org/tschoonj/pango/commit/60df2b006e5d4553abc7bb5fe9a99539c91b0022.patch"
sha256 "d5ece753cf393ef507dd2b0415721b4381159da5e2f40793c6d85741b1b163bc"
end
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-html-dir=#{share}/doc",
"--enable-introspection=yes",
"--enable-static",
"--without-xft"
system "make"
system "make", "install"
end
test do
system "#{bin}/pango-view", "--version"
(testpath/"test.c").write <<~EOS
#include <pango/pangocairo.h>
int main(int argc, char *argv[]) {
PangoFontMap *fontmap;
int n_families;
PangoFontFamily **families;
fontmap = pango_cairo_font_map_get_default();
pango_font_map_list_families (fontmap, &families, &n_families);
g_free(families);
return 0;
}
EOS
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gettext = Formula["gettext"]
glib = Formula["glib"]
libpng = Formula["libpng"]
pixman = Formula["pixman"]
flags = %W[
-I#{cairo.opt_include}/cairo
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/pango-1.0
-I#{libpng.opt_include}/libpng16
-I#{pixman.opt_include}/pixman-1
-D_REENTRANT
-L#{cairo.opt_lib}
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{lib}
-lcairo
-lglib-2.0
-lgobject-2.0
-lpango-1.0
-lpangocairo-1.0
]
flags << "-lintl" if OS.mac?
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end
|
require 'formula'
class Pango < Formula
homepage 'http://www.pango.org/'
url 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.28/pango-1.28.4.tar.bz2'
sha256 '7eb035bcc10dd01569a214d5e2bc3437de95d9ac1cfa9f50035a687c45f05a9f'
depends_on 'pkg-config' => :build
depends_on 'glib'
fails_with_llvm "Undefined symbols when linking", :build => "2326"
if MacOS.leopard?
depends_on 'fontconfig' # Leopard's fontconfig is too old.
depends_on 'cairo' # Leopard doesn't come with Cairo.
elsif MacOS.lion?
depends_on 'cairo' # links against system Cairo without this
end
def install
system "./configure", "--prefix=#{prefix}", "--with-x"
system "make install"
end
end
pango 1.29.4
This updates pango to 1.29.3 and fixes the html doc install path.
It also enables the creation of two man pages. Added at the end
is a def test that uses pango, cairo, glib, libz, and freetype.
The formula creates shared native libraies as it was previously
crafted, and it compiles using llvm 2335, gcc-4.2.1, and clang-2.0
from XCode 4.0.2 on 64bit OSX 10.6.8.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Pango < Formula
homepage 'http://www.pango.org/'
url 'http://ftp.gnome.org/pub/gnome/sources/pango/1.29/pango-1.29.4.tar.bz2'
sha256 'f15deecaecf1e9dcb7db0e4947d12b5bcff112586434f8d30a5afd750747ff2b'
depends_on 'pkg-config' => :build
depends_on 'glib'
fails_with_llvm "Undefined symbols when linking", :build => "2326"
if MacOS.leopard?
depends_on 'fontconfig' # Leopard's fontconfig is too old.
depends_on 'cairo' # Leopard doesn't come with Cairo.
elsif MacOS.lion?
depends_on 'cairo' # links against system Cairo without this
end
def install
system "./configure", "--disable-dependency-tracking", "--disable-debug",
"--prefix=#{prefix}",
"--enable-man",
"--with-x",
"--with-html-dir=#{share}/doc"
system "make"
system "make install"
end
def test
mktemp do
system "#{bin}/pango-view -t 'test-image' --waterfall --rotate=10 --annotate=1 --header -q -o output.png"
system "/usr/bin/qlmanage -p output.png"
end
end
end
|
class Pegtl < Formula
desc "Parsing Expression Grammar Template Library"
homepage "https://github.com/taocpp/PEGTL"
url "https://github.com/taocpp/PEGTL/archive/3.0.0.tar.gz"
sha256 "b47af025450f5c12251cd831f90deab666e18a8029f3dbffb32672b0450af902"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "abf71571ff392323eb08f1cadb23d744900467cbcb26a9a8f2e689e8af93b6be" => :big_sur
sha256 "10ad60dbc5a6c4054579b2e7529dfb053395cfd2c9bc5ddb5c2bf6b939b8f9cd" => :catalina
sha256 "10ad60dbc5a6c4054579b2e7529dfb053395cfd2c9bc5ddb5c2bf6b939b8f9cd" => :mojave
sha256 "10ad60dbc5a6c4054579b2e7529dfb053395cfd2c9bc5ddb5c2bf6b939b8f9cd" => :high_sierra
end
depends_on "cmake" => :build
if MacOS.version <= :mojave
depends_on "gcc"
fails_with :clang do
cause "'path' is unavailable in c++ < 17: introduced in macOS 10.15"
end
end
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args,
"-DPEGTL_BUILD_TESTS=OFF",
"-DPEGTL_BUILD_EXAMPLES=OFF",
"-DCMAKE_CXX_STANDARD=17"
system "make", "install"
end
rm "src/example/pegtl/CMakeLists.txt"
(pkgshare/"examples").install (buildpath/"src/example/pegtl").children
end
test do
system ENV.cxx, pkgshare/"examples/hello_world.cpp", "-std=c++17", "-o", "helloworld"
assert_equal "Good bye, homebrew!\n", shell_output("./helloworld 'Hello, homebrew!'")
end
end
pegtl: update 3.0.0 bottle.
class Pegtl < Formula
desc "Parsing Expression Grammar Template Library"
homepage "https://github.com/taocpp/PEGTL"
url "https://github.com/taocpp/PEGTL/archive/3.0.0.tar.gz"
sha256 "b47af025450f5c12251cd831f90deab666e18a8029f3dbffb32672b0450af902"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "3044879b7c3b323251009528b53b5bea68cb314f51cfec06f59ceb15f74b492b" => :big_sur
sha256 "5fa80672bf58a5eaa91bf684ea3ef37c96b37a9b1f8246517e279a8613a0231e" => :catalina
sha256 "854e19bfaf2383f758acb6f978ea5f8ad04e23790543facef037019832a7ce6c" => :mojave
end
depends_on "cmake" => :build
if MacOS.version <= :mojave
depends_on "gcc"
fails_with :clang do
cause "'path' is unavailable in c++ < 17: introduced in macOS 10.15"
end
end
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args,
"-DPEGTL_BUILD_TESTS=OFF",
"-DPEGTL_BUILD_EXAMPLES=OFF",
"-DCMAKE_CXX_STANDARD=17"
system "make", "install"
end
rm "src/example/pegtl/CMakeLists.txt"
(pkgshare/"examples").install (buildpath/"src/example/pegtl").children
end
test do
system ENV.cxx, pkgshare/"examples/hello_world.cpp", "-std=c++17", "-o", "helloworld"
assert_equal "Good bye, homebrew!\n", shell_output("./helloworld 'Hello, homebrew!'")
end
end
|
class Pgcli < Formula
homepage "http://pgcli.com/"
url "https://pypi.python.org/packages/source/p/pgcli/pgcli-0.17.0.tar.gz"
sha256 "b7a47405da61bc05dbceb28443e13965f322f58d942e119499976be19e2e2d44"
bottle do
cellar :any
sha256 "0119d16d4bddd2c18a8780d6423d4f730cb2b0782c753565c3626aa58aa3a78a" => :yosemite
sha256 "408ac44b598737ad2d240b7a858c9668ab62ed61267ece56577986d09077834b" => :mavericks
sha256 "0ee3f0a9fe8214615586ba630234511d1c71623fd77bf7d102c258a4adb9efe5" => :mountain_lion
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "openssl"
depends_on :postgresql
resource "sqlparse" do
url "https://pypi.python.org/packages/source/s/sqlparse/sqlparse-0.1.14.tar.gz"
sha256 "e561e31853ab9f3634a1a2bd53035f9e47dfb203d56b33cc6569047ba087daf0"
end
resource "psycopg2" do
url "https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.6.tar.gz"
sha256 "c00afecb302a99a4f83dec9b055c4d1cc196926d62c8db015d68432df8118ca8"
end
resource "six" do
url "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5"
end
resource "wcwidth" do
url "https://pypi.python.org/packages/source/w/wcwidth/wcwidth-0.1.4.tar.gz"
sha256 "906d3123045d77027b49fe912458e1a1e1d6ca1a51558a4bd9168d143b129d2b"
end
resource "Pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.2.tar.gz"
sha256 "7320919084e6dac8f4540638a46447a3bd730fca172afc17d2c03eed22cf4f51"
end
resource "click" do
url "https://pypi.python.org/packages/source/c/click/click-4.0.tar.gz"
sha256 "f49e03611f5f2557788ceeb80710b1c67110f97c5e6740b97edf70245eea2409"
end
resource "prompt_toolkit" do
url "https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.37.tar.gz"
sha256 "680f0abab097619e013c75f4fc234f7734ee888a483d9492e326ecd7883c6859"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
%w[click prompt_toolkit psycopg2 sqlparse Pygments wcwidth six].each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system bin/"pgcli", "--help"
end
end
pgcli: update 0.17.0 bottle.
class Pgcli < Formula
homepage "http://pgcli.com/"
url "https://pypi.python.org/packages/source/p/pgcli/pgcli-0.17.0.tar.gz"
sha256 "b7a47405da61bc05dbceb28443e13965f322f58d942e119499976be19e2e2d44"
bottle do
cellar :any
sha256 "e777938c9c25c9a3c0077a414d5d2ecf48e2fe91e769ce193d403308a36dc24a" => :yosemite
sha256 "07a2a41835ae74229d7866d3cfb95bf4b3027c6eb0c55e73dfb3a747f635db54" => :mavericks
sha256 "d6c8bf046088a100a2a9989c9406a5b590c733d0a29ea32a7eddc73f114a04b8" => :mountain_lion
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "openssl"
depends_on :postgresql
resource "sqlparse" do
url "https://pypi.python.org/packages/source/s/sqlparse/sqlparse-0.1.14.tar.gz"
sha256 "e561e31853ab9f3634a1a2bd53035f9e47dfb203d56b33cc6569047ba087daf0"
end
resource "psycopg2" do
url "https://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.6.tar.gz"
sha256 "c00afecb302a99a4f83dec9b055c4d1cc196926d62c8db015d68432df8118ca8"
end
resource "six" do
url "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5"
end
resource "wcwidth" do
url "https://pypi.python.org/packages/source/w/wcwidth/wcwidth-0.1.4.tar.gz"
sha256 "906d3123045d77027b49fe912458e1a1e1d6ca1a51558a4bd9168d143b129d2b"
end
resource "Pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.2.tar.gz"
sha256 "7320919084e6dac8f4540638a46447a3bd730fca172afc17d2c03eed22cf4f51"
end
resource "click" do
url "https://pypi.python.org/packages/source/c/click/click-4.0.tar.gz"
sha256 "f49e03611f5f2557788ceeb80710b1c67110f97c5e6740b97edf70245eea2409"
end
resource "prompt_toolkit" do
url "https://pypi.python.org/packages/source/p/prompt_toolkit/prompt_toolkit-0.37.tar.gz"
sha256 "680f0abab097619e013c75f4fc234f7734ee888a483d9492e326ecd7883c6859"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
%w[click prompt_toolkit psycopg2 sqlparse Pygments wcwidth six].each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system bin/"pgcli", "--help"
end
end
|
phash 0.9.4
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Phash < Formula
url 'http://www.phash.org/releases/pHash-0.9.4.tar.gz'
homepage 'http://www.phash.org/'
sha1 '9710b8a1d4d24e7fc3ac43c33eac8e89d9e727d7'
depends_on 'cimg' unless ARGV.include? "--disable-image-hash" and ARGV.include? "--disable-video-hash"
depends_on 'ffmpeg' unless ARGV.include? "--disable-video-hash"
unless ARGV.include? "--disable-audio-hash"
depends_on 'libsndfile'
depends_on 'libsamplerate'
depends_on 'mpg123'
end
def options
[
["--disable-image-hash", "Disable image hash"],
["--disable-video-hash", "Disable video hash"],
["--disable-audio-hash", "Disable audio hash"]
]
end
def install
args = ["--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--enable-shared"]
# disable specific hashes if specified as an option
args << "--disable-image-hash" if ARGV.include? "--disable-image-hash"
args << "--disable-video-hash" if ARGV.include? "--disable-video-hash"
args << "--disable-audio-hash" if ARGV.include? "--disable-audio-hash"
system "./configure", *args
system "make install"
end
end
|
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rundock/version'
Gem::Specification.new do |spec|
spec.name = "rundock"
spec.version = Rundock::VERSION
spec.authors = ["hiracy"]
spec.email = ["leizhen@mbr.nifty.com"]
spec.summary = %q{Simple Execution framework for various servers}
spec.homepage = "https://github.com/hiracy/rundock"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.9"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_runtime_dependency "specinfra", [">= 2.31.0", "< 3.0.0"]
spec.add_runtime_dependency "ansi"
spec.add_runtime_dependency "schash"
spec.add_runtime_dependency "thor"
spec.add_runtime_dependency 'net-ssh'
end
Remove schash to gemspec
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rundock/version'
Gem::Specification.new do |spec|
spec.name = "rundock"
spec.version = Rundock::VERSION
spec.authors = ["hiracy"]
spec.email = ["leizhen@mbr.nifty.com"]
spec.summary = %q{Simple Execution framework for various servers}
spec.homepage = "https://github.com/hiracy/rundock"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler", "~> 1.9"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_runtime_dependency "specinfra", [">= 2.31.0", "< 3.0.0"]
spec.add_runtime_dependency "ansi"
spec.add_runtime_dependency "thor"
spec.add_runtime_dependency 'net-ssh'
end
|
require File.expand_path("../../Abstract/abstract-php", __FILE__)
class Php71 < AbstractPhp
init
desc "PHP Version 7.1"
revision 18
bottle do
sha256 "5cb5d5383ea653e6000f83e035f4abbe1ecab27045f833e20a54813585141f7f" => :sierra
sha256 "3e8453247379539c98b57fcd43043c3840177d8188141b76865b0533363a9b97" => :el_capitan
sha256 "e314207c0d752ffe4b5b3b27eb7d34156092a4e1660c946507b196193408815f" => :yosemite
end
include AbstractPhpVersion::Php71Defs
url PHP_SRC_TARBALL
sha256 PHP_CHECKSUM[:sha256]
version PHP_VERSION
head PHP_GITHUB_URL, :branch => PHP_BRANCH
def php_version
"7.1"
end
def php_version_path
"71"
end
end
php71: update 7.1.6_18 bottle.
require File.expand_path("../../Abstract/abstract-php", __FILE__)
class Php71 < AbstractPhp
init
desc "PHP Version 7.1"
revision 18
bottle do
sha256 "b1c4a67544833a4729766a26b9043d23e219b49aa48347135d638bc8e1064358" => :sierra
sha256 "80c71b4c72854cdfdc3ecc0f32577fd77cb84c8b8a94b2970e2eecc1a3706082" => :el_capitan
sha256 "5ba5cbb4c2510bbb53caac4dcbc7859eeb69c4d55b986e521743f71f07d620b7" => :yosemite
end
include AbstractPhpVersion::Php71Defs
url PHP_SRC_TARBALL
sha256 PHP_CHECKSUM[:sha256]
version PHP_VERSION
head PHP_GITHUB_URL, :branch => PHP_BRANCH
def php_version
"7.1"
end
def php_version_path
"71"
end
end
|
require 'formula'
class Phyml < Formula
homepage 'http://www.atgc-montpellier.fr/phyml/'
url 'http://phyml.googlecode.com/files/phyml-20110919.tar.gz'
sha1 '6f6281af465d6daab0d7f774c1d0f62856b1af80'
def install
# separate steps required
system "./configure", "--prefix=#{prefix}"
system "make"
system "./configure", "--prefix=#{prefix}", "--enable-phytime"
system "make"
bin.install %w(src/phyml src/phytime)
doc.install Dir['doc/phyml-manual.pdf']
rm_rf Dir['examples/.svn']
chmod 0644, Dir['examples/*']
share.install Dir['examples/*']
end
def caveats; <<-EOS.undent
Examples have been installed here:
#{share}
See options for phyml by running:
phmyl --help
PhyML must be run with the "-i" option to specify an input or it will
segfault. Example:
phyml -i #{share}/nucleic
EOS
end
end
phyml 20120412
- Upgrade to version 20120412
Closes Homebrew/homebrew#15475.
Signed-off-by: Adam Vandenberg <34c2b6407fd5a10249a15d699d40f9ed1782e98c@gmail.com>
require 'formula'
class Phyml < Formula
homepage 'http://www.atgc-montpellier.fr/phyml/'
url 'https://phyml.googlecode.com/files/phyml-20120412.tar.gz'
sha1 '8a4699ad2bba7e2f76c8eefa277d29290f92071c'
def install
# separate steps required
system "./configure", "--prefix=#{prefix}"
system "make"
system "./configure", "--prefix=#{prefix}", "--enable-phytime"
system "make"
bin.install %w(src/phyml src/phytime)
doc.install Dir['doc/phyml-manual.pdf']
rm_rf Dir['examples/.svn']
chmod 0644, Dir['examples/*']
share.install Dir['examples/*']
end
def caveats; <<-EOS.undent
Examples have been installed here:
#{share}
See options for phyml by running:
phmyl --help
PhyML must be run with the "-i" option to specify an input or it will
segfault. Example:
phyml -i #{share}/nucleic
EOS
end
end
|
class Ponyc < Formula
desc "Object-oriented, actor-model, capabilities-secure programming language"
homepage "http://www.ponylang.org"
url "http://www.ponylang.org/releases/source/ponyc-0.1.6.tar.bz2"
sha256 "28592dd60320e1a587d256e08e7053e42975f8dc3dd5fb5eb0fd57baae5dc01e"
bottle do
sha256 "c5d4837fdcdcb8abff9faef03002b64ea589e53cb10cfcd703eee505483f5fed" => :yosemite
sha256 "9b96cf934f39d9f61170704ba1165b718b868bd56bc089a343970a9ef0ca8d3d" => :mavericks
sha256 "49e11ccb179955ad14703e5ce2c965b28519d2937b82b4b93379c8356aac4925" => :mountain_lion
end
depends_on "llvm" => "with-rtti"
needs :cxx11
def install
ENV.cxx11
system "make", "install", "config=release", "destdir=#{prefix}"
end
test do
system "#{bin}/ponyc", "-rexpr", "#{prefix}/packages/builtin"
end
end
ponyc 0.1.7
Closes Homebrew/homebrew#40857.
Signed-off-by: Xu Cheng <9a05244150b861e40c78843b801eed71bca54eac@me.com>
class Ponyc < Formula
desc "Object-oriented, actor-model, capabilities-secure programming language"
homepage "http://www.ponylang.org"
url "http://www.ponylang.org/releases/source/ponyc-0.1.7.tar.bz2"
sha256 "fc6f783f65cd6708a80bdea71f414cada801528143ea22d9bb13957cb7061eb6"
bottle do
sha256 "c5d4837fdcdcb8abff9faef03002b64ea589e53cb10cfcd703eee505483f5fed" => :yosemite
sha256 "9b96cf934f39d9f61170704ba1165b718b868bd56bc089a343970a9ef0ca8d3d" => :mavericks
sha256 "49e11ccb179955ad14703e5ce2c965b28519d2937b82b4b93379c8356aac4925" => :mountain_lion
end
depends_on "llvm" => "with-rtti"
needs :cxx11
def install
ENV.cxx11
system "make", "install", "config=release", "destdir=#{prefix}"
end
test do
system "#{bin}/ponyc", "-rexpr", "#{prefix}/packages/builtin"
end
end
|
class Ponyc < Formula
desc "Object-oriented, actor-model, capabilities-secure programming language"
homepage "https://www.ponylang.org/"
url "https://github.com/ponylang/ponyc/archive/0.31.0.tar.gz"
sha256 "74bb8ccbfc4201e14a2f66502033397d63179f073be04ee366a66d329dd56778"
head "https://github.com/ponylang/ponyc.git"
bottle do
cellar :any
sha256 "1e31b7a35c59af6641c7efe49f9b2d1cb171410c3d5afbe75fe0a559c5f5987d" => :mojave
sha256 "eb7677788987281f1f2032b59ef4cd5e5fa01896e79b346638bdb6fe8a8480e7" => :high_sierra
sha256 "3edc0fc29683d3e6d1143c73ac0508d8beba49a499268d876b2cc8671d1959d7" => :sierra
end
# https://github.com/ponylang/ponyc/issues/1274
# https://github.com/Homebrew/homebrew-core/issues/5346
pour_bottle? do
reason <<~EOS
The bottle requires Xcode/CLT 8.0 or later to work properly.
EOS
satisfy { DevelopmentTools.clang_build_version >= 800 }
end
depends_on "llvm@7"
depends_on :macos => :yosemite
def install
ENV.cxx11
ENV["LLVM_CONFIG"] = "#{Formula["llvm@7"].opt_bin}/llvm-config"
system "make", "install", "verbose=1", "config=release",
"ponydir=#{prefix}", "prefix="
end
test do
system "#{bin}/ponyc", "-rexpr", "#{prefix}/packages/stdlib"
(testpath/"test/main.pony").write <<~EOS
actor Main
new create(env: Env) =>
env.out.print("Hello World!")
EOS
system "#{bin}/ponyc", "test"
assert_equal "Hello World!", shell_output("./test1").strip
end
end
ponyc: update 0.31.0 bottle.
class Ponyc < Formula
desc "Object-oriented, actor-model, capabilities-secure programming language"
homepage "https://www.ponylang.org/"
url "https://github.com/ponylang/ponyc/archive/0.31.0.tar.gz"
sha256 "74bb8ccbfc4201e14a2f66502033397d63179f073be04ee366a66d329dd56778"
head "https://github.com/ponylang/ponyc.git"
bottle do
cellar :any
sha256 "655afafb64d7b0b4cdeb03dd4c4d630ce9a2492c3939562eec9024c75182ced1" => :mojave
sha256 "94ba5d35ffe02c3034c213b12ed5f6db2c1782f06e5d4ff812e0b83b50f8f558" => :high_sierra
sha256 "847c0653e378ed949248256d459896c875a8d652279769dd88dc1ebb996850c8" => :sierra
end
# https://github.com/ponylang/ponyc/issues/1274
# https://github.com/Homebrew/homebrew-core/issues/5346
pour_bottle? do
reason <<~EOS
The bottle requires Xcode/CLT 8.0 or later to work properly.
EOS
satisfy { DevelopmentTools.clang_build_version >= 800 }
end
depends_on "llvm@7"
depends_on :macos => :yosemite
def install
ENV.cxx11
ENV["LLVM_CONFIG"] = "#{Formula["llvm@7"].opt_bin}/llvm-config"
system "make", "install", "verbose=1", "config=release",
"ponydir=#{prefix}", "prefix="
end
test do
system "#{bin}/ponyc", "-rexpr", "#{prefix}/packages/stdlib"
(testpath/"test/main.pony").write <<~EOS
actor Main
new create(env: Env) =>
env.out.print("Hello World!")
EOS
system "#{bin}/ponyc", "test"
assert_equal "Hello World!", shell_output("./test1").strip
end
end
|
class Procs < Formula
desc "Modern replacement for ps written by Rust"
homepage "https://github.com/dalance/procs"
url "https://github.com/dalance/procs/archive/v0.8.16.tar.gz"
sha256 "8f0f014079f2769f3a9f4d01aeb79ed169398c8382a346699304cff32ba987da"
bottle do
cellar :any_skip_relocation
sha256 "7407ff757136c071c07ed1d604242f98a82ed9b2e2466e7b176b1b1226fc1339" => :catalina
sha256 "170081d604733bb6fa86ccf599dbd7feddedcfce7c767eb438c89f49c2c6010b" => :mojave
sha256 "a42ad2cf8b274cc0ed0b1b978b6896afadf4b2956836beacf994abb9455aa54c" => :high_sierra
end
depends_on "rust" => :build
def install
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
end
test do
output = shell_output("#{bin}/procs")
count = output.lines.count
assert count > 2
assert output.start_with?(" PID:")
end
end
procs: update 0.8.16 bottle.
Closes #18743.
Signed-off-by: Dawid Dziurla <c4a7db180859322ef5630a1dfc2805b5bc97fc25@gmail.com>
class Procs < Formula
desc "Modern replacement for ps written by Rust"
homepage "https://github.com/dalance/procs"
url "https://github.com/dalance/procs/archive/v0.8.16.tar.gz"
sha256 "8f0f014079f2769f3a9f4d01aeb79ed169398c8382a346699304cff32ba987da"
bottle do
cellar :any_skip_relocation
sha256 "7407ff757136c071c07ed1d604242f98a82ed9b2e2466e7b176b1b1226fc1339" => :catalina
sha256 "170081d604733bb6fa86ccf599dbd7feddedcfce7c767eb438c89f49c2c6010b" => :mojave
sha256 "a42ad2cf8b274cc0ed0b1b978b6896afadf4b2956836beacf994abb9455aa54c" => :high_sierra
sha256 "976ed222895f4c33034498622b97c1dbfa0a10c0c048bc2003eae79549ebc5e7" => :x86_64_linux
end
depends_on "rust" => :build
def install
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
end
test do
output = shell_output("#{bin}/procs")
count = output.lines.count
assert count > 2
assert output.start_with?(" PID:")
end
end
|
class Procs < Formula
desc "Modern replacement for ps written by Rust"
homepage "https://github.com/dalance/procs"
url "https://github.com/dalance/procs/archive/v0.11.3.tar.gz"
sha256 "bf56fde52d0f6544a2ca3db6d4552867e5cf9daf1c5a31f8b3ad6e3258986b0f"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, big_sur: "94ee0bcfdb8ff6a0aa12591593a8b70a0f77cc5a2b7159bd34d34b34bff92a61"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3008bb790329683036c24cf85abe1088f6058db3a3eb54e033a42f24878df0aa"
sha256 cellar: :any_skip_relocation, catalina: "74096d5074fa5171235dbeef0d8ba9c227f6da4128b9094e393651795bd20a8f"
sha256 cellar: :any_skip_relocation, mojave: "38eb93c5e9ecb2b684fee7bbc9c7e479f72df7e4799b202891a7158ae53ea02b"
end
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
end
test do
output = shell_output("#{bin}/procs")
count = output.lines.count
assert count > 2
assert output.start_with?(" PID:")
end
end
procs: update 0.11.3 bottle.
class Procs < Formula
desc "Modern replacement for ps written by Rust"
homepage "https://github.com/dalance/procs"
url "https://github.com/dalance/procs/archive/v0.11.3.tar.gz"
sha256 "bf56fde52d0f6544a2ca3db6d4552867e5cf9daf1c5a31f8b3ad6e3258986b0f"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, big_sur: "94ee0bcfdb8ff6a0aa12591593a8b70a0f77cc5a2b7159bd34d34b34bff92a61"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "3008bb790329683036c24cf85abe1088f6058db3a3eb54e033a42f24878df0aa"
sha256 cellar: :any_skip_relocation, catalina: "74096d5074fa5171235dbeef0d8ba9c227f6da4128b9094e393651795bd20a8f"
sha256 cellar: :any_skip_relocation, mojave: "38eb93c5e9ecb2b684fee7bbc9c7e479f72df7e4799b202891a7158ae53ea02b"
sha256 cellar: :any_skip_relocation, x86_64_linux: "3d43ec2f118295190dbdd88069298332c106e43e73068edf084f8abdfbfd6b87"
end
depends_on "rust" => :build
def install
system "cargo", "install", *std_cargo_args
end
test do
output = shell_output("#{bin}/procs")
count = output.lines.count
assert count > 2
assert output.start_with?(" PID:")
end
end
|
class Pyenv < Formula
desc "Python version management"
homepage "https://github.com/pyenv/pyenv"
url "https://github.com/pyenv/pyenv/archive/v1.2.8.tar.gz"
sha256 "79c0ba0fa6fce3aa71e71d666d8082badbb52bc88dc3ed05b3c4b1ceeba54991"
version_scheme 1
head "https://github.com/pyenv/pyenv.git"
bottle do
cellar :any
sha256 "91995c220edec23af2798e302e3a197bee2c9a153dffb7f51e3a7308120b0a54" => :mojave
sha256 "44c787de32fd6e1d17a79e6e927a20cfd175056948f0ad1bb621a6c2f06b8534" => :high_sierra
sha256 "20c3dd22f4baa8b4557229483258d0c65bfefe8e4546c0a15a948e17ad51f315" => :sierra
sha256 "86182bb87c253e24eb02a5c621e9a393c36dc9411678afb61dd934f6847237d5" => :el_capitan
end
depends_on "autoconf"
depends_on "openssl"
depends_on "pkg-config"
depends_on "readline"
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
system "src/configure"
system "make", "-C", "src"
prefix.install Dir["*"]
%w[pyenv-install pyenv-uninstall python-build].each do |cmd|
bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}"
end
end
test do
shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions")
end
end
pyenv: update 1.2.8 bottle.
class Pyenv < Formula
desc "Python version management"
homepage "https://github.com/pyenv/pyenv"
url "https://github.com/pyenv/pyenv/archive/v1.2.8.tar.gz"
sha256 "79c0ba0fa6fce3aa71e71d666d8082badbb52bc88dc3ed05b3c4b1ceeba54991"
version_scheme 1
head "https://github.com/pyenv/pyenv.git"
bottle do
cellar :any
sha256 "dea10b5b953c6772d5bc7358e0afba94ed458aeab405211ba47a7dc7e3887989" => :mojave
sha256 "9f206fc149947ee70a2b047e8997b6bf0e523bdef0ef5114a3fc757da4352b61" => :high_sierra
sha256 "a950cc23612877468d69dc8c896eec55fd52bd8e8bbfa9c5c03d26bd5322b106" => :sierra
end
depends_on "autoconf"
depends_on "openssl"
depends_on "pkg-config"
depends_on "readline"
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
system "src/configure"
system "make", "-C", "src"
prefix.install Dir["*"]
%w[pyenv-install pyenv-uninstall python-build].each do |cmd|
bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}"
end
end
test do
shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions")
end
end
|
class Pyenv < Formula
desc "Python version management"
homepage "https://github.com/pyenv/pyenv"
url "https://github.com/pyenv/pyenv/archive/1.2.25.tar.gz"
sha256 "ecb34d3eeb4042cdeb2db8fb14db387af486e49ec41bbdcec7b9c95d65a44151"
license "MIT"
version_scheme 1
head "https://github.com/pyenv/pyenv.git"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any, arm64_big_sur: "38eb9ebf6ba630e5291a1c4c50943278858553bb70bc7302c163f35d289789bf"
sha256 cellar: :any, big_sur: "e97e845395083a8dd1261cbcae543f9707d3948180763e5dd96bd4f2b48f6f82"
sha256 cellar: :any, catalina: "03d0687354f87759cda216809cb7d3888936279a09002e47eaa6237d6245408a"
sha256 cellar: :any, mojave: "6347e3e5e40c312ba0ee7a0e1f6bc250f5386db981edcc354b8d102844344794"
end
depends_on "autoconf"
depends_on "openssl@1.1"
depends_on "pkg-config"
depends_on "readline"
uses_from_macos "bzip2"
uses_from_macos "libffi"
uses_from_macos "ncurses"
uses_from_macos "xz"
uses_from_macos "zlib"
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
system "src/configure"
system "make", "-C", "src"
prefix.install Dir["*"]
%w[pyenv-install pyenv-uninstall python-build].each do |cmd|
bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}"
end
# Do not manually install shell completions. See:
# - https://github.com/pyenv/pyenv/issues/1056#issuecomment-356818337
# - https://github.com/Homebrew/homebrew-core/pull/22727
end
test do
shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions")
end
end
pyenv 1.2.26
Closes #74562.
Signed-off-by: Thierry Moisan <8bf87a6c4caed0437859f8c8fafc6782533e4540@gmail.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Pyenv < Formula
desc "Python version management"
homepage "https://github.com/pyenv/pyenv"
url "https://github.com/pyenv/pyenv/archive/1.2.26.tar.gz"
sha256 "004a47be4919ca717bee546d3062543d166c24678a21a9a5aa75f3bd0653c5d2"
license "MIT"
version_scheme 1
head "https://github.com/pyenv/pyenv.git"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any, arm64_big_sur: "38eb9ebf6ba630e5291a1c4c50943278858553bb70bc7302c163f35d289789bf"
sha256 cellar: :any, big_sur: "e97e845395083a8dd1261cbcae543f9707d3948180763e5dd96bd4f2b48f6f82"
sha256 cellar: :any, catalina: "03d0687354f87759cda216809cb7d3888936279a09002e47eaa6237d6245408a"
sha256 cellar: :any, mojave: "6347e3e5e40c312ba0ee7a0e1f6bc250f5386db981edcc354b8d102844344794"
end
depends_on "autoconf"
depends_on "openssl@1.1"
depends_on "pkg-config"
depends_on "readline"
uses_from_macos "bzip2"
uses_from_macos "libffi"
uses_from_macos "ncurses"
uses_from_macos "xz"
uses_from_macos "zlib"
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
system "src/configure"
system "make", "-C", "src"
prefix.install Dir["*"]
%w[pyenv-install pyenv-uninstall python-build].each do |cmd|
bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}"
end
# Do not manually install shell completions. See:
# - https://github.com/pyenv/pyenv/issues/1056#issuecomment-356818337
# - https://github.com/Homebrew/homebrew-core/pull/22727
end
test do
shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions")
end
end
|
require 'formula'
class Pyqt5 < Formula
homepage 'http://www.riverbankcomputing.co.uk/software/pyqt/download5'
url 'http://downloads.sf.net/project/pyqt/PyQt5/PyQt-5.2/PyQt-gpl-5.2.tar.gz'
sha1 'a1c232d34ab268587c127ad3097c725ee1a70cf0'
option 'enable-debug', "Build with debug symbols"
depends_on :python3 => :recommended
depends_on :python => :optional
if !Formula.factory("python").installed? && build.with?("python") &&
build.with?("python3")
odie <<-EOS.undent
pyqt5: You cannot use system Python 2 and Homebrew's Python 3 simultaneously.
Either `brew install python` or use `--without-python3`.
EOS
elsif build.without?("python3") && build.without?("python")
odie "pyqt5: --with-python3 must be specified when using --without-python"
end
depends_on 'qt5'
if build.with? 'python3'
depends_on 'sip' => 'with-python3'
else
depends_on 'sip'
end
def pythons
pythons = []
["python", "python3"].each do |python|
next if build.without? python
version = /\d\.\d/.match `#{python} --version 2>&1`
pythons << [python, version]
end
pythons
end
def install
pythons.each do |python, version|
args = [ "--confirm-license",
"--bindir=#{bin}",
"--destdir=#{lib}/python#{version}/site-packages",
# To avoid conflicts with PyQt (for Qt4):
"--sipdir=#{share}/sip/Qt5/",
# sip.h could not be found automatically
"--sip-incdir=#{Formula.factory('sip').opt_prefix}/include",
# Force deployment target to avoid libc++ issues
"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" ]
args << '--debug' if build.include? 'enable-debug'
system python, "configure.py", *args
system "make"
system "make", "install"
system "make", "clean" if pythons.length > 1
end
end
test do
system "pyuic5", "--version"
system "pylupdate5", "-version"
pythons.each do |python, version|
system python, "-c", "import PyQt5"
end
end
end
pyqt5: use Formula[]
require 'formula'
class Pyqt5 < Formula
homepage 'http://www.riverbankcomputing.co.uk/software/pyqt/download5'
url 'http://downloads.sf.net/project/pyqt/PyQt5/PyQt-5.2/PyQt-gpl-5.2.tar.gz'
sha1 'a1c232d34ab268587c127ad3097c725ee1a70cf0'
option 'enable-debug', "Build with debug symbols"
depends_on :python3 => :recommended
depends_on :python => :optional
if !Formula["python"].installed? && build.with?("python") &&
build.with?("python3")
odie <<-EOS.undent
pyqt5: You cannot use system Python 2 and Homebrew's Python 3 simultaneously.
Either `brew install python` or use `--without-python3`.
EOS
elsif build.without?("python3") && build.without?("python")
odie "pyqt5: --with-python3 must be specified when using --without-python"
end
depends_on 'qt5'
if build.with? 'python3'
depends_on 'sip' => 'with-python3'
else
depends_on 'sip'
end
def pythons
pythons = []
["python", "python3"].each do |python|
next if build.without? python
version = /\d\.\d/.match `#{python} --version 2>&1`
pythons << [python, version]
end
pythons
end
def install
pythons.each do |python, version|
args = [ "--confirm-license",
"--bindir=#{bin}",
"--destdir=#{lib}/python#{version}/site-packages",
# To avoid conflicts with PyQt (for Qt4):
"--sipdir=#{share}/sip/Qt5/",
# sip.h could not be found automatically
"--sip-incdir=#{Formula["sip"].opt_prefix}/include",
# Force deployment target to avoid libc++ issues
"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" ]
args << '--debug' if build.include? 'enable-debug'
system python, "configure.py", *args
system "make"
system "make", "install"
system "make", "clean" if pythons.length > 1
end
end
test do
system "pyuic5", "--version"
system "pylupdate5", "-version"
pythons.each do |python, version|
system python, "-c", "import PyQt5"
end
end
end
|
class Qjson < Formula
desc "Map JSON to QVariant objects"
homepage "http://qjson.sourceforge.net"
url "https://downloads.sourceforge.net/project/qjson/qjson/0.8.1/qjson-0.8.1.tar.bz2"
mirror "https://mirrors.kernel.org/debian/pool/main/q/qjson/qjson_0.8.1.orig.tar.bz2"
sha256 "cd4db5b956247c4991a9c3e95512da257cd2a6bd011357e363d02300afc814d9"
head "https://github.com/flavio/qjson.git"
bottle do
cellar :any
revision 2
sha256 "4d47edace9872cd7cb267ca6e77c7f7d55400918cbdc57d45e4ee5d12087f4da" => :el_capitan
sha256 "a505ef97e0a0a3e05013ef1aa641af1104dedb363ff75c7d23b2c3dee5299649" => :yosemite
sha256 "2563c0f4d42e92136279434e9e73201b3117993d2eaa949359dab9c148d71710" => :mavericks
end
depends_on "cmake" => :build
depends_on "qt"
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <qjson/parser.h>
int main() {
QJson::Parser parser;
return 0;
}
EOS
system ENV.cxx, "-I#{include}", "-L#{lib}", "-lqjson",
testpath/"test.cpp", "-o", testpath/"test"
system "./test"
end
end
qjson 0.9.0
Closes #7410.
Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com>
class Qjson < Formula
desc "Map JSON to QVariant objects"
homepage "http://qjson.sourceforge.net"
url "https://github.com/flavio/qjson/archive/0.9.0.tar.gz"
sha256 "e812617477f3c2bb990561767a4cd8b1d3803a52018d4878da302529552610d4"
bottle do
cellar :any
revision 2
sha256 "4d47edace9872cd7cb267ca6e77c7f7d55400918cbdc57d45e4ee5d12087f4da" => :el_capitan
sha256 "a505ef97e0a0a3e05013ef1aa641af1104dedb363ff75c7d23b2c3dee5299649" => :yosemite
sha256 "2563c0f4d42e92136279434e9e73201b3117993d2eaa949359dab9c148d71710" => :mavericks
end
depends_on "cmake" => :build
depends_on "qt5"
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <qjson-qt5/parser.h>
int main() {
QJson::Parser parser;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11", "-I#{include}",
"-L#{lib}", "-lqjson-qt5",
"-I#{Formula["qt5"].opt_include}",
"-F#{Formula["qt5"].opt_lib}", "-framework", "QtCore"
system "./test"
end
end
|
class Quill < Formula
desc "C++17 Asynchronous Low Latency Logging Library"
homepage "https://github.com/odygrd/quill"
url "https://github.com/odygrd/quill/archive/v2.0.1.tar.gz"
sha256 "39527aca74edd02d9df0bba62211df9f6d53984d4f6cca470734e19c4d8b69fb"
license "MIT"
head "https://github.com/odygrd/quill.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "b3dd00263847be710f058bc6cd6395c41d254c7c27177c427e0eb8d8ab2c8fc9"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1eea3220d9dca9856367b5a9954ad6411c1493963bceb7631968ae0ec58b3876"
sha256 cellar: :any_skip_relocation, monterey: "b590cb7f606c77dcc54c97a000052705ae2fd12692f7e018f11b02e1a248a445"
sha256 cellar: :any_skip_relocation, big_sur: "dc256f5c6fa1a2b648c0488aad6f59930f147fc911e9b7f640f1672046aa81ba"
sha256 cellar: :any_skip_relocation, catalina: "fcd86fd1ec214cc8ad5b6554d48f80e200464ce76811061d9976f56b3e8fb685"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ab2de46843bae5e9820b62cc6728bb24c7d40fe359711db394c17708ebcaba5c"
end
depends_on "cmake" => :build
on_linux do
depends_on "gcc"
end
fails_with gcc: "5"
def install
mkdir "quill-build" do
args = std_cmake_args
args << ".."
system "cmake", *args
system "make", "install"
end
end
test do
(testpath/"test.cpp").write <<~EOS
#include "quill/Quill.h"
int main()
{
quill::start();
quill::Handler* file_handler = quill::file_handler("#{testpath}/basic-log.txt", "w");
quill::Logger* logger = quill::create_logger("logger_bar", file_handler);
LOG_INFO(logger, "Test");
}
EOS
system ENV.cxx, "-std=c++17", "test.cpp", "-I#{include}", "-L#{lib}", "-lquill", "-o", "test", "-pthread"
system "./test"
assert_predicate testpath/"basic-log.txt", :exist?
assert_match "Test", (testpath/"basic-log.txt").read
end
end
quill 2.0.2
Closes #102735.
Signed-off-by: Sean Molenaar <2b250e3fea88cfef248b497ad5fc17f7dc435154@users.noreply.github.com>
Signed-off-by: Rui Chen <907c7afd57be493757f13ccd1dd45dddf02db069@chenrui.dev>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Quill < Formula
desc "C++17 Asynchronous Low Latency Logging Library"
homepage "https://github.com/odygrd/quill"
url "https://github.com/odygrd/quill/archive/v2.0.2.tar.gz"
sha256 "d2dc9004886b787f8357e97d2f2d0c74a460259f7f95d65ab49d060fe34a9b5c"
license "MIT"
head "https://github.com/odygrd/quill.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "b3dd00263847be710f058bc6cd6395c41d254c7c27177c427e0eb8d8ab2c8fc9"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1eea3220d9dca9856367b5a9954ad6411c1493963bceb7631968ae0ec58b3876"
sha256 cellar: :any_skip_relocation, monterey: "b590cb7f606c77dcc54c97a000052705ae2fd12692f7e018f11b02e1a248a445"
sha256 cellar: :any_skip_relocation, big_sur: "dc256f5c6fa1a2b648c0488aad6f59930f147fc911e9b7f640f1672046aa81ba"
sha256 cellar: :any_skip_relocation, catalina: "fcd86fd1ec214cc8ad5b6554d48f80e200464ce76811061d9976f56b3e8fb685"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ab2de46843bae5e9820b62cc6728bb24c7d40fe359711db394c17708ebcaba5c"
end
depends_on "cmake" => :build
on_linux do
depends_on "gcc"
end
fails_with gcc: "5"
def install
mkdir "quill-build" do
args = std_cmake_args
args << ".."
system "cmake", *args
system "make", "install"
end
end
test do
(testpath/"test.cpp").write <<~EOS
#include "quill/Quill.h"
int main()
{
quill::start();
quill::Handler* file_handler = quill::file_handler("#{testpath}/basic-log.txt", "w");
quill::Logger* logger = quill::create_logger("logger_bar", file_handler);
LOG_INFO(logger, "Test");
}
EOS
system ENV.cxx, "-std=c++17", "test.cpp", "-I#{include}", "-L#{lib}", "-lquill", "-o", "test", "-pthread"
system "./test"
assert_predicate testpath/"basic-log.txt", :exist?
assert_match "Test", (testpath/"basic-log.txt").read
end
end
|
# coding: utf-8
require 'mechanize/test_case'
class TestMechanizeHttpAgent < Mechanize::TestCase
def setup
super
@agent = @mech.agent
@uri = URI.parse 'http://example/'
@req = Net::HTTP::Get.new '/'
@res = Net::HTTPOK.allocate
@res.instance_variable_set :@code, 200
@res.instance_variable_set :@header, {}
@headers = if RUBY_VERSION > '1.9' then
%w[accept user-agent]
else
%w[accept]
end
end
def auth_realm uri, scheme, type
base_uri = uri + '/'
realm = Mechanize::HTTP::AuthRealm.new scheme, base_uri, 'r'
@agent.authenticate_methods[base_uri][type] << realm
realm
end
def test_auto_io
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1024, input_io
assert_equal '12345', out_io.string
assert_equal Encoding::BINARY, out_io.string.encoding if
Object.const_defined? :Encoding
end
end
def test_auto_io_chunk
Tempfile.open 'input' do |input_io|
chunks = []
input_io.binmode
input_io.write '12345'
input_io.rewind
@agent.auto_io __name__, 1, input_io do |chunk|
chunks << chunk
end
assert_equal %w[1 2 3 4 5], chunks
end
end
def test_auto_io_tempfile
@agent.max_file_buffer = 3
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1, input_io
result = out_io.read
assert_equal '12345', result
assert_equal Encoding::BINARY, result.encoding if
Object.const_defined? :Encoding
end
end
def test_auto_io_yield
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1024, input_io do |chunk|
"x#{chunk}"
end
assert_equal 'x12345', out_io.string
end
end
def test_certificate_equals
cert_path = File.expand_path '../data/server.crt', __FILE__
cert = OpenSSL::X509::Certificate.new File.read cert_path
@agent.certificate = cert
assert_equal cert.to_pem, @agent.certificate.to_pem
end
def test_certificate_equals_file
cert_path = File.expand_path '../data/server.crt', __FILE__
cert = OpenSSL::X509::Certificate.new File.read cert_path
@agent.certificate = cert_path
assert_equal cert.to_pem, @agent.certificate.to_pem
end
def test_connection_for_file
uri = URI.parse 'file:///nonexistent'
conn = @agent.connection_for uri
assert_equal Mechanize::FileConnection.new, conn
end
def test_connection_for_http
conn = @agent.connection_for @uri
assert_equal @agent.http, conn
end
def test_disable_keep_alive
@agent.disable_keep_alive @req
refute @req['connection']
end
def test_disable_keep_alive_no
@agent.keep_alive = false
@agent.disable_keep_alive @req
assert_equal 'close', @req['connection']
end
def test_enable_gzip
@agent.enable_gzip @req
assert_equal 'gzip,deflate,identity', @req['accept-encoding']
end
def test_enable_gzip_no
@agent.gzip_enabled = false
@agent.enable_gzip @req
assert_equal 'identity', @req['accept-encoding']
end
def test_fetch_file_nonexistent
in_tmpdir do
nonexistent = File.join Dir.pwd, 'nonexistent'
uri = URI.parse "file://#{nonexistent}"
e = assert_raises Mechanize::ResponseCodeError do
@agent.fetch uri
end
assert_equal '404 => Net::HTTPNotFound', e.message
end
end
def test_fetch_file_plus
Tempfile.open '++plus++' do |io|
content = 'plusses +++'
io.write content
io.rewind
uri = URI.parse "file://#{Mechanize::Util.uri_escape io.path}"
page = @agent.fetch uri
assert_equal content, page.body
assert_kind_of Mechanize::File, page
end
end
def test_fetch_file_space
foo = File.expand_path("../htdocs/dir with spaces/foo.html", __FILE__)
uri = URI.parse "file://#{Mechanize::Util.uri_escape foo}"
page = @agent.fetch uri
assert_equal File.read(foo), page.body
assert_kind_of Mechanize::Page, page
end
def test_fetch_head_gzip
uri = @uri + '/gzip?file=index.html'
page = @agent.fetch uri, :head
assert_kind_of Mechanize::Page, page
end
def test_fetch_hooks
@agent.pre_connect_hooks << proc do |agent, request|
assert_equal '/index.html', request.path
assert_equal @agent, agent
end
@agent.post_connect_hooks << proc do |agent, uri, response, body|
assert_equal @agent, agent
assert_equal URI('http://example/index.html'), uri
assert_equal '200', response.code
assert_kind_of String, body
end
@agent.fetch URI 'http://example/index.html'
end
def test_fetch_post_connect_hook
response = nil
@agent.post_connect_hooks << lambda { |_, _, res, _| response = res }
@agent.fetch 'http://localhost/'
assert response
end
def test_fetch_server_error
e = assert_raises Mechanize::ResponseCodeError do
@mech.get 'http://localhost/response_code?code=500'
end
assert_equal '500', e.response_code
end
def test_get_meta_refresh_header_follow_self
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_equal [0.0, URI('http://example/')], refresh
end
def test_get_meta_refresh_header_no_follow
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_header_no_follow_self
@agent.follow_meta_refresh = true
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_meta_follow_self
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_equal [0, nil], refresh
end
def test_get_meta_refresh_meta_no_follow
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_meta_no_follow_self
@agent.follow_meta_refresh = true
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_robots
robotstxt = @agent.get_robots 'http://localhost/robots.txt'
refute_equal '', robotstxt
robotstxt = @agent.get_robots 'http://localhost/response_code?code=404'
assert_equal '', robotstxt
end
def test_hook_content_encoding_response
@mech.content_encoding_hooks << lambda{|agent, uri, response, response_body_io|
response['content-encoding'] = 'gzip' if response['content-encoding'] == 'agzip'}
@res.instance_variable_set :@header, 'content-encoding' => %w[agzip]
body_io = StringIO.new 'part'
@agent.hook_content_encoding @res, @uri, body_io
assert_equal 'gzip', @res['content-encoding']
end
def test_http_request_file
uri = URI.parse 'file:///nonexistent'
request = @agent.http_request uri, :get
assert_kind_of Mechanize::FileRequest, request
assert_equal '/nonexistent', request.path
end
def test_http_request_get
request = @agent.http_request @uri, :get
assert_kind_of Net::HTTP::Get, request
assert_equal '/', request.path
end
def test_http_request_post
request = @agent.http_request @uri, :post
assert_kind_of Net::HTTP::Post, request
assert_equal '/', request.path
end
def test_idle_timeout_equals
@agent.idle_timeout = 1
assert_equal 1, @agent.http.idle_timeout
end
def test_inflate
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
result = @agent.inflate body_io
assert_equal 'part', result.read
end
def test_post_connect
@agent.post_connect_hooks << proc { |agent, uri, response, body|
assert_equal @agent, agent
assert_equal @res, response
assert_equal 'body', body
throw :called
}
io = StringIO.new 'body'
assert_throws :called do
@agent.post_connect @uri, @res, io
end
assert_equal 0, io.pos
end
def test_pre_connect
@agent.pre_connect_hooks << proc { |agent, request|
assert_equal @agent, agent
assert_equal @req, request
throw :called
}
assert_throws :called do
@agent.pre_connect @req
end
end
def test_request_add_headers
@agent.request_add_headers @req, 'Content-Length' => 300
assert_equal '300', @req['content-length']
end
def test_request_add_headers_etag
@agent.request_add_headers @req, :etag => '300'
assert_equal '300', @req['etag']
end
def test_request_add_headers_if_modified_since
@agent.request_add_headers @req, :if_modified_since => 'some_date'
assert_equal 'some_date', @req['if-modified-since']
end
def test_request_add_headers_none
@agent.request_add_headers @req
assert_equal @headers, @req.to_hash.keys.sort
end
def test_request_add_headers_request_headers
@agent.request_headers['X-Foo'] = 'bar'
@agent.request_add_headers @req
assert_equal @headers + %w[x-foo], @req.to_hash.keys.sort
end
def test_request_add_headers_symbol
e = assert_raises ArgumentError do
@agent.request_add_headers @req, :content_length => 300
end
assert_equal 'unknown header symbol content_length', e.message
end
def test_request_auth_basic
@agent.user = 'user'
@agent.password = 'password'
auth_realm @uri, 'Basic', :basic
@agent.request_auth @req, @uri
assert_match %r%^Basic %, @req['Authorization']
end
def test_request_auth_digest
@agent.user = 'user'
@agent.password = 'password'
realm = auth_realm @uri, 'Digest', :digest
@agent.digest_challenges[realm] = 'Digest realm=r, qop="auth"'
@agent.request_auth @req, @uri
assert_match %r%^Digest %, @req['Authorization']
assert_match %r%qop=auth%, @req['Authorization']
end
def test_request_auth_iis_digest
@agent.user = 'user'
@agent.password = 'password'
realm = auth_realm @uri, 'Digest', :digest
@agent.digest_challenges[realm] = 'Digest realm=r, qop="auth"'
@agent.request_auth @req, @uri
assert_match %r%^Digest %, @req['Authorization']
assert_match %r%qop=auth%, @req['Authorization']
end
def test_request_auth_none
@agent.request_auth @req, @uri
assert_nil @req['Authorization']
end
def test_request_cookies
uri = URI.parse 'http://host.example.com'
Mechanize::Cookie.parse uri, 'hello=world domain=.example.com' do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, uri
assert_equal 'hello=world domain=.example.com', @req['Cookie']
end
def test_request_cookies_many
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com, c=d domain=.example.com'
Mechanize::Cookie.parse uri, cookie_str do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, uri
expected = cookie_str.sub ', ', '; '
assert_equal expected, @req['Cookie']
end
def test_request_cookies_none
@agent.request_cookies @req, @uri
assert_nil @req['Cookie']
end
def test_request_cookies_wrong_domain
uri = URI.parse 'http://host.example.com'
Mechanize::Cookie.parse uri, 'hello=world domain=.example.com' do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, @uri
assert_nil @req['Cookie']
end
def test_request_host
@agent.request_host @req, @uri
assert_equal 'example', @req['host']
end
def test_request_host_nonstandard
@uri.port = 81
@agent.request_host @req, @uri
assert_equal 'example:81', @req['host']
end
def test_request_language_charset
@agent.request_language_charset @req
assert_equal 'en-us,en;q=0.5', @req['accept-language']
assert_equal 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', @req['accept-charset']
end
def test_request_referer
referer = URI.parse 'http://old.example'
@agent.request_referer @req, @uri, referer
assert_equal 'http://old.example', @req['referer']
end
def test_request_referer_https
uri = URI.parse 'https://example'
referer = URI.parse 'https://old.example'
@agent.request_referer @req, uri, referer
assert_equal 'https://old.example', @req['referer']
end
def test_request_referer_https_downgrade
referer = URI.parse 'https://old.example'
@agent.request_referer @req, @uri, referer
assert_nil @req['referer']
end
def test_request_referer_https_downgrade_case
uri = URI.parse 'http://example'
referer = URI.parse 'httpS://old.example'
@agent.request_referer @req, uri, referer
assert_nil @req['referer']
end
def test_request_referer_https_upgrade
uri = URI.parse 'https://example'
referer = URI.parse 'http://old.example'
@agent.request_referer @req, uri, referer
assert_equal 'http://old.example', @req['referer']
end
def test_request_referer_none
@agent.request_referer @req, @uri, nil
assert_nil @req['referer']
end
def test_request_referer_strip
uri = URI.parse 'http://example.com/index.html'
host_path = "old.example/page.html?q=x"
referer = "http://#{host_path}"
[
"",
"@",
"user1@",
":@",
"user1:@",
":password1@",
"user1:password1@",
].each { |userinfo|
['', '#frag'].each { |frag|
url = URI.parse "http://#{userinfo}#{host_path}#{frag}"
@agent.request_referer @req, uri, url
assert_equal referer, @req['referer'], url
}
}
end
def test_request_user_agent
@agent.request_user_agent @req
assert_match %r%^Mechanize/#{Mechanize::VERSION}%, @req['user-agent']
ruby_version = if RUBY_PATCHLEVEL >= 0 then
"#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
else
"#{RUBY_VERSION}dev#{RUBY_REVISION}"
end
assert_match %r%Ruby/#{ruby_version}%, @req['user-agent']
end
def test_resolve_bad_uri
e = assert_raises ArgumentError do
@agent.resolve 'google'
end
assert_equal 'absolute URL needed (not google)', e.message
end
def test_resolve_utf8
uri = 'http://example?q=ü'
resolved = @agent.resolve uri
assert_equal '/?q=%C3%BC', resolved.request_uri
end
def test_resolve_parameters_body
input_params = { :q => 'hello' }
uri, params = @agent.resolve_parameters @uri, :post, input_params
assert_equal 'http://example/', uri.to_s
assert_equal input_params, params
end
def test_resolve_parameters_query
uri, params = @agent.resolve_parameters @uri, :get, :q => 'hello'
assert_equal 'http://example/?q=hello', uri.to_s
assert_nil params
end
def test_resolve_parameters_query_append
input_params = { :q => 'hello' }
@uri.query = 'a=b'
uri, params = @agent.resolve_parameters @uri, :get, input_params
assert_equal 'http://example/?a=b&q=hello', uri.to_s
assert_nil params
end
def test_response_authenticate
@res.instance_variable_set :@header, 'www-authenticate' => ['Basic realm=r']
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Basic', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:basic]
end
def test_response_authenticate_digest
@res.instance_variable_set(:@header,
'www-authenticate' => ['Digest realm=r'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:digest]
challenge = Mechanize::HTTP::AuthChallenge.new 'Digest', 'realm' => 'r'
assert_equal challenge, @agent.digest_challenges[realm]
end
def test_response_authenticate_digest_iis
@res.instance_variable_set(:@header,
'www-authenticate' => ['Digest realm=r'],
'server' => ['Microsoft-IIS'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:iis_digest]
end
def test_response_authenticate_multiple
@res.instance_variable_set(:@header,
'www-authenticate' =>
['Basic realm=r, Digest realm=r'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:digest]
assert_empty @agent.authenticate_methods[base_uri][:basic]
end
def test_response_authenticate_no_www_authenticate
denied = page URI('http://example/denied'), 'text/html', '', 403
@agent.user = 'user'
@agent.password = 'password'
e = assert_raises Mechanize::UnauthorizedError do
@agent.response_authenticate @res, denied, @uri, @req, {}, nil, nil
end
assert_equal '403 => Net::HTTPForbidden', e.message
end
def test_response_authenticate_ntlm
@uri += '/ntlm'
@res.instance_variable_set(:@header,
'www-authenticate' => ['Negotiate, NTLM'])
@agent.user = 'user'
@agent.password = 'password'
@agent.domain = 'domain'
page = @agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
assert_equal 'ok', page.body # lame test
end
def test_response_authenticate_unknown
@agent.user = 'user'
@agent.password = 'password'
page = Mechanize::File.new nil, nil, nil, 401
@res.instance_variable_set(:@header,
'www-authenticate' => ['Unknown realm=r'])
assert_raises Mechanize::UnauthorizedError do
@agent.response_authenticate @res, page, @uri, @req, nil, nil, nil
end
end
def test_response_content_encoding_7_bit
@res.instance_variable_set :@header, 'content-encoding' => %w[7bit]
body = @agent.response_content_encoding @res, StringIO.new('part')
assert_equal 'part', body.read
end
def test_response_content_encoding_deflate
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
end
def test_response_content_encoding_deflate_chunked
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_content_encoding_deflate_corrupt
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01" # missing 1 byte
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding deflate:%, e.message
assert_match %r%Zlib%, e.message
assert body_io.closed?
end
def test_response_content_encoding_deflate_empty
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, StringIO.new
assert_equal '', body.read
end
# IIS/6.0 ASP.NET/2.0.50727 does not wrap deflate with zlib, WTF?
def test_response_content_encoding_deflate_no_zlib
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, StringIO.new("+H,*\001\000")
assert_equal 'part', body.read
end
def test_response_content_encoding_gzip
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
end
def test_response_content_encoding_gzip_chunked
def @res.content_length() nil end
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_content_encoding_gzip_corrupt
log = StringIO.new
logger = Logger.new log
@agent.context.log = logger
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001"
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding gzip:%, e.message
assert_match %r%Zlib%, e.message
assert_match %r%unable to gunzip response, trying raw inflate%, log.string
assert_match %r%unable to gunzip response:%, log.string
assert body_io.closed?
end
def test_response_content_encoding_gzip_corrupt_checksum
log = StringIO.new
logger = Logger.new log
@agent.context.log = logger
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000"
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding gzip:%, e.message
assert_match %r%Zlib%, e.message
assert_match %r%unable to gunzip response, trying raw inflate%, log.string
end
def test_response_content_encoding_gzip_empty
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body = @agent.response_content_encoding @res, StringIO.new
assert_equal '', body.read
end
def test_response_content_encoding_gzip_encoding_bad
@res.instance_variable_set(:@header,
'content-encoding' => %w[gzip],
'content-type' => 'text/html; charset=UTF-8')
# "test\xB2"
body_io = StringIO.new \
"\037\213\b\000*+\314N\000\003+I-.\331\004\000x\016\003\376\005\000\000\000"
body = @agent.response_content_encoding @res, body_io
expected = "test\xB2"
expected.force_encoding Encoding::BINARY if have_encoding?
content = body.read
assert_equal expected, content
assert_equal Encoding::BINARY, content.encoding if have_encoding?
end
def test_response_content_encoding_none
@res.instance_variable_set :@header, 'content-encoding' => %w[none]
body = @agent.response_content_encoding @res, StringIO.new('part')
assert_equal 'part', body.read
end
def test_response_content_encoding_tempfile_7_bit
body_io = tempfile 'part'
@res.instance_variable_set :@header, 'content-encoding' => %w[7bit]
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
refute body_io.closed?
ensure
begin
body_io.close! unless body_io.closed?
rescue IOError
# HACK for ruby 1.8
end
end
def test_response_content_encoding_tempfile_gzip
body_io = tempfile "x\x9C+H,*\x01\x00\x04?\x01\xB8"
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
ensure
body_io.close! unless body_io.closed?
end
def test_response_content_encoding_unknown
@res.instance_variable_set :@header, 'content-encoding' => %w[unknown]
body = StringIO.new 'part'
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body
end
assert_equal 'unsupported content-encoding: unknown', e.message
end
def test_response_content_encoding_x_gzip
@res.instance_variable_set :@header, 'content-encoding' => %w[x-gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_cookies
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com'
@res.instance_variable_set(:@header,
'set-cookie' => [cookie_str],
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, '', 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_cookies_many
uri = URI.parse 'http://host.example.com'
cookie1 = 'a=b domain=.example.com'
cookie2 = 'c=d domain=.example.com'
@res.instance_variable_set(:@header,
'set-cookie' => [cookie1, cookie2],
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, '', 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com', 'c=d domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_cookies_meta
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com'
body = <<-BODY
<head>
<meta http-equiv="Set-Cookie" content="#{cookie_str}">
</head>"
BODY
@res.instance_variable_set(:@header,
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, body, 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_follow_meta_refresh
uri = URI.parse 'http://example/#id+1'
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(uri, nil, body, 200, @mech)
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
page = @agent.response_follow_meta_refresh @res, uri, page, 0
assert_equal uri, page.uri
end
def test_response_follow_meta_refresh_limit
uri = URI.parse 'http://example/#id+1'
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(uri, nil, body, 200, @mech)
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
assert_raises Mechanize::RedirectLimitReachedError do
@agent.response_follow_meta_refresh(@res, uri, page,
@agent.redirection_limit)
end
end
def test_response_parse
body = '<title>hi</title>'
@res.instance_variable_set :@header, 'content-type' => %w[text/html]
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
end
def test_response_parse_content_type_case
body = '<title>hi</title>'
@res.instance_variable_set(:@header, 'content-type' => %w[text/HTML])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'text/HTML', page.content_type
end
def test_response_parse_content_type_encoding
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html;charset=ISO-8859-1])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
assert_equal 'ISO-8859-1', page.encoding
assert_equal 'ISO-8859-1', page.parser.encoding
end
def test_response_parse_content_type_encoding_broken_iso_8859_1
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=ISO_8859-1])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'ISO_8859-1', page.encoding
end
def test_response_parse_content_type_encoding_broken_utf_8
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=UTF8])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'UTF8', page.encoding
assert_equal 'UTF8', page.parser.encoding
end
def test_response_parse_content_type_encoding_garbage
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=garbage_charset])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
end
def test_response_parse_content_type_encoding_semicolon
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html;charset=UTF-8;])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'UTF-8', page.encoding
end
def test_response_read
def @res.read_body() yield 'part' end
def @res.content_length() 4 end
io = @agent.response_read @res, @req, @uri
body = io.read
assert_equal 'part', body
assert_equal Encoding::BINARY, body.encoding if body.respond_to? :encoding
end
def test_response_read_content_length_head
req = Net::HTTP::Head.new '/'
def @res.content_length() end
def @res.read_body() end
io = @agent.response_read @res, req, @uri
assert_equal '', io.read
end
def test_response_read_content_length_mismatch
def @res.content_length() 5 end
def @res.read_body() yield 'part' end
e = assert_raises EOFError do
@agent.response_read @res, @req, @uri
end
assert_equal 'Content-Length (5) does not match response body length (4)',
e.message
end
def test_response_read_content_length_redirect
res = Net::HTTPFound.allocate
def res.content_length() 5 end
def res.code() 302 end
def res.read_body() yield 'part' end
res.instance_variable_set :@header, {}
io = @agent.response_read res, @req, @uri
assert_equal 'part', io.read
end
def test_response_read_error
def @res.read_body()
yield 'part'
raise Net::HTTP::Persistent::Error
end
e = assert_raises Mechanize::ResponseReadError do
@agent.response_read @res, @req, @uri
end
assert_equal @res, e.response
assert_equal 'part', e.body_io.read
assert_kind_of Net::HTTP::Persistent::Error, e.error
end
def test_response_read_file
Tempfile.open 'pi.txt' do |tempfile|
tempfile.write "π\n"
tempfile.flush
tempfile.rewind
uri = URI.parse "file://#{tempfile.path}"
req = Mechanize::FileRequest.new uri
res = Mechanize::FileResponse.new tempfile.path
io = @agent.response_read res, req, uri
expected = "π\n"
expected.force_encoding Encoding::BINARY if expected.respond_to? :encoding
body = io.read
assert_equal expected, body
assert_equal Encoding::BINARY, body.encoding if body.respond_to? :encoding
end
end
def test_response_read_large
@agent.max_file_buffer = 10240
def @res.read_body() yield 'a' * 10241 end
def @res.content_length() 10241 end
io = @agent.response_read @res, @req, @uri
assert_kind_of Tempfile, io
assert_equal 10241, io.stat.size
end
def test_response_read_large_chunked
@agent.max_file_buffer = 10240
def @res.read_body
11.times do yield 'a' * 1024 end
end
def @res.content_length() end
io = @agent.response_read @res, @req, @uri
assert_kind_of Tempfile, io
assert_equal 11264, io.stat.size
end
def test_response_read_no_body
req = Net::HTTP::Options.new '/'
def @res.content_length() end
def @res.read_body() end
io = @agent.response_read @res, req, @uri
assert_equal '', io.read
end
def test_response_read_unknown_code
res = Net::HTTPUnknownResponse.allocate
res.instance_variable_set :@code, 9999
res.instance_variable_set :@header, {}
def res.read_body() yield 'part' end
e = assert_raises Mechanize::ResponseCodeError do
@agent.response_read res, @req, @uri
end
assert_equal res, e.page
end
def test_response_redirect
@agent.redirect_ok = true
referer = page 'http://example/referer'
page = fake_page
page = @agent.response_redirect({ 'Location' => '/index.html' }, :get,
page, 0, referer)
assert_equal URI('http://fake.example/index.html'), page.uri
assert_equal 'http://example/referer', requests.first['Referer']
end
def test_response_redirect_malformed
@agent.redirect_ok = true
referer = page 'http://example/referer'
page = fake_page
page = @agent.response_redirect({ 'Location' => '/index.html?q=あ' }, :get,
page, 0, referer)
assert_equal URI('http://fake.example/index.html?q=%E3%81%82'), page.uri
assert_equal 'http://example/referer', requests.first['Referer']
end
def test_response_redirect_limit
@agent.redirect_ok = true
referer = page 'http://example/referer'
assert_raises Mechanize::RedirectLimitReachedError do
@agent.response_redirect({ 'Location' => '/index.html' }, :get,
fake_page, @agent.redirection_limit, referer)
end
end
def test_response_redirect_not_ok
@agent.redirect_ok = false
page = fake_page
page = @agent.response_redirect({ 'Location' => '/other' }, :get, page, 0,
page)
assert_equal URI('http://fake.example'), page.uri
end
def test_response_redirect_permanent
@agent.redirect_ok = :permanent
response = Net::HTTPMovedPermanently.allocate
response.instance_variable_set :@header, { 'location' => %w[/index.html] }
page = fake_page
page = @agent.response_redirect response, :get, page, 0, page
assert_equal URI('http://fake.example/index.html'), page.uri
end
def test_response_redirect_permanent_temporary
@agent.redirect_ok = :permanent
response = Net::HTTPMovedTemporarily.allocate
response.instance_variable_set :@header, { 'location' => %w[/index.html] }
page = fake_page
page = @agent.response_redirect response, :get, page, 0, page
assert_equal URI('http://fake.example/'), page.uri
end
def test_retry_change_request_equals
refute @agent.http.retry_change_requests
@agent.retry_change_requests = true
assert @agent.http.retry_change_requests
end
def test_robots_allowed_eh
allowed = URI 'http://localhost/index.html'
disallowed = URI 'http://localhost/norobots.html'
assert @agent.robots_allowed? allowed
refute @agent.robots_allowed? disallowed
refute @agent.robots_disallowed? allowed
assert @agent.robots_disallowed? disallowed
end
def test_robots_allowed_eh_noindex
@agent.robots = true
noindex = URI 'http://localhost/noindex.html'
assert @agent.robots_allowed? noindex
assert_raises Mechanize::RobotsDisallowedError do
@agent.fetch noindex
end
end
def test_set_proxy
@agent.set_proxy 'www.example.com', 9001, 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 9001
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_port_string
@agent.set_proxy 'www.example.com', '9001', 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 9001
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_service_name
@agent.set_proxy 'www.example.com', 'http', 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 80
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_service_name_bad
e = assert_raises ArgumentError do
@agent.set_proxy 'www.example.com', 'nonexistent service', 'joe', 'lol'
end
assert_equal 'invalid value for port: "nonexistent service"', e.message
end
def test_ssl
in_tmpdir do
store = OpenSSL::X509::Store.new
@agent.ca_file = '.'
@agent.cert_store = store
@agent.certificate = ssl_certificate
@agent.private_key = ssl_private_key
@agent.ssl_version = 'SSLv3' if RUBY_VERSION > '1.9'
@agent.verify_callback = proc { |ok, context| }
http = @agent.http
assert_equal '.', http.ca_file
assert_equal store, http.cert_store
assert_equal ssl_certificate, http.certificate
assert_equal ssl_private_key, http.private_key
assert_equal 'SSLv3', http.ssl_version if
RUBY_VERSION > '1.9'
assert_equal OpenSSL::SSL::VERIFY_PEER, http.verify_mode
assert http.verify_callback
end
end
def test_use_tempfile_eh
refute @agent.use_tempfile? nil
@agent.max_file_buffer = 1
refute @agent.use_tempfile? 0
assert @agent.use_tempfile? 1
@agent.max_file_buffer = nil
refute @agent.use_tempfile? 1
end
def test_verify_none_equals
@agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
http = @agent.http
assert_equal OpenSSL::SSL::VERIFY_NONE, http.verify_mode
end
end
Add tests for FileResponse#[] which currently has a bug.
# coding: utf-8
require 'mechanize/test_case'
class TestMechanizeHttpAgent < Mechanize::TestCase
def setup
super
@agent = @mech.agent
@uri = URI.parse 'http://example/'
@req = Net::HTTP::Get.new '/'
@res = Net::HTTPOK.allocate
@res.instance_variable_set :@code, 200
@res.instance_variable_set :@header, {}
@headers = if RUBY_VERSION > '1.9' then
%w[accept user-agent]
else
%w[accept]
end
end
def auth_realm uri, scheme, type
base_uri = uri + '/'
realm = Mechanize::HTTP::AuthRealm.new scheme, base_uri, 'r'
@agent.authenticate_methods[base_uri][type] << realm
realm
end
def test_auto_io
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1024, input_io
assert_equal '12345', out_io.string
assert_equal Encoding::BINARY, out_io.string.encoding if
Object.const_defined? :Encoding
end
end
def test_auto_io_chunk
Tempfile.open 'input' do |input_io|
chunks = []
input_io.binmode
input_io.write '12345'
input_io.rewind
@agent.auto_io __name__, 1, input_io do |chunk|
chunks << chunk
end
assert_equal %w[1 2 3 4 5], chunks
end
end
def test_auto_io_tempfile
@agent.max_file_buffer = 3
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1, input_io
result = out_io.read
assert_equal '12345', result
assert_equal Encoding::BINARY, result.encoding if
Object.const_defined? :Encoding
end
end
def test_auto_io_yield
Tempfile.open 'input' do |input_io|
input_io.binmode
input_io.write '12345'
input_io.rewind
out_io = @agent.auto_io __name__, 1024, input_io do |chunk|
"x#{chunk}"
end
assert_equal 'x12345', out_io.string
end
end
def test_certificate_equals
cert_path = File.expand_path '../data/server.crt', __FILE__
cert = OpenSSL::X509::Certificate.new File.read cert_path
@agent.certificate = cert
assert_equal cert.to_pem, @agent.certificate.to_pem
end
def test_certificate_equals_file
cert_path = File.expand_path '../data/server.crt', __FILE__
cert = OpenSSL::X509::Certificate.new File.read cert_path
@agent.certificate = cert_path
assert_equal cert.to_pem, @agent.certificate.to_pem
end
def test_connection_for_file
uri = URI.parse 'file:///nonexistent'
conn = @agent.connection_for uri
assert_equal Mechanize::FileConnection.new, conn
end
def test_connection_for_http
conn = @agent.connection_for @uri
assert_equal @agent.http, conn
end
def test_disable_keep_alive
@agent.disable_keep_alive @req
refute @req['connection']
end
def test_disable_keep_alive_no
@agent.keep_alive = false
@agent.disable_keep_alive @req
assert_equal 'close', @req['connection']
end
def test_enable_gzip
@agent.enable_gzip @req
assert_equal 'gzip,deflate,identity', @req['accept-encoding']
end
def test_enable_gzip_no
@agent.gzip_enabled = false
@agent.enable_gzip @req
assert_equal 'identity', @req['accept-encoding']
end
def test_fetch_file_nonexistent
in_tmpdir do
nonexistent = File.join Dir.pwd, 'nonexistent'
uri = URI.parse "file://#{nonexistent}"
e = assert_raises Mechanize::ResponseCodeError do
@agent.fetch uri
end
assert_equal '404 => Net::HTTPNotFound', e.message
end
end
def test_fetch_file_plus
Tempfile.open '++plus++' do |io|
content = 'plusses +++'
io.write content
io.rewind
uri = URI.parse "file://#{Mechanize::Util.uri_escape io.path}"
page = @agent.fetch uri
assert_equal content, page.body
assert_kind_of Mechanize::File, page
end
end
def test_fetch_file_space
foo = File.expand_path("../htdocs/dir with spaces/foo.html", __FILE__)
uri = URI.parse "file://#{Mechanize::Util.uri_escape foo}"
page = @agent.fetch uri
assert_equal File.read(foo), page.body
assert_kind_of Mechanize::Page, page
end
def test_fetch_head_gzip
uri = @uri + '/gzip?file=index.html'
page = @agent.fetch uri, :head
assert_kind_of Mechanize::Page, page
end
def test_fetch_hooks
@agent.pre_connect_hooks << proc do |agent, request|
assert_equal '/index.html', request.path
assert_equal @agent, agent
end
@agent.post_connect_hooks << proc do |agent, uri, response, body|
assert_equal @agent, agent
assert_equal URI('http://example/index.html'), uri
assert_equal '200', response.code
assert_kind_of String, body
end
@agent.fetch URI 'http://example/index.html'
end
def test_fetch_post_connect_hook
response = nil
@agent.post_connect_hooks << lambda { |_, _, res, _| response = res }
@agent.fetch 'http://localhost/'
assert response
end
def test_fetch_server_error
e = assert_raises Mechanize::ResponseCodeError do
@mech.get 'http://localhost/response_code?code=500'
end
assert_equal '500', e.response_code
end
def test_get_meta_refresh_header_follow_self
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_equal [0.0, URI('http://example/')], refresh
end
def test_get_meta_refresh_header_no_follow
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_header_no_follow_self
@agent.follow_meta_refresh = true
page = Mechanize::Page.new(@uri, nil, '', 200, @mech)
@res.instance_variable_set :@header, 'refresh' => ['0']
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_meta_follow_self
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_equal [0, nil], refresh
end
def test_get_meta_refresh_meta_no_follow
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_meta_refresh_meta_no_follow_self
@agent.follow_meta_refresh = true
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(@uri, nil, body, 200, @mech)
refresh = @agent.get_meta_refresh @res, @uri, page
assert_nil refresh
end
def test_get_robots
robotstxt = @agent.get_robots 'http://localhost/robots.txt'
refute_equal '', robotstxt
robotstxt = @agent.get_robots 'http://localhost/response_code?code=404'
assert_equal '', robotstxt
end
def test_hook_content_encoding_response
@mech.content_encoding_hooks << lambda{|agent, uri, response, response_body_io|
response['content-encoding'] = 'gzip' if response['content-encoding'] == 'agzip'}
@res.instance_variable_set :@header, 'content-encoding' => %w[agzip]
body_io = StringIO.new 'part'
@agent.hook_content_encoding @res, @uri, body_io
assert_equal 'gzip', @res['content-encoding']
end
def test_http_request_file
uri = URI.parse 'file:///nonexistent'
request = @agent.http_request uri, :get
assert_kind_of Mechanize::FileRequest, request
assert_equal '/nonexistent', request.path
end
def test_http_request_get
request = @agent.http_request @uri, :get
assert_kind_of Net::HTTP::Get, request
assert_equal '/', request.path
end
def test_http_request_post
request = @agent.http_request @uri, :post
assert_kind_of Net::HTTP::Post, request
assert_equal '/', request.path
end
def test_idle_timeout_equals
@agent.idle_timeout = 1
assert_equal 1, @agent.http.idle_timeout
end
def test_inflate
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
result = @agent.inflate body_io
assert_equal 'part', result.read
end
def test_post_connect
@agent.post_connect_hooks << proc { |agent, uri, response, body|
assert_equal @agent, agent
assert_equal @res, response
assert_equal 'body', body
throw :called
}
io = StringIO.new 'body'
assert_throws :called do
@agent.post_connect @uri, @res, io
end
assert_equal 0, io.pos
end
def test_pre_connect
@agent.pre_connect_hooks << proc { |agent, request|
assert_equal @agent, agent
assert_equal @req, request
throw :called
}
assert_throws :called do
@agent.pre_connect @req
end
end
def test_request_add_headers
@agent.request_add_headers @req, 'Content-Length' => 300
assert_equal '300', @req['content-length']
end
def test_request_add_headers_etag
@agent.request_add_headers @req, :etag => '300'
assert_equal '300', @req['etag']
end
def test_request_add_headers_if_modified_since
@agent.request_add_headers @req, :if_modified_since => 'some_date'
assert_equal 'some_date', @req['if-modified-since']
end
def test_request_add_headers_none
@agent.request_add_headers @req
assert_equal @headers, @req.to_hash.keys.sort
end
def test_request_add_headers_request_headers
@agent.request_headers['X-Foo'] = 'bar'
@agent.request_add_headers @req
assert_equal @headers + %w[x-foo], @req.to_hash.keys.sort
end
def test_request_add_headers_symbol
e = assert_raises ArgumentError do
@agent.request_add_headers @req, :content_length => 300
end
assert_equal 'unknown header symbol content_length', e.message
end
def test_request_auth_basic
@agent.user = 'user'
@agent.password = 'password'
auth_realm @uri, 'Basic', :basic
@agent.request_auth @req, @uri
assert_match %r%^Basic %, @req['Authorization']
end
def test_request_auth_digest
@agent.user = 'user'
@agent.password = 'password'
realm = auth_realm @uri, 'Digest', :digest
@agent.digest_challenges[realm] = 'Digest realm=r, qop="auth"'
@agent.request_auth @req, @uri
assert_match %r%^Digest %, @req['Authorization']
assert_match %r%qop=auth%, @req['Authorization']
end
def test_request_auth_iis_digest
@agent.user = 'user'
@agent.password = 'password'
realm = auth_realm @uri, 'Digest', :digest
@agent.digest_challenges[realm] = 'Digest realm=r, qop="auth"'
@agent.request_auth @req, @uri
assert_match %r%^Digest %, @req['Authorization']
assert_match %r%qop=auth%, @req['Authorization']
end
def test_request_auth_none
@agent.request_auth @req, @uri
assert_nil @req['Authorization']
end
def test_request_cookies
uri = URI.parse 'http://host.example.com'
Mechanize::Cookie.parse uri, 'hello=world domain=.example.com' do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, uri
assert_equal 'hello=world domain=.example.com', @req['Cookie']
end
def test_request_cookies_many
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com, c=d domain=.example.com'
Mechanize::Cookie.parse uri, cookie_str do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, uri
expected = cookie_str.sub ', ', '; '
assert_equal expected, @req['Cookie']
end
def test_request_cookies_none
@agent.request_cookies @req, @uri
assert_nil @req['Cookie']
end
def test_request_cookies_wrong_domain
uri = URI.parse 'http://host.example.com'
Mechanize::Cookie.parse uri, 'hello=world domain=.example.com' do |cookie|
@agent.cookie_jar.add uri, cookie
end
@agent.request_cookies @req, @uri
assert_nil @req['Cookie']
end
def test_request_host
@agent.request_host @req, @uri
assert_equal 'example', @req['host']
end
def test_request_host_nonstandard
@uri.port = 81
@agent.request_host @req, @uri
assert_equal 'example:81', @req['host']
end
def test_request_language_charset
@agent.request_language_charset @req
assert_equal 'en-us,en;q=0.5', @req['accept-language']
assert_equal 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', @req['accept-charset']
end
def test_request_referer
referer = URI.parse 'http://old.example'
@agent.request_referer @req, @uri, referer
assert_equal 'http://old.example', @req['referer']
end
def test_request_referer_https
uri = URI.parse 'https://example'
referer = URI.parse 'https://old.example'
@agent.request_referer @req, uri, referer
assert_equal 'https://old.example', @req['referer']
end
def test_request_referer_https_downgrade
referer = URI.parse 'https://old.example'
@agent.request_referer @req, @uri, referer
assert_nil @req['referer']
end
def test_request_referer_https_downgrade_case
uri = URI.parse 'http://example'
referer = URI.parse 'httpS://old.example'
@agent.request_referer @req, uri, referer
assert_nil @req['referer']
end
def test_request_referer_https_upgrade
uri = URI.parse 'https://example'
referer = URI.parse 'http://old.example'
@agent.request_referer @req, uri, referer
assert_equal 'http://old.example', @req['referer']
end
def test_request_referer_none
@agent.request_referer @req, @uri, nil
assert_nil @req['referer']
end
def test_request_referer_strip
uri = URI.parse 'http://example.com/index.html'
host_path = "old.example/page.html?q=x"
referer = "http://#{host_path}"
[
"",
"@",
"user1@",
":@",
"user1:@",
":password1@",
"user1:password1@",
].each { |userinfo|
['', '#frag'].each { |frag|
url = URI.parse "http://#{userinfo}#{host_path}#{frag}"
@agent.request_referer @req, uri, url
assert_equal referer, @req['referer'], url
}
}
end
def test_request_user_agent
@agent.request_user_agent @req
assert_match %r%^Mechanize/#{Mechanize::VERSION}%, @req['user-agent']
ruby_version = if RUBY_PATCHLEVEL >= 0 then
"#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
else
"#{RUBY_VERSION}dev#{RUBY_REVISION}"
end
assert_match %r%Ruby/#{ruby_version}%, @req['user-agent']
end
def test_resolve_bad_uri
e = assert_raises ArgumentError do
@agent.resolve 'google'
end
assert_equal 'absolute URL needed (not google)', e.message
end
def test_resolve_utf8
uri = 'http://example?q=ü'
resolved = @agent.resolve uri
assert_equal '/?q=%C3%BC', resolved.request_uri
end
def test_resolve_parameters_body
input_params = { :q => 'hello' }
uri, params = @agent.resolve_parameters @uri, :post, input_params
assert_equal 'http://example/', uri.to_s
assert_equal input_params, params
end
def test_resolve_parameters_query
uri, params = @agent.resolve_parameters @uri, :get, :q => 'hello'
assert_equal 'http://example/?q=hello', uri.to_s
assert_nil params
end
def test_resolve_parameters_query_append
input_params = { :q => 'hello' }
@uri.query = 'a=b'
uri, params = @agent.resolve_parameters @uri, :get, input_params
assert_equal 'http://example/?a=b&q=hello', uri.to_s
assert_nil params
end
def test_response_authenticate
@res.instance_variable_set :@header, 'www-authenticate' => ['Basic realm=r']
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Basic', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:basic]
end
def test_response_authenticate_digest
@res.instance_variable_set(:@header,
'www-authenticate' => ['Digest realm=r'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:digest]
challenge = Mechanize::HTTP::AuthChallenge.new 'Digest', 'realm' => 'r'
assert_equal challenge, @agent.digest_challenges[realm]
end
def test_response_authenticate_digest_iis
@res.instance_variable_set(:@header,
'www-authenticate' => ['Digest realm=r'],
'server' => ['Microsoft-IIS'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:iis_digest]
end
def test_response_authenticate_multiple
@res.instance_variable_set(:@header,
'www-authenticate' =>
['Basic realm=r, Digest realm=r'])
@agent.user = 'user'
@agent.password = 'password'
@agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
base_uri = @uri + '/'
realm = Mechanize::HTTP::AuthRealm.new 'Digest', base_uri, 'r'
assert_equal [realm], @agent.authenticate_methods[base_uri][:digest]
assert_empty @agent.authenticate_methods[base_uri][:basic]
end
def test_response_authenticate_no_www_authenticate
denied = page URI('http://example/denied'), 'text/html', '', 403
@agent.user = 'user'
@agent.password = 'password'
e = assert_raises Mechanize::UnauthorizedError do
@agent.response_authenticate @res, denied, @uri, @req, {}, nil, nil
end
assert_equal '403 => Net::HTTPForbidden', e.message
end
def test_response_authenticate_ntlm
@uri += '/ntlm'
@res.instance_variable_set(:@header,
'www-authenticate' => ['Negotiate, NTLM'])
@agent.user = 'user'
@agent.password = 'password'
@agent.domain = 'domain'
page = @agent.response_authenticate @res, nil, @uri, @req, {}, nil, nil
assert_equal 'ok', page.body # lame test
end
def test_response_authenticate_unknown
@agent.user = 'user'
@agent.password = 'password'
page = Mechanize::File.new nil, nil, nil, 401
@res.instance_variable_set(:@header,
'www-authenticate' => ['Unknown realm=r'])
assert_raises Mechanize::UnauthorizedError do
@agent.response_authenticate @res, page, @uri, @req, nil, nil, nil
end
end
def test_response_content_encoding_7_bit
@res.instance_variable_set :@header, 'content-encoding' => %w[7bit]
body = @agent.response_content_encoding @res, StringIO.new('part')
assert_equal 'part', body.read
end
def test_response_content_encoding_deflate
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
end
def test_response_content_encoding_deflate_chunked
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01\xB8"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_content_encoding_deflate_corrupt
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body_io = StringIO.new "x\x9C+H,*\x01\x00\x04?\x01" # missing 1 byte
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding deflate:%, e.message
assert_match %r%Zlib%, e.message
assert body_io.closed?
end
def test_response_content_encoding_deflate_empty
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, StringIO.new
assert_equal '', body.read
end
# IIS/6.0 ASP.NET/2.0.50727 does not wrap deflate with zlib, WTF?
def test_response_content_encoding_deflate_no_zlib
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, StringIO.new("+H,*\001\000")
assert_equal 'part', body.read
end
def test_response_content_encoding_gzip
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
end
def test_response_content_encoding_gzip_chunked
def @res.content_length() nil end
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_content_encoding_gzip_corrupt
log = StringIO.new
logger = Logger.new log
@agent.context.log = logger
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001"
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding gzip:%, e.message
assert_match %r%Zlib%, e.message
assert_match %r%unable to gunzip response, trying raw inflate%, log.string
assert_match %r%unable to gunzip response:%, log.string
assert body_io.closed?
end
def test_response_content_encoding_gzip_corrupt_checksum
log = StringIO.new
logger = Logger.new log
@agent.context.log = logger
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000"
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body_io
end
assert_match %r%error handling content-encoding gzip:%, e.message
assert_match %r%Zlib%, e.message
assert_match %r%unable to gunzip response, trying raw inflate%, log.string
end
def test_response_content_encoding_gzip_empty
@res.instance_variable_set :@header, 'content-encoding' => %w[gzip]
body = @agent.response_content_encoding @res, StringIO.new
assert_equal '', body.read
end
def test_response_content_encoding_gzip_encoding_bad
@res.instance_variable_set(:@header,
'content-encoding' => %w[gzip],
'content-type' => 'text/html; charset=UTF-8')
# "test\xB2"
body_io = StringIO.new \
"\037\213\b\000*+\314N\000\003+I-.\331\004\000x\016\003\376\005\000\000\000"
body = @agent.response_content_encoding @res, body_io
expected = "test\xB2"
expected.force_encoding Encoding::BINARY if have_encoding?
content = body.read
assert_equal expected, content
assert_equal Encoding::BINARY, content.encoding if have_encoding?
end
def test_response_content_encoding_none
@res.instance_variable_set :@header, 'content-encoding' => %w[none]
body = @agent.response_content_encoding @res, StringIO.new('part')
assert_equal 'part', body.read
end
def test_response_content_encoding_tempfile_7_bit
body_io = tempfile 'part'
@res.instance_variable_set :@header, 'content-encoding' => %w[7bit]
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
refute body_io.closed?
ensure
begin
body_io.close! unless body_io.closed?
rescue IOError
# HACK for ruby 1.8
end
end
def test_response_content_encoding_tempfile_gzip
body_io = tempfile "x\x9C+H,*\x01\x00\x04?\x01\xB8"
@res.instance_variable_set :@header, 'content-encoding' => %w[deflate]
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
assert body_io.closed?
ensure
body_io.close! unless body_io.closed?
end
def test_response_content_encoding_unknown
@res.instance_variable_set :@header, 'content-encoding' => %w[unknown]
body = StringIO.new 'part'
e = assert_raises Mechanize::Error do
@agent.response_content_encoding @res, body
end
assert_equal 'unsupported content-encoding: unknown', e.message
end
def test_response_content_encoding_x_gzip
@res.instance_variable_set :@header, 'content-encoding' => %w[x-gzip]
body_io = StringIO.new \
"\037\213\b\0002\002\225M\000\003+H,*\001\000\306p\017I\004\000\000\000"
body = @agent.response_content_encoding @res, body_io
assert_equal 'part', body.read
end
def test_response_cookies
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com'
@res.instance_variable_set(:@header,
'set-cookie' => [cookie_str],
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, '', 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_cookies_many
uri = URI.parse 'http://host.example.com'
cookie1 = 'a=b domain=.example.com'
cookie2 = 'c=d domain=.example.com'
@res.instance_variable_set(:@header,
'set-cookie' => [cookie1, cookie2],
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, '', 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com', 'c=d domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_cookies_meta
uri = URI.parse 'http://host.example.com'
cookie_str = 'a=b domain=.example.com'
body = <<-BODY
<head>
<meta http-equiv="Set-Cookie" content="#{cookie_str}">
</head>"
BODY
@res.instance_variable_set(:@header,
'content-type' => %w[text/html])
page = Mechanize::Page.new uri, @res, body, 200, @mech
@agent.response_cookies @res, uri, page
assert_equal ['a=b domain=.example.com'],
@agent.cookie_jar.cookies(uri).map { |c| c.to_s }
end
def test_response_follow_meta_refresh
uri = URI.parse 'http://example/#id+1'
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(uri, nil, body, 200, @mech)
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
page = @agent.response_follow_meta_refresh @res, uri, page, 0
assert_equal uri, page.uri
end
def test_response_follow_meta_refresh_limit
uri = URI.parse 'http://example/#id+1'
body = <<-BODY
<title></title>
<meta http-equiv="refresh" content="0">
BODY
page = Mechanize::Page.new(uri, nil, body, 200, @mech)
@agent.follow_meta_refresh = true
@agent.follow_meta_refresh_self = true
assert_raises Mechanize::RedirectLimitReachedError do
@agent.response_follow_meta_refresh(@res, uri, page,
@agent.redirection_limit)
end
end
def test_response_parse
body = '<title>hi</title>'
@res.instance_variable_set :@header, 'content-type' => %w[text/html]
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
end
def test_response_parse_content_type_case
body = '<title>hi</title>'
@res.instance_variable_set(:@header, 'content-type' => %w[text/HTML])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'text/HTML', page.content_type
end
def test_response_parse_content_type_encoding
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html;charset=ISO-8859-1])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
assert_equal 'ISO-8859-1', page.encoding
assert_equal 'ISO-8859-1', page.parser.encoding
end
def test_response_parse_content_type_encoding_broken_iso_8859_1
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=ISO_8859-1])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'ISO_8859-1', page.encoding
end
def test_response_parse_content_type_encoding_broken_utf_8
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=UTF8])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'UTF8', page.encoding
assert_equal 'UTF8', page.parser.encoding
end
def test_response_parse_content_type_encoding_garbage
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html; charset=garbage_charset])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal @mech, page.mech
end
def test_response_parse_content_type_encoding_semicolon
body = '<title>hi</title>'
@res.instance_variable_set(:@header,
'content-type' =>
%w[text/html;charset=UTF-8;])
page = @agent.response_parse @res, body, @uri
assert_instance_of Mechanize::Page, page
assert_equal 'UTF-8', page.encoding
end
def test_response_read
def @res.read_body() yield 'part' end
def @res.content_length() 4 end
io = @agent.response_read @res, @req, @uri
body = io.read
assert_equal 'part', body
assert_equal Encoding::BINARY, body.encoding if body.respond_to? :encoding
end
def test_response_read_content_length_head
req = Net::HTTP::Head.new '/'
def @res.content_length() end
def @res.read_body() end
io = @agent.response_read @res, req, @uri
assert_equal '', io.read
end
def test_response_read_content_length_mismatch
def @res.content_length() 5 end
def @res.read_body() yield 'part' end
e = assert_raises EOFError do
@agent.response_read @res, @req, @uri
end
assert_equal 'Content-Length (5) does not match response body length (4)',
e.message
end
def test_response_read_content_length_redirect
res = Net::HTTPFound.allocate
def res.content_length() 5 end
def res.code() 302 end
def res.read_body() yield 'part' end
res.instance_variable_set :@header, {}
io = @agent.response_read res, @req, @uri
assert_equal 'part', io.read
end
def test_response_read_error
def @res.read_body()
yield 'part'
raise Net::HTTP::Persistent::Error
end
e = assert_raises Mechanize::ResponseReadError do
@agent.response_read @res, @req, @uri
end
assert_equal @res, e.response
assert_equal 'part', e.body_io.read
assert_kind_of Net::HTTP::Persistent::Error, e.error
end
def test_response_read_file
Tempfile.open 'pi.txt' do |tempfile|
tempfile.write "π\n"
tempfile.flush
tempfile.rewind
uri = URI.parse "file://#{tempfile.path}"
req = Mechanize::FileRequest.new uri
res = Mechanize::FileResponse.new tempfile.path
io = @agent.response_read res, req, uri
expected = "π\n"
expected.force_encoding Encoding::BINARY if expected.respond_to? :encoding
body = io.read
assert_equal expected, body
assert_equal Encoding::BINARY, body.encoding if body.respond_to? :encoding
end
end
def test_file_response_content_type
Tempfile.open ['pi','.nothtml'] do |tempfile|
res = Mechanize::FileResponse.new tempfile.path
assert_equal nil, res['content-type']
end
Tempfile.open ['pi','.xhtml'] do |tempfile|
res = Mechanize::FileResponse.new tempfile.path
assert_equal 'text/html', res['content-type']
end
Tempfile.open ['pi','.html'] do |tempfile|
res = Mechanize::FileResponse.new tempfile.path
assert_equal 'text/html', res['Content-Type']
end
end
def test_response_read_large
@agent.max_file_buffer = 10240
def @res.read_body() yield 'a' * 10241 end
def @res.content_length() 10241 end
io = @agent.response_read @res, @req, @uri
assert_kind_of Tempfile, io
assert_equal 10241, io.stat.size
end
def test_response_read_large_chunked
@agent.max_file_buffer = 10240
def @res.read_body
11.times do yield 'a' * 1024 end
end
def @res.content_length() end
io = @agent.response_read @res, @req, @uri
assert_kind_of Tempfile, io
assert_equal 11264, io.stat.size
end
def test_response_read_no_body
req = Net::HTTP::Options.new '/'
def @res.content_length() end
def @res.read_body() end
io = @agent.response_read @res, req, @uri
assert_equal '', io.read
end
def test_response_read_unknown_code
res = Net::HTTPUnknownResponse.allocate
res.instance_variable_set :@code, 9999
res.instance_variable_set :@header, {}
def res.read_body() yield 'part' end
e = assert_raises Mechanize::ResponseCodeError do
@agent.response_read res, @req, @uri
end
assert_equal res, e.page
end
def test_response_redirect
@agent.redirect_ok = true
referer = page 'http://example/referer'
page = fake_page
page = @agent.response_redirect({ 'Location' => '/index.html' }, :get,
page, 0, referer)
assert_equal URI('http://fake.example/index.html'), page.uri
assert_equal 'http://example/referer', requests.first['Referer']
end
def test_response_redirect_malformed
@agent.redirect_ok = true
referer = page 'http://example/referer'
page = fake_page
page = @agent.response_redirect({ 'Location' => '/index.html?q=あ' }, :get,
page, 0, referer)
assert_equal URI('http://fake.example/index.html?q=%E3%81%82'), page.uri
assert_equal 'http://example/referer', requests.first['Referer']
end
def test_response_redirect_limit
@agent.redirect_ok = true
referer = page 'http://example/referer'
assert_raises Mechanize::RedirectLimitReachedError do
@agent.response_redirect({ 'Location' => '/index.html' }, :get,
fake_page, @agent.redirection_limit, referer)
end
end
def test_response_redirect_not_ok
@agent.redirect_ok = false
page = fake_page
page = @agent.response_redirect({ 'Location' => '/other' }, :get, page, 0,
page)
assert_equal URI('http://fake.example'), page.uri
end
def test_response_redirect_permanent
@agent.redirect_ok = :permanent
response = Net::HTTPMovedPermanently.allocate
response.instance_variable_set :@header, { 'location' => %w[/index.html] }
page = fake_page
page = @agent.response_redirect response, :get, page, 0, page
assert_equal URI('http://fake.example/index.html'), page.uri
end
def test_response_redirect_permanent_temporary
@agent.redirect_ok = :permanent
response = Net::HTTPMovedTemporarily.allocate
response.instance_variable_set :@header, { 'location' => %w[/index.html] }
page = fake_page
page = @agent.response_redirect response, :get, page, 0, page
assert_equal URI('http://fake.example/'), page.uri
end
def test_retry_change_request_equals
refute @agent.http.retry_change_requests
@agent.retry_change_requests = true
assert @agent.http.retry_change_requests
end
def test_robots_allowed_eh
allowed = URI 'http://localhost/index.html'
disallowed = URI 'http://localhost/norobots.html'
assert @agent.robots_allowed? allowed
refute @agent.robots_allowed? disallowed
refute @agent.robots_disallowed? allowed
assert @agent.robots_disallowed? disallowed
end
def test_robots_allowed_eh_noindex
@agent.robots = true
noindex = URI 'http://localhost/noindex.html'
assert @agent.robots_allowed? noindex
assert_raises Mechanize::RobotsDisallowedError do
@agent.fetch noindex
end
end
def test_set_proxy
@agent.set_proxy 'www.example.com', 9001, 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 9001
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_port_string
@agent.set_proxy 'www.example.com', '9001', 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 9001
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_service_name
@agent.set_proxy 'www.example.com', 'http', 'joe', 'lol'
assert_equal @agent.proxy_uri.host, 'www.example.com'
assert_equal @agent.proxy_uri.port, 80
assert_equal @agent.proxy_uri.user, 'joe'
assert_equal @agent.proxy_uri.password, 'lol'
end
def test_set_proxy_service_name_bad
e = assert_raises ArgumentError do
@agent.set_proxy 'www.example.com', 'nonexistent service', 'joe', 'lol'
end
assert_equal 'invalid value for port: "nonexistent service"', e.message
end
def test_ssl
in_tmpdir do
store = OpenSSL::X509::Store.new
@agent.ca_file = '.'
@agent.cert_store = store
@agent.certificate = ssl_certificate
@agent.private_key = ssl_private_key
@agent.ssl_version = 'SSLv3' if RUBY_VERSION > '1.9'
@agent.verify_callback = proc { |ok, context| }
http = @agent.http
assert_equal '.', http.ca_file
assert_equal store, http.cert_store
assert_equal ssl_certificate, http.certificate
assert_equal ssl_private_key, http.private_key
assert_equal 'SSLv3', http.ssl_version if
RUBY_VERSION > '1.9'
assert_equal OpenSSL::SSL::VERIFY_PEER, http.verify_mode
assert http.verify_callback
end
end
def test_use_tempfile_eh
refute @agent.use_tempfile? nil
@agent.max_file_buffer = 1
refute @agent.use_tempfile? 0
assert @agent.use_tempfile? 1
@agent.max_file_buffer = nil
refute @agent.use_tempfile? 1
end
def test_verify_none_equals
@agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
http = @agent.http
assert_equal OpenSSL::SSL::VERIFY_NONE, http.verify_mode
end
end
|
class Rbenv < Formula
desc "Ruby version manager"
homepage "https://github.com/rbenv/rbenv#readme"
url "https://github.com/rbenv/rbenv/archive/v1.1.2.tar.gz"
sha256 "80ad89ffe04c0b481503bd375f05c212bbc7d44ef5f5e649e0acdf25eba86736"
license "MIT"
head "https://github.com/rbenv/rbenv.git"
bottle do
cellar :any
sha256 "60b045c8843745c45d01616ee3f71b91f6a16ee09c47e23a7817a3edabeaccfd" => :big_sur
sha256 "19d0b9e3b11bcacdf692e78248c1b5764f7d3f4b58f2b83ad7b39562863ba82e" => :arm64_big_sur
sha256 "503ed6d818502f00f031b9f49461934e252b9bfba2876e90a326fc27bb1052d6" => :catalina
sha256 "d1019098dee8d037587069398e5ad04e6d736f834dc44ae73943bec46b10b260" => :mojave
sha256 "b5984102794a9d39388ca1f6ec77965aeea29b971cc00cb5af8ede8ee6c926d6" => :high_sierra
sha256 "873175a851e5aa4f5b3438072030b945c252f08a9a07760c64dc045e2cce4724" => :sierra
end
depends_on "ruby-build"
uses_from_macos "ruby" => :test
def install
inreplace "libexec/rbenv" do |s|
s.gsub! '"${BASH_SOURCE%/*}"/../libexec', libexec
s.gsub! ":/usr/local/etc/rbenv.d", ":#{HOMEBREW_PREFIX}/etc/rbenv.d\\0" if HOMEBREW_PREFIX.to_s != "/usr/local"
end
# Compile optional bash extension.
system "src/configure"
system "make", "-C", "src"
if build.head?
# Record exact git revision for `rbenv --version` output
git_revision = `git rev-parse --short HEAD`.chomp
inreplace "libexec/rbenv---version", /^(version=)"([^"]+)"/,
%Q(\\1"\\2-g#{git_revision}")
end
prefix.install ["bin", "completions", "libexec", "rbenv.d"]
end
test do
shell_output("eval \"$(#{bin}/rbenv init -)\" && rbenv versions")
end
end
rbenv: use `Utils#git_short_head` (#68810)
class Rbenv < Formula
desc "Ruby version manager"
homepage "https://github.com/rbenv/rbenv#readme"
url "https://github.com/rbenv/rbenv/archive/v1.1.2.tar.gz"
sha256 "80ad89ffe04c0b481503bd375f05c212bbc7d44ef5f5e649e0acdf25eba86736"
license "MIT"
head "https://github.com/rbenv/rbenv.git"
bottle do
cellar :any
sha256 "60b045c8843745c45d01616ee3f71b91f6a16ee09c47e23a7817a3edabeaccfd" => :big_sur
sha256 "19d0b9e3b11bcacdf692e78248c1b5764f7d3f4b58f2b83ad7b39562863ba82e" => :arm64_big_sur
sha256 "503ed6d818502f00f031b9f49461934e252b9bfba2876e90a326fc27bb1052d6" => :catalina
sha256 "d1019098dee8d037587069398e5ad04e6d736f834dc44ae73943bec46b10b260" => :mojave
sha256 "b5984102794a9d39388ca1f6ec77965aeea29b971cc00cb5af8ede8ee6c926d6" => :high_sierra
sha256 "873175a851e5aa4f5b3438072030b945c252f08a9a07760c64dc045e2cce4724" => :sierra
end
depends_on "ruby-build"
uses_from_macos "ruby" => :test
def install
inreplace "libexec/rbenv" do |s|
s.gsub! '"${BASH_SOURCE%/*}"/../libexec', libexec
s.gsub! ":/usr/local/etc/rbenv.d", ":#{HOMEBREW_PREFIX}/etc/rbenv.d\\0" if HOMEBREW_PREFIX.to_s != "/usr/local"
end
# Compile optional bash extension.
system "src/configure"
system "make", "-C", "src"
if build.head?
# Record exact git revision for `rbenv --version` output
git_revision = Utils.git_short_head(buildpath)
inreplace "libexec/rbenv---version", /^(version=)"([^"]+)"/,
%Q(\\1"\\2-g#{git_revision}")
end
prefix.install ["bin", "completions", "libexec", "rbenv.d"]
end
test do
shell_output("eval \"$(#{bin}/rbenv init -)\" && rbenv versions")
end
end
|
Spree::OptionType.create!([
{
name: 'adult',
presentation: 'Adult',
position: 1
},
{
name: 'child',
presentation: 'Child',
position: 2
},
{
name: 'infant',
presentation: 'Infant',
position: 3
},
{
name: 'pax',
presentation: 'Pax',
position: 4
},
{
name: 'season',
presentation: 'Season',
position: 10
},
{
name: 'meal-plan',
presentation: 'Meal Plan',
position: 20
},
{
name: 'trip',
presentation: 'Trip',
position: 70
},
{
name: 'transmission',
presentation: 'Transmission',
position: 80
},
{
name: 'duration',
presentation: 'Duration',
position: 90
},
{
name: 'taxi-confort',
presentation: 'Confort',
position: 1
},
{
name: 'type-class',
presentation: 'Class',
position: 1
}
]
chance in option_types.rb
Spree::OptionType.create!([
{
name: 'adult',
presentation: 'Adult',
position: 1
},
{
name: 'child',
presentation: 'Child',
position: 2
},
{
name: 'infant',
presentation: 'Infant',
position: 3
},
{
name: 'pax',
presentation: 'Pax',
position: 4
},
{
name: 'season',
presentation: 'Season',
position: 10
},
{
name: 'meal-plan',
presentation: 'Meal Plan',
position: 20
},
{
name: 'trip',
presentation: 'Trip',
position: 70
},
{
name: 'transmission',
presentation: 'Transmission',
position: 80
},
{
name: 'duration',
presentation: 'Duration',
position: 90
},
{
name: 'taxi-confort',
presentation: 'Confort',
position: 1
},
{
name: 'type-class',
presentation: 'Class',
position: 1
}
]
|
class Rdate < Formula
desc "Set the system's date from a remote host"
homepage "https://www.aelius.com/njh/rdate/"
url "https://www.aelius.com/njh/rdate/rdate-1.5.tar.gz"
sha256 "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "68597f7989ddba1ff853f54c0cf3adf36b3567268b69ca43d7b0795d290304b4" => :catalina
sha256 "2d4c93b21caa56d3228d8ff2ff790f4142421ad6316cd74d77c568e84602a996" => :mojave
sha256 "02e41a79e9aca3bad86802e1bc32c7148e8a2ea2f410c57765f9e9d8b2686fd1" => :high_sierra
sha256 "9f4a6300d6d3ebc9034abeb5388fd40face1f286a7b97610b6a40a1dcdf166b5" => :sierra
sha256 "acb2ae5951a0f32cbdce39e02d86c63cdb85b41fd02aff74aac6ea4939d71d8d" => :el_capitan
sha256 "553782017635be9c8d80bbf6fd033f294cddcb427a2d83fe82af8c069c60867f" => :yosemite
sha256 "3a36b6feccd119c90db3373a3de1b67f4aa03fc72aacdf7b11165b538206ae14" => :mavericks
end
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}"
system "make", "install"
end
test do
# note that the server must support RFC 868
system "#{bin}/rdate", "-p", "-t", "10", "time-b-b.nist.gov"
end
end
rdate: add license
class Rdate < Formula
desc "Set the system's date from a remote host"
homepage "https://www.aelius.com/njh/rdate/"
url "https://www.aelius.com/njh/rdate/rdate-1.5.tar.gz"
sha256 "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d"
license "GPL-2.0"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "68597f7989ddba1ff853f54c0cf3adf36b3567268b69ca43d7b0795d290304b4" => :catalina
sha256 "2d4c93b21caa56d3228d8ff2ff790f4142421ad6316cd74d77c568e84602a996" => :mojave
sha256 "02e41a79e9aca3bad86802e1bc32c7148e8a2ea2f410c57765f9e9d8b2686fd1" => :high_sierra
sha256 "9f4a6300d6d3ebc9034abeb5388fd40face1f286a7b97610b6a40a1dcdf166b5" => :sierra
sha256 "acb2ae5951a0f32cbdce39e02d86c63cdb85b41fd02aff74aac6ea4939d71d8d" => :el_capitan
sha256 "553782017635be9c8d80bbf6fd033f294cddcb427a2d83fe82af8c069c60867f" => :yosemite
sha256 "3a36b6feccd119c90db3373a3de1b67f4aa03fc72aacdf7b11165b538206ae14" => :mavericks
end
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}"
system "make", "install"
end
test do
# note that the server must support RFC 868
system "#{bin}/rdate", "-p", "-t", "10", "time-b-b.nist.gov"
end
end
|
require 'formula'
class Redis <Formula
url 'http://redis.googlecode.com/files/redis-1.2.6.tar.gz'
head 'git://github.com/antirez/redis.git'
homepage 'http://code.google.com/p/redis/'
sha1 'c71aef0b3f31acb66353d86ba57dd321b541043f'
def install
fails_with_llvm "Breaks with LLVM"
# Head and stable have different code layouts
src = File.exists?('src/Makefile') ? 'src' : '.'
system "make -C #{src}"
%w( redis-benchmark redis-cli redis-server redis-stat redis-check-dump ).each { |p|
# Some of these commands are only in 1.2.x, some only in head
bin.install "#{src}/#{p}" rescue nil
}
%w( run db/redis log ).each { |p| (var+p).mkpath }
# Fix up default conf file to match our paths
inreplace "redis.conf" do |s|
s.gsub! "/var/run/redis.pid", "#{var}/run/redis.pid"
s.gsub! "dir ./", "dir #{var}/db/redis/"
end
doc.install Dir["doc/*"]
etc.install "redis.conf"
(prefix+'io.redis.redis-server.plist').write startup_plist
end
def caveats
<<-EOS.undent
Automatically load on login with:
launchctl load -w #{prefix}/io.redis.redis-server.plist
To start redis manually:
redis-server #{etc}/redis.conf
To access the server:
redis-cli
EOS
end
def startup_plist
return <<-EOPLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>io.redis.redis-server</string>
<key>ProgramArguments</key>
<array>
<string>#{bin}/redis-server</string>
<string>#{etc}/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/redis.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/redis.log</string>
</dict>
</plist>
EOPLIST
end
end
Update redis to 2.0.0.
Signed-off-by: David Höppner <0xffea@gmail.com>
* sha1
require 'formula'
class Redis <Formula
url 'http://redis.googlecode.com/files/redis-2.0.0.tar.gz'
head 'git://github.com/antirez/redis.git'
homepage 'http://code.google.com/p/redis/'
sha1 '078601a2ee6d900f938709c9b40526646a449453'
def install
fails_with_llvm "Breaks with LLVM"
# Head and stable have different code layouts
src = File.exists?('src/Makefile') ? 'src' : '.'
system "make -C #{src}"
%w( redis-benchmark redis-cli redis-server redis-check-dump ).each { |p|
bin.install "#{src}/#{p}"
}
%w( run db/redis log ).each { |p| (var+p).mkpath }
# Fix up default conf file to match our paths
inreplace "redis.conf" do |s|
s.gsub! "/var/run/redis.pid", "#{var}/run/redis.pid"
s.gsub! "dir ./", "dir #{var}/db/redis/"
end
doc.install Dir["doc/*"]
etc.install "redis.conf"
(prefix+'io.redis.redis-server.plist').write startup_plist
end
def caveats
<<-EOS.undent
Automatically load on login with:
launchctl load -w #{prefix}/io.redis.redis-server.plist
To start redis manually:
redis-server #{etc}/redis.conf
To access the server:
redis-cli
EOS
end
def startup_plist
return <<-EOPLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>io.redis.redis-server</string>
<key>ProgramArguments</key>
<array>
<string>#{bin}/redis-server</string>
<string>#{etc}/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/redis.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/redis.log</string>
</dict>
</plist>
EOPLIST
end
end
|
require 'formula'
class Rhino < Formula
homepage 'https://www.mozilla.org/rhino/'
url 'https://github.com/mozilla/rhino/releases/download/Rhino1_7R5_RELEASE/rhino1_7R5.zip'
sha1 '39ada4cca8c7f651a68eda3f307ff9b68808f0ce'
version '1.7R5'
def install
libexec.install 'js.jar'
bin.write_jar_script libexec/'js.jar', 'rhino'
end
test do
system "#{bin}/rhino", '-e', 'print(42);'
end
end
rhino 1.7.6
Rhino 1.7.6.
Closes Homebrew/homebrew#38685.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
require 'formula'
class Rhino < Formula
homepage 'https://www.mozilla.org/rhino/'
url 'https://github.com/mozilla/rhino/releases/download/Rhino1_7_6_RELEASE/rhino1.7.6.zip'
sha1 '7d86ccb422bc82569b334bad68cee385c3a4540c'
def install
libexec.install 'js.jar'
bin.write_jar_script libexec/'js.jar', 'rhino'
end
test do
system "#{bin}/rhino", '-e', 'print(42);'
end
end
|
class Scons < Formula
desc "Substitute for classic 'make' tool with autoconf/automake functionality"
homepage "http://www.scons.org"
url "https://downloads.sourceforge.net/project/scons/scons/3.0.1/scons-3.0.1.tar.gz"
sha256 "24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173"
revision 1 unless OS.mac?
bottle do
cellar :any_skip_relocation
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :high_sierra
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :sierra
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :el_capitan
end
depends_on "python" unless OS.mac?
def install
inreplace "engine/SCons/Platform/posix.py",
"env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin'",
"env['ENV']['PATH'] = '#{HOMEBREW_PREFIX}/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin'" \
if OS.linux?
man1.install gzip("scons-time.1", "scons.1", "sconsign.1")
system (OS.mac? ? "/usr/bin/python" : "python"), "setup.py", "install",
"--prefix=#{prefix}",
"--standalone-lib",
# SCons gets handsy with sys.path---`scons-local` is one place it
# will look when all is said and done.
"--install-lib=#{libexec}/scons-local",
"--install-scripts=#{bin}",
"--install-data=#{libexec}",
"--no-version-script", "--no-install-man"
# Re-root scripts to libexec so they can import SCons and symlink back into
# bin. Similar tactics are used in the duplicity formula.
bin.children.each do |p|
mv p, "#{libexec}/#{p.basename}.py"
bin.install_symlink "#{libexec}/#{p.basename}.py" => p.basename
end
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
int main()
{
printf("Homebrew");
return 0;
}
EOS
(testpath/"SConstruct").write "Program('test.c')"
system bin/"scons"
assert_equal "Homebrew", shell_output("#{testpath}/test")
end
end
scons: update 3.0.1_1 bottle for Linuxbrew.
class Scons < Formula
desc "Substitute for classic 'make' tool with autoconf/automake functionality"
homepage "http://www.scons.org"
url "https://downloads.sourceforge.net/project/scons/scons/3.0.1/scons-3.0.1.tar.gz"
sha256 "24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173"
revision 1 unless OS.mac?
bottle do
cellar :any_skip_relocation
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :high_sierra
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :sierra
sha256 "c791b4905477a5fbc33345cef5e412807ffc90ba6ea35bfc9a263f542702aa1c" => :el_capitan
sha256 "311b21b2300ccead3058b52bb15c2d800767eb22709eed0cca349e215d2bc9e7" => :x86_64_linux
end
depends_on "python" unless OS.mac?
def install
inreplace "engine/SCons/Platform/posix.py",
"env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin'",
"env['ENV']['PATH'] = '#{HOMEBREW_PREFIX}/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin'" \
if OS.linux?
man1.install gzip("scons-time.1", "scons.1", "sconsign.1")
system (OS.mac? ? "/usr/bin/python" : "python"), "setup.py", "install",
"--prefix=#{prefix}",
"--standalone-lib",
# SCons gets handsy with sys.path---`scons-local` is one place it
# will look when all is said and done.
"--install-lib=#{libexec}/scons-local",
"--install-scripts=#{bin}",
"--install-data=#{libexec}",
"--no-version-script", "--no-install-man"
# Re-root scripts to libexec so they can import SCons and symlink back into
# bin. Similar tactics are used in the duplicity formula.
bin.children.each do |p|
mv p, "#{libexec}/#{p.basename}.py"
bin.install_symlink "#{libexec}/#{p.basename}.py" => p.basename
end
end
test do
(testpath/"test.c").write <<~EOS
#include <stdio.h>
int main()
{
printf("Homebrew");
return 0;
}
EOS
(testpath/"SConstruct").write "Program('test.c')"
system bin/"scons"
assert_equal "Homebrew", shell_output("#{testpath}/test")
end
end
|
class Seqtk < Formula
desc "Toolkit for processing sequences in FASTA/Q formats"
homepage "https://github.com/lh3/seqtk"
url "https://github.com/lh3/seqtk/archive/v1.3.tar.gz"
sha256 "5a1687d65690f2f7fa3f998d47c3c5037e792f17ce119dab52fff3cfdca1e563"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "bdcc9b85644f98bbcdffbb84816e40714c254f8e9e8c8e5c042b4d25496e0010" => :big_sur
sha256 "5abbf374f3dab69b198b98a3126f521b64baf01ac5ed69b99be91ffd97f891f8" => :catalina
sha256 "b695a43103700d7d0d4a07d50d8effec280f7d7a781ff518a42dec2bef44801e" => :mojave
sha256 "4f377caf93e5d334e739375a5dcf06782f1d85516988a26df3f8f53d172b1e6f" => :high_sierra
sha256 "fd3ecced5ba8f5a9eab13f8f2184f6a69d08b58c1ef53ad6e74bb45cab9324f4" => :sierra
sha256 "55541e7e9249ef15bd4423ad9a45903918c2b4b54f632bc0472fb24aee683701" => :el_capitan
end
uses_from_macos "zlib"
def install
system "make"
bin.install "seqtk"
end
test do
(testpath/"test.fasta").write <<~EOS
>U00096.2:1-70
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCT
CTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
EOS
assert_match "TCTCTG", shell_output("#{bin}/seqtk seq test.fasta")
end
end
seqtk: update 1.3 bottle.
class Seqtk < Formula
desc "Toolkit for processing sequences in FASTA/Q formats"
homepage "https://github.com/lh3/seqtk"
url "https://github.com/lh3/seqtk/archive/v1.3.tar.gz"
sha256 "5a1687d65690f2f7fa3f998d47c3c5037e792f17ce119dab52fff3cfdca1e563"
license "MIT"
bottle do
cellar :any_skip_relocation
sha256 "bdcc9b85644f98bbcdffbb84816e40714c254f8e9e8c8e5c042b4d25496e0010" => :big_sur
sha256 "4e1d4c35dc64c5ea008ecb2e83bfc5d7a4047256e37923a981e5a6cd6038f368" => :arm64_big_sur
sha256 "5abbf374f3dab69b198b98a3126f521b64baf01ac5ed69b99be91ffd97f891f8" => :catalina
sha256 "b695a43103700d7d0d4a07d50d8effec280f7d7a781ff518a42dec2bef44801e" => :mojave
sha256 "4f377caf93e5d334e739375a5dcf06782f1d85516988a26df3f8f53d172b1e6f" => :high_sierra
sha256 "fd3ecced5ba8f5a9eab13f8f2184f6a69d08b58c1ef53ad6e74bb45cab9324f4" => :sierra
sha256 "55541e7e9249ef15bd4423ad9a45903918c2b4b54f632bc0472fb24aee683701" => :el_capitan
end
uses_from_macos "zlib"
def install
system "make"
bin.install "seqtk"
end
test do
(testpath/"test.fasta").write <<~EOS
>U00096.2:1-70
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCT
CTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
EOS
assert_match "TCTCTG", shell_output("#{bin}/seqtk seq test.fasta")
end
end
|
class Siege < Formula
desc "HTTP regression testing and benchmarking utility"
homepage "https://www.joedog.org/siege-home/"
url "http://download.joedog.org/siege/siege-4.0.7.tar.gz"
sha256 "bfa75b3eaad372e7b89eee75d789cd6acbda34900a0c6e49030cf0f803b56df8"
license "GPL-3.0"
bottle do
sha256 "b7de9172ade8285cc5107e598397b6519edee6c1ecf4bb095faa7a1da1346da0" => :catalina
sha256 "5a0064c051bbd111b8d8723fce3107e41777b223bedffc4e0d0d9da1967e6703" => :mojave
sha256 "7c4381adab349f46db1445936da393a0f6d007b0f47f3d7660686718b5f9db4e" => :high_sierra
end
depends_on "openssl@1.1"
def install
# To avoid unnecessary warning due to hardcoded path, create the folder first
(prefix/"etc").mkdir
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--localstatedir=#{var}",
"--with-ssl=#{Formula["openssl@1.1"].opt_prefix}",
"--with-zlib=#{MacOS.sdk_path_if_needed}/usr"
system "make", "install"
end
def caveats
<<~EOS
macOS has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000
Run siege.config to create the ~/.siegerc config file.
EOS
end
test do
system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
end
end
siege: update 4.0.7 bottle.
class Siege < Formula
desc "HTTP regression testing and benchmarking utility"
homepage "https://www.joedog.org/siege-home/"
url "http://download.joedog.org/siege/siege-4.0.7.tar.gz"
sha256 "bfa75b3eaad372e7b89eee75d789cd6acbda34900a0c6e49030cf0f803b56df8"
license "GPL-3.0"
bottle do
sha256 "ccc545449c2a0bacb0054078faee630f23e4728d1bf137cba9c5d8aa82e02495" => :catalina
sha256 "0704038a2995eec4ffacbb3554230b2825ebb21c3c9c612baae24999a620e183" => :mojave
sha256 "d2793b5aee87ffe4c04fca2c807477c3bcc8c5979888d26db995e0e58bece246" => :high_sierra
end
depends_on "openssl@1.1"
def install
# To avoid unnecessary warning due to hardcoded path, create the folder first
(prefix/"etc").mkdir
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--localstatedir=#{var}",
"--with-ssl=#{Formula["openssl@1.1"].opt_prefix}",
"--with-zlib=#{MacOS.sdk_path_if_needed}/usr"
system "make", "install"
end
def caveats
<<~EOS
macOS has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000
Run siege.config to create the ~/.siegerc config file.
EOS
end
test do
system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
end
end
|
class Siege < Formula
desc "HTTP regression testing and benchmarking utility"
homepage "https://www.joedog.org/siege-home/"
url "http://download.joedog.org/siege/siege-4.0.4.tar.gz"
sha256 "8f7dcf18bd722bb9cc92bc3ea4b59836b4a2f8d8f01d4a94c8d181f56d91ea6f"
bottle do
sha256 "975fa6c60a27b9462d55ef7b4e9faeec0569de3b48bd10dab89c88a001350459" => :mojave
sha256 "a5e4990ab448ec37e9e5e7b392a7bf6aee03313bad6d89c6fda45decd4ddecf4" => :high_sierra
sha256 "84ad0232db938f558c2ad57b5c61382b136483c3d4f106f6fcea7e647d2b9982" => :sierra
sha256 "4ffac4100438cc7d6784a64774770ffe219bf330e96890c77eb012bab0f02ba5" => :el_capitan
end
depends_on "openssl"
def install
# To avoid unnecessary warning due to hardcoded path, create the folder first
(prefix/"etc").mkdir
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--localstatedir=#{var}",
"--with-ssl=#{Formula["openssl"].opt_prefix}"
system "make", "install"
end
def caveats; <<~EOS
macOS has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000
Run siege.config to create the ~/.siegerc config file.
EOS
end
test do
system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
end
end
siege: use system zlib
refs #37326
Closes #37342.
Signed-off-by: Misty De Meo <85d6b3741948526aebc363d97f74b6575b2cc027@github.com>
class Siege < Formula
desc "HTTP regression testing and benchmarking utility"
homepage "https://www.joedog.org/siege-home/"
url "http://download.joedog.org/siege/siege-4.0.4.tar.gz"
sha256 "8f7dcf18bd722bb9cc92bc3ea4b59836b4a2f8d8f01d4a94c8d181f56d91ea6f"
revision 1
bottle do
sha256 "975fa6c60a27b9462d55ef7b4e9faeec0569de3b48bd10dab89c88a001350459" => :mojave
sha256 "a5e4990ab448ec37e9e5e7b392a7bf6aee03313bad6d89c6fda45decd4ddecf4" => :high_sierra
sha256 "84ad0232db938f558c2ad57b5c61382b136483c3d4f106f6fcea7e647d2b9982" => :sierra
sha256 "4ffac4100438cc7d6784a64774770ffe219bf330e96890c77eb012bab0f02ba5" => :el_capitan
end
depends_on "openssl"
def install
# To avoid unnecessary warning due to hardcoded path, create the folder first
(prefix/"etc").mkdir
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--localstatedir=#{var}",
"--with-ssl=#{Formula["openssl"].opt_prefix}",
"--with-zlib=#{MacOS.sdk_path_if_needed}/usr"
system "make", "install"
end
def caveats; <<~EOS
macOS has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000
Run siege.config to create the ~/.siegerc config file.
EOS
end
test do
system "#{bin}/siege", "--concurrent=1", "--reps=1", "https://www.google.com/"
end
end
|
require 'formula'
class Smake < Formula
homepage 'http://s-make.sourceforge.net/'
url 'https://downloads.sourceforge.net/project/s-make/smake-1.2.4.tar.bz2'
sha1 '677af2a1b768d5dfd3bd71dc46f81992e798191b'
bottle do
sha1 "30e72ed47a18ce5c90107cc45ac8b603b508169f" => :yosemite
sha1 "6883bca2c7c13db1139234f73ef387f6a311fbcd" => :mavericks
sha1 "709ab7a8011da3b92d61db6aa9eef3c7fbc1b9e7" => :mountain_lion
end
# A sed operation silently fails on Lion or older, due
# to some locale settings in smake's build files. The sed
# wrapper on 10.8+ overrides them.
env :std if MacOS.version <= :lion
def install
ENV.deparallelize # the bootstrap smake does not like -j
system "make", "GMAKE_NOWARN=true", "INS_BASE=#{libexec}", "INS_RBASE=#{libexec}", "install"
bin.install_symlink libexec/"bin/smake"
man1.install_symlink Dir["#{libexec}/share/man/man1/*.1"]
man5.install_symlink Dir["#{libexec}/share/man/man5/*.5"]
end
test do
system "#{bin}/smake", "-version"
end
end
smake 1.2.5
Closes Homebrew/homebrew#38906.
Signed-off-by: Xu Cheng <9a05244150b861e40c78843b801eed71bca54eac@me.com>
require 'formula'
class Smake < Formula
homepage "http://s-make.sourceforge.net/"
url "https://downloads.sourceforge.net/project/s-make/smake-1.2.5.tar.bz2"
sha256 "27566aa731a400c791cd95361cc755288b44ff659fa879933d4ea35d052259d4"
bottle do
sha1 "30e72ed47a18ce5c90107cc45ac8b603b508169f" => :yosemite
sha1 "6883bca2c7c13db1139234f73ef387f6a311fbcd" => :mavericks
sha1 "709ab7a8011da3b92d61db6aa9eef3c7fbc1b9e7" => :mountain_lion
end
# A sed operation silently fails on Lion or older, due
# to some locale settings in smake's build files. The sed
# wrapper on 10.8+ overrides them.
env :std if MacOS.version <= :lion
def install
ENV.deparallelize # the bootstrap smake does not like -j
system "make", "GMAKE_NOWARN=true", "INS_BASE=#{libexec}", "INS_RBASE=#{libexec}", "install"
bin.install_symlink libexec/"bin/smake"
man1.install_symlink Dir["#{libexec}/share/man/man1/*.1"]
man5.install_symlink Dir["#{libexec}/share/man/man5/*.5"]
end
test do
system "#{bin}/smake", "-version"
end
end
|
class Snzip < Formula
desc "Compression/decompression tool based on snappy"
homepage "https://github.com/kubo/snzip"
url "https://bintray.com/artifact/download/kubo/generic/snzip-1.0.4.tar.gz"
sha256 "a45081354715d48ed31899508ebed04a41d4b4a91dca37b79fc3b8ee0c02e25e"
revision 1
bottle do
cellar :any
sha256 "823e1f1e956fa360c53a42d388bd8ae2743a9acaf7a5b5e0ef9917bedbd8fa0e" => :sierra
sha256 "68b4d3fd3d9eaf7aca423e3ab5b4b70f132c1c93ecb0340ed9a955e4dc05e55a" => :el_capitan
sha256 "48922501808047146276f2ba24babe2c1f31f4ba602bc31c9ad04bd28e95316d" => :yosemite
end
depends_on "snappy"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.out").write "test"
system "#{bin}/snzip", "test.out"
system "#{bin}/snzip", "-d", "test.out.sz"
end
end
snzip: revision for snappy
class Snzip < Formula
desc "Compression/decompression tool based on snappy"
homepage "https://github.com/kubo/snzip"
url "https://bintray.com/artifact/download/kubo/generic/snzip-1.0.4.tar.gz"
sha256 "a45081354715d48ed31899508ebed04a41d4b4a91dca37b79fc3b8ee0c02e25e"
revision 2
bottle do
cellar :any
sha256 "823e1f1e956fa360c53a42d388bd8ae2743a9acaf7a5b5e0ef9917bedbd8fa0e" => :sierra
sha256 "68b4d3fd3d9eaf7aca423e3ab5b4b70f132c1c93ecb0340ed9a955e4dc05e55a" => :el_capitan
sha256 "48922501808047146276f2ba24babe2c1f31f4ba602bc31c9ad04bd28e95316d" => :yosemite
end
depends_on "snappy"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.out").write "test"
system "#{bin}/snzip", "test.out"
system "#{bin}/snzip", "-d", "test.out.sz"
end
end
|
class Sonic < Formula
desc "Fast, lightweight & schema-less search backend"
homepage "https://github.com/valeriansaliou/sonic"
url "https://github.com/valeriansaliou/sonic/archive/v1.3.5.tar.gz"
sha256 "ff6b72939e87d2172428ac302a3aa152ac8a37206b8b0d11e73ded14dcc8e858"
license "MPL-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "0516f6d0b48cdb1341503d7624a4331ba7a295fe1d6212a10da9fc126ed97274"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "185d38158dec8ed312e1918034c686e7b38f60e19e018211bad81195ada48890"
sha256 cellar: :any_skip_relocation, monterey: "d748bdcdfc8006e53155bac2381e6f67a96b0058c9c6c37a69febe2b63caafe7"
sha256 cellar: :any_skip_relocation, big_sur: "ff012f2dc4eb12de080031e39605d8a5a1432b42e1f25a8ba4500235e30b61cb"
sha256 cellar: :any_skip_relocation, catalina: "dff9ddad869f6ddd7847906a29ff8e340deca793ddbd4bb20f2d75da97abde90"
sha256 cellar: :any_skip_relocation, x86_64_linux: "21b10085bc3ead567627b4a7b2f312754df2c42370ca4b9f2b2f0c16e9e48188"
end
depends_on "rust" => :build
uses_from_macos "llvm" => :build
uses_from_macos "netcat" => :test
def install
system "cargo", "install", *std_cargo_args
inreplace "config.cfg", "./", var/"sonic/"
etc.install "config.cfg" => "sonic.cfg"
end
service do
run [opt_bin/"sonic", "-c", etc/"sonic.cfg"]
keep_alive true
working_dir var
log_path var/"log/sonic.log"
error_log_path var/"log/sonic.log"
end
test do
port = free_port
cp etc/"sonic.cfg", testpath/"config.cfg"
inreplace "config.cfg", "[::1]:1491", "0.0.0.0:#{port}"
inreplace "config.cfg", "#{var}/sonic", "."
fork { exec bin/"sonic" }
sleep 2
system "nc", "-z", "localhost", port
end
end
sonic: update 1.3.5 bottle.
class Sonic < Formula
desc "Fast, lightweight & schema-less search backend"
homepage "https://github.com/valeriansaliou/sonic"
url "https://github.com/valeriansaliou/sonic/archive/v1.3.5.tar.gz"
sha256 "ff6b72939e87d2172428ac302a3aa152ac8a37206b8b0d11e73ded14dcc8e858"
license "MPL-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "12cd94403578b030f96f2208528abebb6269cef80e06efbeefbc8f5baa8ce782"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "c52af62adf108a51d03bb005b9b161c6dc956afd80760bb2283728e66591d5ba"
sha256 cellar: :any_skip_relocation, monterey: "0c45791287c7b6908028c6048231a2c59a88f502bf47968df9013f9ded539e5b"
sha256 cellar: :any_skip_relocation, big_sur: "806778d9239d3131ab09956665d21676dc999b03c5ab1bb10bb1b2a4120a988f"
sha256 cellar: :any_skip_relocation, catalina: "7925072868e77b09a96c3bcc99cf4f3f986792269cc4702a6f22ee1e7d741f83"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e7332b36992b4248bcee2636e67591d58805447a97387703d53f03e88497ce4d"
end
depends_on "rust" => :build
uses_from_macos "llvm" => :build
uses_from_macos "netcat" => :test
def install
system "cargo", "install", *std_cargo_args
inreplace "config.cfg", "./", var/"sonic/"
etc.install "config.cfg" => "sonic.cfg"
end
service do
run [opt_bin/"sonic", "-c", etc/"sonic.cfg"]
keep_alive true
working_dir var
log_path var/"log/sonic.log"
error_log_path var/"log/sonic.log"
end
test do
port = free_port
cp etc/"sonic.cfg", testpath/"config.cfg"
inreplace "config.cfg", "[::1]:1491", "0.0.0.0:#{port}"
inreplace "config.cfg", "#{var}/sonic", "."
fork { exec bin/"sonic" }
sleep 2
system "nc", "-z", "localhost", port
end
end
|
require 'formula'
class NoBdb5 < Requirement
# Not fatal in case Squid starts working with a newer version of BDB.
fatal false
satisfy(:build_env => false) { !Formula.factory("berkeley-db").installed? }
def message; <<-EOS.undent
This software can fail to compile when Berkeley-DB 5.x is installed.
You may need to try:
brew unlink berkeley-db
brew install squid
brew link berkeley-db
EOS
end
end
class Squid < Formula
homepage 'http://www.squid-cache.org/'
url 'http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.5.tar.gz'
sha1 '17c6f03ca90b0918b847e9e34669ba827da7edba'
depends_on NoBdb5.new
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}"
system "make install"
end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/squid</string>
<string>-N</string>
<string>-d 1</string>
<string>-D</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
</dict>
</plist>
EOS
end
end
squild: style nits
require 'formula'
class NoBdb5 < Requirement
# Not fatal in case Squid starts working with a newer version of BDB.
fatal false
satisfy(:build_env => false) { !Formula.factory("berkeley-db").installed? }
def message; <<-EOS.undent
This software can fail to compile when Berkeley-DB 5.x is installed.
You may need to try:
brew unlink berkeley-db
brew install squid
brew link berkeley-db
EOS
end
end
class Squid < Formula
homepage 'http://www.squid-cache.org/'
url 'http://www.squid-cache.org/Versions/v3/3.2/squid-3.2.5.tar.gz'
sha1 '17c6f03ca90b0918b847e9e34669ba827da7edba'
depends_on NoBdb5
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}"
system "make install"
end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_prefix}/sbin/squid</string>
<string>-N</string>
<string>-d 1</string>
<string>-D</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>WorkingDirectory</key>
<string>#{var}</string>
</dict>
</plist>
EOS
end
end
|
class Stern < Formula
desc "Tail multiple Kubernetes pods & their containers."
homepage "https://github.com/wercker/stern"
url "https://github.com/wercker/stern/archive/1.5.0.tar.gz"
sha256 "2e2e1baef022fa850d5fc9ceb4053a35cd033e9059621c4cdabff874cb39cbaf"
head "https://github.com/wercker/stern.git",
:shallow => false
bottle do
cellar :any_skip_relocation
sha256 "4c2136c7e92177ce888ecf552570ab5722731c0ff09d09497682078f8fa1bf90" => :sierra
sha256 "d25a88970f952b7f05de8aaa9698e0f00add5ff8eb5e065c5060ab5b51f607ac" => :el_capitan
sha256 "e8b7b50252464d9d4ff135be76f7e08f58f17c9100d6cba757fdc5af213265a8" => :yosemite
end
depends_on "go" => :build
depends_on "govendor" => :build
def install
contents = Dir["{*,.git,.gitignore}"]
gopath = buildpath/"gopath"
(gopath/"src/github.com/wercker/stern").install contents
ENV["GOPATH"] = gopath
ENV.prepend_create_path "PATH", gopath/"bin"
cd gopath/"src/github.com/wercker/stern" do
system "govendor", "sync"
system "go", "build", "-o", "bin/stern"
bin.install "bin/stern"
end
end
test do
system "#{bin}/stern", "--version"
end
end
stern: update 1.5.0 bottle.
class Stern < Formula
desc "Tail multiple Kubernetes pods & their containers."
homepage "https://github.com/wercker/stern"
url "https://github.com/wercker/stern/archive/1.5.0.tar.gz"
sha256 "2e2e1baef022fa850d5fc9ceb4053a35cd033e9059621c4cdabff874cb39cbaf"
head "https://github.com/wercker/stern.git",
:shallow => false
bottle do
cellar :any_skip_relocation
sha256 "33146c5768cd6dcc101fe5557b61b937cd550e61d6be34b44088351e6de7cdd1" => :sierra
sha256 "7ccf008b8e3db8f8afcc8047b144a036f8d985615231576641fb46e3cbce35dc" => :el_capitan
sha256 "cefee06366dee336ce9cb3996b1c2d45c584e5fa3dab9a17e55638be19ac4e43" => :yosemite
end
depends_on "go" => :build
depends_on "govendor" => :build
def install
contents = Dir["{*,.git,.gitignore}"]
gopath = buildpath/"gopath"
(gopath/"src/github.com/wercker/stern").install contents
ENV["GOPATH"] = gopath
ENV.prepend_create_path "PATH", gopath/"bin"
cd gopath/"src/github.com/wercker/stern" do
system "govendor", "sync"
system "go", "build", "-o", "bin/stern"
bin.install "bin/stern"
end
end
test do
system "#{bin}/stern", "--version"
end
end
|
class Stern < Formula
desc "Tail multiple Kubernetes pods & their containers"
homepage "https://github.com/stern/stern"
url "https://github.com/stern/stern/archive/v1.17.0.tar.gz"
sha256 "6a3e62774793ebf318cfc3a296c92c6211afcf39f2ea852f6eea5b7319ff5ca1"
license "Apache-2.0"
head "https://github.com/stern/stern.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1fe84c0352071e5e298b51b731bf41131933c292c073d7ef0b1819dc0643a2d8"
sha256 cellar: :any_skip_relocation, big_sur: "405567683bac9931fb2d88f6a1c32928d12327b972d9ac585c9d2ebea2eec661"
sha256 cellar: :any_skip_relocation, catalina: "da35f1b0008de6db7de6761f576da73ddc458e66275bebab4bdc40d1179f54e4"
sha256 cellar: :any_skip_relocation, mojave: "a986b92863c0a8ce4fb1f3264dc06ce403ef1e7db61efcde8b9f2837effed3d4"
end
depends_on "go" => :build
def install
system "go", "build", "-ldflags", "-s -w -X github.com/stern/stern/cmd.version=#{version}", *std_go_args
# Install shell completion
output = Utils.safe_popen_read("#{bin}/stern", "--completion=bash")
(bash_completion/"stern").write output
output = Utils.safe_popen_read("#{bin}/stern", "--completion=zsh")
(zsh_completion/"_stern").write output
end
test do
assert_match "version: #{version}", shell_output("#{bin}/stern --version")
end
end
stern 1.18.0
Closes #77415.
Signed-off-by: Carlo Cabrera <3ffc397d0e4bded29cb84b56167de54c01e3a55b@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Stern < Formula
desc "Tail multiple Kubernetes pods & their containers"
homepage "https://github.com/stern/stern"
url "https://github.com/stern/stern/archive/v1.18.0.tar.gz"
sha256 "86cb6458c2136936e787363587cfe3dd81fb96251ea961e7801824c3db0b4441"
license "Apache-2.0"
head "https://github.com/stern/stern.git"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1fe84c0352071e5e298b51b731bf41131933c292c073d7ef0b1819dc0643a2d8"
sha256 cellar: :any_skip_relocation, big_sur: "405567683bac9931fb2d88f6a1c32928d12327b972d9ac585c9d2ebea2eec661"
sha256 cellar: :any_skip_relocation, catalina: "da35f1b0008de6db7de6761f576da73ddc458e66275bebab4bdc40d1179f54e4"
sha256 cellar: :any_skip_relocation, mojave: "a986b92863c0a8ce4fb1f3264dc06ce403ef1e7db61efcde8b9f2837effed3d4"
end
depends_on "go" => :build
def install
system "go", "build", "-ldflags", "-s -w -X github.com/stern/stern/cmd.version=#{version}", *std_go_args
# Install shell completion
output = Utils.safe_popen_read("#{bin}/stern", "--completion=bash")
(bash_completion/"stern").write output
output = Utils.safe_popen_read("#{bin}/stern", "--completion=zsh")
(zsh_completion/"_stern").write output
end
test do
assert_match "version: #{version}", shell_output("#{bin}/stern --version")
end
end
|
class Swift < Formula
desc "High-performance system programming language"
homepage "https://github.com/apple/swift"
url "https://github.com/apple/swift/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "026d596dd4a24580a5e442409e8c58259197bd73ddbb77e5aade96da982ea39b"
bottle do
cellar :any
sha256 "f283aa347aa58b57dd835a91f311837fcb4b8cdbea52aaf9dcffdf33b8915e0c" => :high_sierra
sha256 "2d8f4b3bf2a3c1d5ffd811b42378cb43da9f49c0c16fec6e294d93338bfc57ad" => :sierra
end
keg_only :provided_by_osx, "Apple's CLT package contains Swift"
depends_on "cmake" => :build
depends_on "ninja" => :build
# Depends on latest version of Xcode
# https://github.com/apple/swift#system-requirements
depends_on :xcode => ["9.0", :build]
# This formula is expected to have broken/missing linkage to
# both UIKit.framework and AssetsLibrary.framework. This is
# simply due to the nature of Swift's SDK Overlays.
resource "clang" do
url "https://github.com/apple/swift-clang/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "c940bd48c88f71622fb00167d92a619dd1614093893e1a09982c08da42259404"
end
resource "cmark" do
url "https://github.com/apple/swift-cmark/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "e95d0b54a0e897e768c9437dd67d56ec887909d0294cf6536ba240accd0d294f"
end
resource "compiler-rt" do
url "https://github.com/apple/swift-compiler-rt/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "1c2da685e8f424cb4460ed1daaf0c308f8deff63e7a3716c8a881cef60fbc7d8"
end
resource "llbuild" do
url "https://github.com/apple/swift-llbuild/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "92001e449b54a47516086a4e7d5f575bffa2847ae1f658540b2ec6f6dee6c6e7"
end
resource "llvm" do
url "https://github.com/apple/swift-llvm/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "a611487a82636142bc1ea8ef5b21401a5c75e57fb0dbf041ef8f2e85a472db2e"
end
resource "swiftpm" do
url "https://github.com/apple/swift-package-manager/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "4c26d333a01c239de8aa96b0536b7ff7218b7a322851a7d3b3b91b59fb4ce244"
end
# According to the official llvm readme, GCC 4.7+ is required
fails_with :gcc_4_0
fails_with :gcc
("4.3".."4.6").each do |n|
fails_with :gcc => n
end
def install
workspace = buildpath.parent
build = workspace/"build"
toolchain_prefix = "/Swift-#{version}.xctoolchain"
install_prefix = "#{toolchain_prefix}/usr"
ln_sf buildpath, "#{workspace}/swift"
resources.each { |r| r.stage("#{workspace}/#{r.name}") }
mkdir build do
system "#{buildpath}/utils/build-script",
"--release", "--assertions",
"--no-swift-stdlib-assertions",
"--build-subdir=#{build}",
"--llbuild", "--swiftpm",
"--ios", "--tvos", "--watchos",
"--",
"--workspace=#{workspace}", "--build-args=-j#{ENV.make_jobs}",
"--install-destdir=#{prefix}", "--toolchain-prefix=#{toolchain_prefix}",
"--install-prefix=#{install_prefix}", "--host-target=macosx-x86_64",
"--build-swift-static-stdlib", "--build-swift-dynamic-stdlib",
"--build-swift-dynamic-sdk-overlay", "--build-swift-static-sdk-overlay",
"--build-swift-stdlib-unittest-extra", "--install-swift",
"--swift-install-components=compiler;clang-resource-dir-symlink;"\
"clang-builtin-headers-in-clang-resource-dir;stdlib;sdk-overlay;tools;"\
"editor-integration;testsuite-tools;toolchain-dev-tools;license;sourcekit-inproc;"\
"sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers",
"--llvm-install-components=clang;libclang;libclang-headers",
"--install-llbuild", "--install-swiftpm"
end
end
test do
(testpath/"test.swift").write <<~EOS
let base = 2
let exponent_inner = 3
let exponent_outer = 4
var answer = 1
for _ in 1...exponent_outer {
for _ in 1...exponent_inner {
answer *= base
}
}
print("(\\(base)^\\(exponent_inner))^\\(exponent_outer) == \\(answer)")
EOS
output = shell_output("#{prefix}/Swift-#{version}.xctoolchain/usr/bin/swift test.swift")
assert_match "(2^3)^4 == 4096\n", output
end
end
swift: use *_by_macos.
class Swift < Formula
desc "High-performance system programming language"
homepage "https://github.com/apple/swift"
url "https://github.com/apple/swift/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "026d596dd4a24580a5e442409e8c58259197bd73ddbb77e5aade96da982ea39b"
bottle do
cellar :any
sha256 "f283aa347aa58b57dd835a91f311837fcb4b8cdbea52aaf9dcffdf33b8915e0c" => :high_sierra
sha256 "2d8f4b3bf2a3c1d5ffd811b42378cb43da9f49c0c16fec6e294d93338bfc57ad" => :sierra
end
keg_only :provided_by_macos, "Apple's CLT package contains Swift"
depends_on "cmake" => :build
depends_on "ninja" => :build
# Depends on latest version of Xcode
# https://github.com/apple/swift#system-requirements
depends_on :xcode => ["9.0", :build]
# This formula is expected to have broken/missing linkage to
# both UIKit.framework and AssetsLibrary.framework. This is
# simply due to the nature of Swift's SDK Overlays.
resource "clang" do
url "https://github.com/apple/swift-clang/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "c940bd48c88f71622fb00167d92a619dd1614093893e1a09982c08da42259404"
end
resource "cmark" do
url "https://github.com/apple/swift-cmark/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "e95d0b54a0e897e768c9437dd67d56ec887909d0294cf6536ba240accd0d294f"
end
resource "compiler-rt" do
url "https://github.com/apple/swift-compiler-rt/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "1c2da685e8f424cb4460ed1daaf0c308f8deff63e7a3716c8a881cef60fbc7d8"
end
resource "llbuild" do
url "https://github.com/apple/swift-llbuild/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "92001e449b54a47516086a4e7d5f575bffa2847ae1f658540b2ec6f6dee6c6e7"
end
resource "llvm" do
url "https://github.com/apple/swift-llvm/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "a611487a82636142bc1ea8ef5b21401a5c75e57fb0dbf041ef8f2e85a472db2e"
end
resource "swiftpm" do
url "https://github.com/apple/swift-package-manager/archive/swift-4.0.3-RELEASE.tar.gz"
sha256 "4c26d333a01c239de8aa96b0536b7ff7218b7a322851a7d3b3b91b59fb4ce244"
end
# According to the official llvm readme, GCC 4.7+ is required
fails_with :gcc_4_0
fails_with :gcc
("4.3".."4.6").each do |n|
fails_with :gcc => n
end
def install
workspace = buildpath.parent
build = workspace/"build"
toolchain_prefix = "/Swift-#{version}.xctoolchain"
install_prefix = "#{toolchain_prefix}/usr"
ln_sf buildpath, "#{workspace}/swift"
resources.each { |r| r.stage("#{workspace}/#{r.name}") }
mkdir build do
system "#{buildpath}/utils/build-script",
"--release", "--assertions",
"--no-swift-stdlib-assertions",
"--build-subdir=#{build}",
"--llbuild", "--swiftpm",
"--ios", "--tvos", "--watchos",
"--",
"--workspace=#{workspace}", "--build-args=-j#{ENV.make_jobs}",
"--install-destdir=#{prefix}", "--toolchain-prefix=#{toolchain_prefix}",
"--install-prefix=#{install_prefix}", "--host-target=macosx-x86_64",
"--build-swift-static-stdlib", "--build-swift-dynamic-stdlib",
"--build-swift-dynamic-sdk-overlay", "--build-swift-static-sdk-overlay",
"--build-swift-stdlib-unittest-extra", "--install-swift",
"--swift-install-components=compiler;clang-resource-dir-symlink;"\
"clang-builtin-headers-in-clang-resource-dir;stdlib;sdk-overlay;tools;"\
"editor-integration;testsuite-tools;toolchain-dev-tools;license;sourcekit-inproc;"\
"sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers",
"--llvm-install-components=clang;libclang;libclang-headers",
"--install-llbuild", "--install-swiftpm"
end
end
test do
(testpath/"test.swift").write <<~EOS
let base = 2
let exponent_inner = 3
let exponent_outer = 4
var answer = 1
for _ in 1...exponent_outer {
for _ in 1...exponent_inner {
answer *= base
}
}
print("(\\(base)^\\(exponent_inner))^\\(exponent_outer) == \\(answer)")
EOS
output = shell_output("#{prefix}/Swift-#{version}.xctoolchain/usr/bin/swift test.swift")
assert_match "(2^3)^4 == 4096\n", output
end
end
|
class TRec < Formula
desc "Blazingly fast terminal recorder that generates animated gif images for the web"
homepage "https://github.com/sassman/t-rec-rs"
url "https://github.com/sassman/t-rec-rs/archive/v0.3.0.tar.gz"
sha256 "124248b6a31d2f79175c597712357c8fc3354afd7b992df5d14f4ad8e078cc63"
license "GPL-3.0-only"
bottle do
cellar :any_skip_relocation
sha256 "c895fe703a54317c8a9fbeabadf8bbf1910c18f7f7163a818796d5d70c7ace10" => :big_sur
sha256 "6039e8741541b9e2a63e98f144f6ed400389d276c8bbba651b0a407fbff9fca4" => :catalina
sha256 "83733e285f7bb41e547e117e6e8ee8a5d1a7b1dda87e322006826c0b55fc41e6" => :mojave
end
depends_on "rust" => :build
depends_on "imagemagick"
def install
system "cargo", "install", *std_cargo_args
end
test do
# let's fetch the window id
o = shell_output("#{bin}/t-rec -l | tail -1").strip
win_id = o.split(/\s|\n/)[-1]
# verify that it's an appropriate id
assert_equal win_id && Integer(win_id).positive?, true
# verify also error behaviour, as suggested
o = shell_output("WINDOWID=999999 #{bin}/t-rec 2>&1", 1).strip
assert_equal "Error: Cannot grab screenshot from CGDisplay of window id 999999", o
end
end
t-rec: update 0.3.0 bottle.
class TRec < Formula
desc "Blazingly fast terminal recorder that generates animated gif images for the web"
homepage "https://github.com/sassman/t-rec-rs"
url "https://github.com/sassman/t-rec-rs/archive/v0.3.0.tar.gz"
sha256 "124248b6a31d2f79175c597712357c8fc3354afd7b992df5d14f4ad8e078cc63"
license "GPL-3.0-only"
bottle do
cellar :any_skip_relocation
sha256 "8fd5f00875c39f075ca19d6b6030c5e8f7cbd0085fa1fa627df40af102441c17" => :big_sur
sha256 "a32f243bf866f9966e945ced67ebab185763707600422ee1aadd4f00b7a6fde2" => :catalina
sha256 "752857bd8be9fcf9cd769411eadff503242e1148ec4916283a9ee8acc66389a5" => :mojave
end
depends_on "rust" => :build
depends_on "imagemagick"
def install
system "cargo", "install", *std_cargo_args
end
test do
# let's fetch the window id
o = shell_output("#{bin}/t-rec -l | tail -1").strip
win_id = o.split(/\s|\n/)[-1]
# verify that it's an appropriate id
assert_equal win_id && Integer(win_id).positive?, true
# verify also error behaviour, as suggested
o = shell_output("WINDOWID=999999 #{bin}/t-rec 2>&1", 1).strip
assert_equal "Error: Cannot grab screenshot from CGDisplay of window id 999999", o
end
end
|
t-rec 0.2.2
Closes #64918.
Signed-off-by: chenrui <5fd29470147430022ff146db88de16ee91dea376@gmail.com>
class TRec < Formula
desc "Blazingly fast terminal recorder that generates animated gif images for the web"
homepage "https://github.com/sassman/t-rec-rs"
url "https://github.com/sassman/t-rec-rs/archive/v0.2.2.tar.gz"
sha256 "57c89a5befeaab63201ee45f47d08a1fe3861947478c729a6f4a9318613e01fa"
license "GPL-3.0-only"
depends_on "rust" => :build
depends_on "imagemagick"
def install
system "cargo", "install", *std_cargo_args
end
test do
# let's fetch the window id
o = shell_output("#{bin}/t-rec -l | tail -1").strip
win_id = o.split(/\s|\n/)[-1]
# verify that it's an appropriate id
assert_equal win_id && Integer(win_id).positive?, true
# verify also error behaviour, as suggested
o = shell_output("WINDOWID=999999 #{bin}/t-rec 2>&1", 1).strip
assert_equal "Error: Cannot grab screenshot from CGDisplay of window id 999999", o
end
end
|
class Tanka < Formula
desc "Flexible, reusable and concise configuration for Kubernetes using Jsonnet"
homepage "https://tanka.dev"
url "https://github.com/grafana/tanka.git",
:tag => "v0.10.0",
:revision => "7f5f485a411aa08752fd6ed4847c8013e95f92d1"
head "https://github.com/grafana/tanka.git"
bottle do
cellar :any_skip_relocation
sha256 "a54f8f418c6ecdfe47395565087a4cd178e6e1a88e211c9af09ac65088e24125" => :catalina
sha256 "e6dea5997e1f3d171eb3ab3dfe3ece611ac47a89b94e46aa679e1ed407a3d475" => :mojave
sha256 "c540615f2c51aa62fd70c6b0ca31686c2b24216c5873c0e93520ef349296f8db" => :high_sierra
end
depends_on "go" => :build
depends_on "kubernetes-cli"
def install
system "make", "static"
bin.install "tk"
end
test do
system "git", "clone", "https://github.com/sh0rez/grafana.libsonnet"
system "#{bin}/tk", "show", "--dangerous-allow-redirect", "grafana.libsonnet/environments/default"
end
end
tanka: add license
class Tanka < Formula
desc "Flexible, reusable and concise configuration for Kubernetes using Jsonnet"
homepage "https://tanka.dev"
url "https://github.com/grafana/tanka.git",
:tag => "v0.10.0",
:revision => "7f5f485a411aa08752fd6ed4847c8013e95f92d1"
license "Apache-2.0"
head "https://github.com/grafana/tanka.git"
bottle do
cellar :any_skip_relocation
sha256 "a54f8f418c6ecdfe47395565087a4cd178e6e1a88e211c9af09ac65088e24125" => :catalina
sha256 "e6dea5997e1f3d171eb3ab3dfe3ece611ac47a89b94e46aa679e1ed407a3d475" => :mojave
sha256 "c540615f2c51aa62fd70c6b0ca31686c2b24216c5873c0e93520ef349296f8db" => :high_sierra
end
depends_on "go" => :build
depends_on "kubernetes-cli"
def install
system "make", "static"
bin.install "tk"
end
test do
system "git", "clone", "https://github.com/sh0rez/grafana.libsonnet"
system "#{bin}/tk", "show", "--dangerous-allow-redirect", "grafana.libsonnet/environments/default"
end
end
|
class Tdlib < Formula
desc "Cross-platform library for building Telegram clients"
homepage "https://core.telegram.org/tdlib"
url "https://github.com/tdlib/td/archive/v1.6.0.tar.gz"
sha256 "9dce57a96f9d4bac8f99aab13ef5cbf6fed04b234a5d22dfa7ef7dce06ea43f8"
license "BSL-1.0"
bottle do
cellar :any
sha256 "c1a28a0f9a80fb62b6ac8a30fffcaf413336e9df49f79f9f952ae38c8840becf" => :catalina
sha256 "08507a9bf3c9f93ff97666fe9478398768f135e7943145a82946e008acf543e7" => :mojave
sha256 "12ce0917663736dc4790482c5545a6bee2b82dd7b304ab401c4232ba5d14a3f3" => :high_sierra
end
depends_on "cmake" => :build
depends_on "gperf"
depends_on "openssl@1.1"
depends_on "readline"
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "cmake", ".", *std_cmake_args
system "make", "install"
end
end
test do
(testpath/"tdjson_example.cpp").write <<~EOS
#include "td/telegram/td_json_client.h"
#include <iostream>
int main() {
void* client = td_json_client_create();
if (!client) return 1;
std::cout << "Client created: " << client;
return 0;
}
EOS
system ENV.cxx, "tdjson_example.cpp", "-L#{lib}", "-ltdjson", "-o", "tdjson_example"
assert_match "Client created", shell_output("./tdjson_example")
end
end
tdlib: add head build (#61640)
class Tdlib < Formula
desc "Cross-platform library for building Telegram clients"
homepage "https://core.telegram.org/tdlib"
url "https://github.com/tdlib/td/archive/v1.6.0.tar.gz"
sha256 "9dce57a96f9d4bac8f99aab13ef5cbf6fed04b234a5d22dfa7ef7dce06ea43f8"
license "BSL-1.0"
head "https://github.com/tdlib/td.git"
bottle do
cellar :any
sha256 "c1a28a0f9a80fb62b6ac8a30fffcaf413336e9df49f79f9f952ae38c8840becf" => :catalina
sha256 "08507a9bf3c9f93ff97666fe9478398768f135e7943145a82946e008acf543e7" => :mojave
sha256 "12ce0917663736dc4790482c5545a6bee2b82dd7b304ab401c4232ba5d14a3f3" => :high_sierra
end
depends_on "cmake" => :build
depends_on "gperf"
depends_on "openssl@1.1"
depends_on "readline"
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "cmake", ".", *std_cmake_args
system "make", "install"
end
end
test do
(testpath/"tdjson_example.cpp").write <<~EOS
#include "td/telegram/td_json_client.h"
#include <iostream>
int main() {
void* client = td_json_client_create();
if (!client) return 1;
std::cout << "Client created: " << client;
return 0;
}
EOS
system ENV.cxx, "tdjson_example.cpp", "-L#{lib}", "-ltdjson", "-o", "tdjson_example"
assert_match "Client created", shell_output("./tdjson_example")
end
end
|
class Tfsec < Formula
desc "Static analysis powered security scanner for your terraform code"
homepage "https://github.com/tfsec/tfsec"
url "https://github.com/tfsec/tfsec/archive/v0.39.26.tar.gz"
sha256 "06caee8a4214d62ebbebf76142f3c755ef3438eef7ea31ed409a339ac5f7f08c"
license "MIT"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "daaa3b490742bc0dcc52d4694d189fbf7fb15b180d2a122e4967d5377130c10d"
sha256 cellar: :any_skip_relocation, big_sur: "5b3041bb66ad87896e523d46b6114b2eb1590a4b87bbbb0534a3e27c08a8a695"
sha256 cellar: :any_skip_relocation, catalina: "303965e7ae202f72eea584dcf72b92c05a6ae7bb0d559efbb33c23b368f29f88"
sha256 cellar: :any_skip_relocation, mojave: "9b2ff3d935a0cb62fa97424b1671cad93c1acf8861621dfb3f131c8b41ece4fc"
end
depends_on "go" => :build
def install
system "scripts/install.sh", "v#{version}"
bin.install "tfsec"
end
test do
(testpath/"good/brew-validate.tf").write <<~EOS
resource "aws_alb_listener" "my-alb-listener" {
port = "443"
protocol = "HTTPS"
}
EOS
(testpath/"bad/brew-validate.tf").write <<~EOS
}
EOS
good_output = shell_output("#{bin}/tfsec #{testpath}/good")
assert_match "No problems detected!", good_output
refute_match("WARNING", good_output)
bad_output = shell_output("#{bin}/tfsec #{testpath}/bad 2>&1")
assert_match "WARNING", bad_output
end
end
tfsec: update 0.39.26 bottle.
class Tfsec < Formula
desc "Static analysis powered security scanner for your terraform code"
homepage "https://github.com/tfsec/tfsec"
url "https://github.com/tfsec/tfsec/archive/v0.39.26.tar.gz"
sha256 "06caee8a4214d62ebbebf76142f3c755ef3438eef7ea31ed409a339ac5f7f08c"
license "MIT"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "daaa3b490742bc0dcc52d4694d189fbf7fb15b180d2a122e4967d5377130c10d"
sha256 cellar: :any_skip_relocation, big_sur: "5b3041bb66ad87896e523d46b6114b2eb1590a4b87bbbb0534a3e27c08a8a695"
sha256 cellar: :any_skip_relocation, catalina: "303965e7ae202f72eea584dcf72b92c05a6ae7bb0d559efbb33c23b368f29f88"
sha256 cellar: :any_skip_relocation, mojave: "9b2ff3d935a0cb62fa97424b1671cad93c1acf8861621dfb3f131c8b41ece4fc"
sha256 cellar: :any_skip_relocation, x86_64_linux: "fa574a8f9c00a3cb714c8658d3c6fc2d2b492129d2f0cbeb030a41c478c38aa2"
end
depends_on "go" => :build
def install
system "scripts/install.sh", "v#{version}"
bin.install "tfsec"
end
test do
(testpath/"good/brew-validate.tf").write <<~EOS
resource "aws_alb_listener" "my-alb-listener" {
port = "443"
protocol = "HTTPS"
}
EOS
(testpath/"bad/brew-validate.tf").write <<~EOS
}
EOS
good_output = shell_output("#{bin}/tfsec #{testpath}/good")
assert_match "No problems detected!", good_output
refute_match("WARNING", good_output)
bad_output = shell_output("#{bin}/tfsec #{testpath}/bad 2>&1")
assert_match "WARNING", bad_output
end
end
|
class Toast < Formula
desc "Tool for running tasks in containers"
homepage "https://github.com/stepchowfun/toast"
url "https://github.com/stepchowfun/toast/archive/v0.29.0.tar.gz"
sha256 "ca119d05c236900d8e99edc6ede52d77e8371b1ea5d85b597417a71cb567da3c"
bottle do
cellar :any_skip_relocation
sha256 "61c148156aa592cb33d4465b18ce81d2ca528c8cc524499e6ead8bb051cbc64c" => :catalina
sha256 "34d9e8efd3a91ee82c9ff509b2abeb1d017c4ac8aa798705c86c7eb394458e3a" => :mojave
sha256 "5e43e3bbd518846007f88539d2826344b84c5ab10d156bceb56207efa6fa1a5f" => :high_sierra
end
depends_on "rust" => :build
def install
system "cargo", "install", "--root", prefix, "--path", "."
end
test do
(testpath/"toast.yml").write <<~EOS
image: alpine
tasks:
homebrew_test:
command: echo hello
EOS
assert_match "homebrew_test", shell_output("#{bin}/toast --list")
end
end
toast: update 0.29.0 bottle.
Closes #16727.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class Toast < Formula
desc "Tool for running tasks in containers"
homepage "https://github.com/stepchowfun/toast"
url "https://github.com/stepchowfun/toast/archive/v0.29.0.tar.gz"
sha256 "ca119d05c236900d8e99edc6ede52d77e8371b1ea5d85b597417a71cb567da3c"
bottle do
cellar :any_skip_relocation
sha256 "61c148156aa592cb33d4465b18ce81d2ca528c8cc524499e6ead8bb051cbc64c" => :catalina
sha256 "34d9e8efd3a91ee82c9ff509b2abeb1d017c4ac8aa798705c86c7eb394458e3a" => :mojave
sha256 "5e43e3bbd518846007f88539d2826344b84c5ab10d156bceb56207efa6fa1a5f" => :high_sierra
sha256 "fa469747cfc5db43c22baefdc1cb936dff0eba25ce2c41b829fdab5b80b22205" => :x86_64_linux
end
depends_on "rust" => :build
def install
system "cargo", "install", "--root", prefix, "--path", "."
end
test do
(testpath/"toast.yml").write <<~EOS
image: alpine
tasks:
homebrew_test:
command: echo hello
EOS
assert_match "homebrew_test", shell_output("#{bin}/toast --list")
end
end
|
class Trzsz < Formula
include Language::Python::Virtualenv
desc "Simple file transfer tools, similar to lrzsz (rz/sz), and compatible with tmux"
homepage "https://trzsz.github.io"
url "https://files.pythonhosted.org/packages/1a/73/dfeb828f96ce7a395fe38ce72f29b0e7fe3c43348f946ca7d3806a79e1a0/trzsz-1.1.0.tar.gz"
sha256 "4e0d1b8afb8912d351e0de997f8f1e557298b547a6daac03c6a60282962ada72"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_monterey: "07154f877574bbf3fee21b8e6a13358473b3bd0d0d45130924042a004a1dbd53"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "8c64bd93a5b3d27d0906f0e72b0c24ab4b9376da99bd744102ee5e865523b490"
sha256 cellar: :any_skip_relocation, monterey: "f398dfd1819a386aba368ae0b3d9d2f8faf05a2f5534a75463588b6226106432"
sha256 cellar: :any_skip_relocation, big_sur: "544b91290504a9dd32eb95cd8088286fd47bbcb04cfd8ed87b2b78b73d265356"
sha256 cellar: :any_skip_relocation, catalina: "afc42b34487bfced6811239e7e0ba531a61b3d6a7f3871148f2216c60853f3b8"
sha256 cellar: :any_skip_relocation, x86_64_linux: "34ec912a61b25e0d9b45afa6c72af31ef3d987f9479ab134ab483314f5157549"
end
depends_on "protobuf"
depends_on "python@3.11"
resource "iterm2" do
url "https://files.pythonhosted.org/packages/4f/eb/47bb125fd3b32969f3bc8e0b8997bbe308484ac4d04331ae1e6199ae2c0f/iterm2-2.7.tar.gz"
sha256 "f6f0bec46c32cecaf7be7fd82296ec4697d4bf2101f0c4aab24cc123991fa230"
end
resource "trzsz-iterm2" do
url "https://files.pythonhosted.org/packages/9a/26/6f8505a1908efde7b771ba365beaf7c627fcb96e27691d380d9dc0272b72/trzsz-iterm2-1.1.0.tar.gz"
sha256 "89f37b641528893ce529adf02e754f6d083379d4c9016590669f329b754f0966"
end
resource "trzsz-libs" do
url "https://files.pythonhosted.org/packages/3f/75/c52618d862018af7ca1923be2b63d2cf7845f69da38970088fd64bb071e5/trzsz-libs-1.1.0.tar.gz"
sha256 "f116a18d6429be74ff6a321e9a6b0b59afecc5d62bf27c9f17bd63a39b31633c"
end
resource "trzsz-svr" do
url "https://files.pythonhosted.org/packages/eb/82/39f3144bd3584f7ecc5f23fa5f929d5cba8135ec690bfcbceae02490448f/trzsz-svr-1.1.0.tar.gz"
sha256 "057ba12437f72e92b95087d6699ba9849d6f1a41286d9e9c7539a603d22a22fc"
end
resource "websockets" do
url "https://files.pythonhosted.org/packages/85/dc/549a807a53c13fd4a8dac286f117a7a71260defea9ec0c05d6027f2ae273/websockets-10.4.tar.gz"
sha256 "eef610b23933c54d5d921c92578ae5f89813438fded840c2e9809d378dc765d3"
end
def install
virtualenv_install_with_resources
bin.install_symlink libexec/"bin/trz"
bin.install_symlink libexec/"bin/tsz"
bin.install_symlink libexec/"bin/trzsz-iterm2"
end
test do
assert_match "trz (trzsz) py #{version}", shell_output("#{bin}/trz -v")
assert_match "tsz (trzsz) py #{version}", shell_output("#{bin}/tsz -v")
assert_match "trzsz-iterm2 (trzsz) py #{version}", shell_output("#{bin}/trzsz-iterm2 -v")
touch "tmpfile"
assert_match "Not a directory", shell_output("#{bin}/trz tmpfile 2>&1")
rm "tmpfile"
assert_match "No such file", shell_output("#{bin}/tsz tmpfile 2>&1")
assert_match "arguments are required", shell_output("#{bin}/trzsz-iterm2 2>&1", 2)
end
end
trzsz: update 1.1.0 bottle.
class Trzsz < Formula
include Language::Python::Virtualenv
desc "Simple file transfer tools, similar to lrzsz (rz/sz), and compatible with tmux"
homepage "https://trzsz.github.io"
url "https://files.pythonhosted.org/packages/1a/73/dfeb828f96ce7a395fe38ce72f29b0e7fe3c43348f946ca7d3806a79e1a0/trzsz-1.1.0.tar.gz"
sha256 "4e0d1b8afb8912d351e0de997f8f1e557298b547a6daac03c6a60282962ada72"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, arm64_ventura: "3f2338f18c26ef9115ad67c2338b8cd07139113e89e2a40e0eaa7b696de2b8cf"
sha256 cellar: :any_skip_relocation, arm64_monterey: "07154f877574bbf3fee21b8e6a13358473b3bd0d0d45130924042a004a1dbd53"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "8c64bd93a5b3d27d0906f0e72b0c24ab4b9376da99bd744102ee5e865523b490"
sha256 cellar: :any_skip_relocation, monterey: "f398dfd1819a386aba368ae0b3d9d2f8faf05a2f5534a75463588b6226106432"
sha256 cellar: :any_skip_relocation, big_sur: "544b91290504a9dd32eb95cd8088286fd47bbcb04cfd8ed87b2b78b73d265356"
sha256 cellar: :any_skip_relocation, catalina: "afc42b34487bfced6811239e7e0ba531a61b3d6a7f3871148f2216c60853f3b8"
sha256 cellar: :any_skip_relocation, x86_64_linux: "34ec912a61b25e0d9b45afa6c72af31ef3d987f9479ab134ab483314f5157549"
end
depends_on "protobuf"
depends_on "python@3.11"
resource "iterm2" do
url "https://files.pythonhosted.org/packages/4f/eb/47bb125fd3b32969f3bc8e0b8997bbe308484ac4d04331ae1e6199ae2c0f/iterm2-2.7.tar.gz"
sha256 "f6f0bec46c32cecaf7be7fd82296ec4697d4bf2101f0c4aab24cc123991fa230"
end
resource "trzsz-iterm2" do
url "https://files.pythonhosted.org/packages/9a/26/6f8505a1908efde7b771ba365beaf7c627fcb96e27691d380d9dc0272b72/trzsz-iterm2-1.1.0.tar.gz"
sha256 "89f37b641528893ce529adf02e754f6d083379d4c9016590669f329b754f0966"
end
resource "trzsz-libs" do
url "https://files.pythonhosted.org/packages/3f/75/c52618d862018af7ca1923be2b63d2cf7845f69da38970088fd64bb071e5/trzsz-libs-1.1.0.tar.gz"
sha256 "f116a18d6429be74ff6a321e9a6b0b59afecc5d62bf27c9f17bd63a39b31633c"
end
resource "trzsz-svr" do
url "https://files.pythonhosted.org/packages/eb/82/39f3144bd3584f7ecc5f23fa5f929d5cba8135ec690bfcbceae02490448f/trzsz-svr-1.1.0.tar.gz"
sha256 "057ba12437f72e92b95087d6699ba9849d6f1a41286d9e9c7539a603d22a22fc"
end
resource "websockets" do
url "https://files.pythonhosted.org/packages/85/dc/549a807a53c13fd4a8dac286f117a7a71260defea9ec0c05d6027f2ae273/websockets-10.4.tar.gz"
sha256 "eef610b23933c54d5d921c92578ae5f89813438fded840c2e9809d378dc765d3"
end
def install
virtualenv_install_with_resources
bin.install_symlink libexec/"bin/trz"
bin.install_symlink libexec/"bin/tsz"
bin.install_symlink libexec/"bin/trzsz-iterm2"
end
test do
assert_match "trz (trzsz) py #{version}", shell_output("#{bin}/trz -v")
assert_match "tsz (trzsz) py #{version}", shell_output("#{bin}/tsz -v")
assert_match "trzsz-iterm2 (trzsz) py #{version}", shell_output("#{bin}/trzsz-iterm2 -v")
touch "tmpfile"
assert_match "Not a directory", shell_output("#{bin}/trz tmpfile 2>&1")
rm "tmpfile"
assert_match "No such file", shell_output("#{bin}/tsz tmpfile 2>&1")
assert_match "arguments are required", shell_output("#{bin}/trzsz-iterm2 2>&1", 2)
end
end
|
class Tsuru < Formula
desc "tsuru-client is a tsuru command line tool for application developers."
homepage "https://docs.tsuru.io/stable/"
url "https://github.com/tsuru/tsuru-client/releases/download/1.2.0/tsuru_1.2.0_macOS_amd64.tar.gz"
version "1.2.0"
sha256 "da6a6b99aa25d14c8c9eb022c260f4085b230ea90144f9d8ba5f232fb959f404"
def install
bin.install "tsuru"
bash_completion.install "misc/bash-completion" => "tsuru"
zsh_completion.install "misc/zsh-completion" => "tsuru"
end
devel do
url "https://github.com/tsuru/tsuru-client/releases/download/1.3.0-rc2/tsuru_1.3.0-rc2_macOS_amd64.tar.gz"
sha256 "d5ec0c88094f623c96b9a2ab998171b4b85c43f4c192b01ed1fddaba51b88a4f"
ENV['TSURU_DEVEL'] = "true"
end
end
manually sets devel version to 1.3.0-rc2
class Tsuru < Formula
desc "tsuru-client is a tsuru command line tool for application developers."
homepage "https://docs.tsuru.io/stable/"
url "https://github.com/tsuru/tsuru-client/releases/download/1.2.0/tsuru_1.2.0_macOS_amd64.tar.gz"
version "1.2.0"
sha256 "da6a6b99aa25d14c8c9eb022c260f4085b230ea90144f9d8ba5f232fb959f404"
def install
bin.install "tsuru"
bash_completion.install "misc/bash-completion" => "tsuru"
zsh_completion.install "misc/zsh-completion" => "tsuru"
end
devel do
url "https://github.com/tsuru/tsuru-client/releases/download/1.3.0-rc2/tsuru_1.3.0-rc2_macOS_amd64.tar.gz"
version "1.3.0-rc2"
sha256 "d5ec0c88094f623c96b9a2ab998171b4b85c43f4c192b01ed1fddaba51b88a4f"
ENV['TSURU_DEVEL'] = "true"
end
end
|
# This file was generated by GoReleaser. DO NOT EDIT.
class Tsuru < Formula
desc "tsuru-client is a tsuru command line tool for application developers."
homepage "https://docs.tsuru.io/stable/"
version "1.9.4"
bottle :unneeded
if OS.mac?
url "https://github.com/tsuru/tsuru-client/releases/download/1.9.4/tsuru_1.9.4_macOS_amd64.tar.gz"
sha256 "3185d90ba605fbfdc29f050dd3ab3fd46a3a904419046b49582f663bf05b8d25"
end
if OS.linux? && Hardware::CPU.intel?
url "https://github.com/tsuru/tsuru-client/releases/download/1.9.4/tsuru_1.9.4_linux_amd64.tar.gz"
sha256 "447ea2909a3f432fa4f66f81d536dfdd1ea40bcd25596bee78958e34c89e76c6"
end
def install
bin.install "tsuru"
bash_completion.install "misc/bash-completion" => "tsuru"
zsh_completion.install "misc/zsh-completion" => "tsuru"
end
end
Brew formula update for tsuru version 1.9.4
# This file was generated by GoReleaser. DO NOT EDIT.
class Tsuru < Formula
desc "tsuru-client is a tsuru command line tool for application developers."
homepage "https://docs.tsuru.io/stable/"
version "1.9.4"
bottle :unneeded
if OS.mac?
url "https://github.com/tsuru/tsuru-client/releases/download/1.9.4/tsuru_1.9.4_macOS_amd64.tar.gz"
sha256 "bb5ef01ac664f851d9a44f71eb47e2794496ff3a5720f69c337828a8686eb25a"
end
if OS.linux? && Hardware::CPU.intel?
url "https://github.com/tsuru/tsuru-client/releases/download/1.9.4/tsuru_1.9.4_linux_amd64.tar.gz"
sha256 "7535e7f0c159d1435cfff41c1c14d5afa12382480bbfb6a467c09b6d730eaff6"
end
def install
bin.install "tsuru"
bash_completion.install "misc/bash-completion" => "tsuru"
zsh_completion.install "misc/zsh-completion" => "tsuru"
end
end
|
require "formula"
class Tutum < Formula
homepage "https://www.tutum.co/"
url "https://github.com/tutumcloud/tutum-cli/archive/0.10.1.tar.gz"
sha1 "3fce5453dd1dcc2879f0881a8281d3dcf132c187"
bottle do
cellar :any
sha1 "e08f3c6648f97530e17dabc6adaedb46850570ca" => :yosemite
sha1 "6fd1d204d5d308c08df4440e452a18155a2b1bdb" => :mavericks
sha1 "f5f71249db2fd3f5ca8cdd4f970039a85013d51c" => :mountain_lion
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libyaml"
resource "pyyaml" do
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz"
sha1 "476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73"
end
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.4.3.tar.gz"
sha1 "411f1bfa44556f7dd0f34cd822047c31baa7d741"
end
resource "ago" do
url "https://pypi.python.org/packages/source/a/ago/ago-0.0.6.tar.gz"
sha1 "b48b99151370de0c1642748a3f3b206649645d8d"
end
resource "docker-py" do
url "https://pypi.python.org/packages/source/d/docker-py/docker-py-0.5.3.tar.gz"
sha1 "11708a7021e3d0d522e145c057256d7d2acaec07"
end
resource "python-dateutil" do
url "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz"
sha1 "fbafcd19ea0082b3ecb17695b4cb46070181699f"
end
resource "python-tutum" do
url "https://pypi.python.org/packages/source/p/python-tutum/python-tutum-0.10.0.tar.gz"
sha1 "844d2e924a4ecb59a7a7c5887dc2c3448f003908"
end
resource "six" do
url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz"
sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd"
end
resource "tabulate" do
url "https://pypi.python.org/packages/source/t/tabulate/tabulate-0.7.2.tar.gz"
sha1 "da057c6d4faab9847436c3221c98f34911e623df"
end
def install
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", prefix+"lib/python2.7/site-packages"
resources.each do |r|
r.stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
end
system "python", "setup.py", "install", "--prefix=#{prefix}"
rm "#{lib}/python2.7/site-packages/site.py"
rm "#{lib}/python2.7/site-packages/easy-install.pth"
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system "#{bin}/tutum", "container"
end
end
tutum 0.10.5
Closes Homebrew/homebrew#34370.
Signed-off-by: Mike McQuaid <a17fed27eaa842282862ff7c1b9c8395a26ac320@mikemcquaid.com>
require "formula"
class Tutum < Formula
homepage "https://www.tutum.co/"
url "https://github.com/tutumcloud/tutum-cli/archive/v0.10.5.tar.gz"
sha1 "82238e8eba3a69879a523dd348baf9d47d00eba5"
bottle do
cellar :any
sha1 "e08f3c6648f97530e17dabc6adaedb46850570ca" => :yosemite
sha1 "6fd1d204d5d308c08df4440e452a18155a2b1bdb" => :mavericks
sha1 "f5f71249db2fd3f5ca8cdd4f970039a85013d51c" => :mountain_lion
end
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libyaml"
resource "pyyaml" do
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz"
sha1 "476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73"
end
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.4.3.tar.gz"
sha1 "411f1bfa44556f7dd0f34cd822047c31baa7d741"
end
resource "ago" do
url "https://pypi.python.org/packages/source/a/ago/ago-0.0.6.tar.gz"
sha1 "b48b99151370de0c1642748a3f3b206649645d8d"
end
resource "docker-py" do
url "https://pypi.python.org/packages/source/d/docker-py/docker-py-0.5.3.tar.gz"
sha1 "11708a7021e3d0d522e145c057256d7d2acaec07"
end
resource "python-dateutil" do
url "https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz"
sha1 "fbafcd19ea0082b3ecb17695b4cb46070181699f"
end
resource "python-tutum" do
url "https://pypi.python.org/packages/source/p/python-tutum/python-tutum-0.10.5.tar.gz"
sha1 "4e14fd392f69e0efd91f05f7a9dfc257677eb04f"
end
resource "six" do
url "https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz"
sha1 "aa3b0659cbc85c6c7a91efc51f2d1007040070cd"
end
resource "tabulate" do
url "https://pypi.python.org/packages/source/t/tabulate/tabulate-0.7.2.tar.gz"
sha1 "da057c6d4faab9847436c3221c98f34911e623df"
end
def install
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", prefix+"lib/python2.7/site-packages"
resources.each do |r|
r.stage { system "python", "setup.py", "install", "--prefix=#{libexec}" }
end
system "python", "setup.py", "install", "--prefix=#{prefix}"
rm "#{lib}/python2.7/site-packages/site.py"
rm "#{lib}/python2.7/site-packages/easy-install.pth"
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
system "#{bin}/tutum", "container"
end
end
|
class Twarc < Formula
include Language::Python::Virtualenv
desc "Command-line tool and Python library for archiving Twitter JSON"
homepage "https://github.com/DocNow/twarc"
url "https://files.pythonhosted.org/packages/65/33/78a142c960c38e986c1d4aeb4206fbd57ac09f83c25638cfcb4ba0751e91/twarc-2.0.3.tar.gz"
sha256 "fe29e0740f207768ba99c5e794479d300ad25b90d4c3de48cbbba8e4759acf2e"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "20c9920d4eb9e7ff0a19c13cb01b055a8ef68ad20dec38207915fa9606b72785"
sha256 cellar: :any_skip_relocation, big_sur: "46cc1302f38f11db9f0ace0ed15b6bb3092664f8e0584a76f2cecea136512f59"
sha256 cellar: :any_skip_relocation, catalina: "6029b15cd6fe4c27ed0cbe21aea2168e4837e694eddce660137987397c491e7e"
sha256 cellar: :any_skip_relocation, mojave: "8b41c8ebf75a7db33fb0ace941d9238c7b4061789a138abaaf12fdd7a5aefd0e"
end
depends_on "python@3.9"
resource "certifi" do
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz"
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz"
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
end
resource "click" do
url "https://files.pythonhosted.org/packages/27/6f/be940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e/click-7.1.2.tar.gz"
sha256 "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"
end
resource "click-config-file" do
url "https://files.pythonhosted.org/packages/13/09/dfee76b0d2600ae8bd65e9cc375b6de62f6ad5600616a78ee6209a9f17f3/click_config_file-0.6.0.tar.gz"
sha256 "ded6ec1a73c41280727ec9c06031e929cdd8a5946bf0f99c0c3db3a71793d515"
end
resource "click-plugins" do
url "https://files.pythonhosted.org/packages/5f/1d/45434f64ed749540af821fd7e42b8e4d23ac04b1eda7c26613288d6cd8a8/click-plugins-1.1.1.tar.gz"
sha256 "46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b"
end
resource "configobj" do
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/fc/c7/829c73c64d3749da7811c06319458e47f3461944da9d98bb4df1cb1598c2/oauthlib-3.1.0.tar.gz"
sha256 "bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/6b/47/c14abc08432ab22dc18b9892252efaf005ab44066de871e72a38d6af464b/requests-2.25.1.tar.gz"
sha256 "27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/23/eb/68fc8fa86e0f5789832f275c8289257d8dc44dbe93fce7ff819112b9df8f/requests-oauthlib-1.3.0.tar.gz"
sha256 "b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/cb/cf/871177f1fc795c6c10787bc0e1f27bb6cf7b81dbde399fd35860472cecbc/urllib3-1.26.4.tar.gz"
sha256 "e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937"
end
def install
virtualenv_install_with_resources
end
test do
assert_equal "usage: twarc [-h] [--log LOG] [--consumer_key CONSUMER_KEY]",
shell_output("#{bin}/twarc -h").chomp.split("\n").first
end
end
twarc: update 2.0.3 bottle.
class Twarc < Formula
include Language::Python::Virtualenv
desc "Command-line tool and Python library for archiving Twitter JSON"
homepage "https://github.com/DocNow/twarc"
url "https://files.pythonhosted.org/packages/65/33/78a142c960c38e986c1d4aeb4206fbd57ac09f83c25638cfcb4ba0751e91/twarc-2.0.3.tar.gz"
sha256 "fe29e0740f207768ba99c5e794479d300ad25b90d4c3de48cbbba8e4759acf2e"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "20c9920d4eb9e7ff0a19c13cb01b055a8ef68ad20dec38207915fa9606b72785"
sha256 cellar: :any_skip_relocation, big_sur: "46cc1302f38f11db9f0ace0ed15b6bb3092664f8e0584a76f2cecea136512f59"
sha256 cellar: :any_skip_relocation, catalina: "6029b15cd6fe4c27ed0cbe21aea2168e4837e694eddce660137987397c491e7e"
sha256 cellar: :any_skip_relocation, mojave: "8b41c8ebf75a7db33fb0ace941d9238c7b4061789a138abaaf12fdd7a5aefd0e"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1e860ce1bb55330bacf34bfb9576153776ce26c5c16a8daddbb3451769491074"
end
depends_on "python@3.9"
resource "certifi" do
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz"
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz"
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
end
resource "click" do
url "https://files.pythonhosted.org/packages/27/6f/be940c8b1f1d69daceeb0032fee6c34d7bd70e3e649ccac0951500b4720e/click-7.1.2.tar.gz"
sha256 "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"
end
resource "click-config-file" do
url "https://files.pythonhosted.org/packages/13/09/dfee76b0d2600ae8bd65e9cc375b6de62f6ad5600616a78ee6209a9f17f3/click_config_file-0.6.0.tar.gz"
sha256 "ded6ec1a73c41280727ec9c06031e929cdd8a5946bf0f99c0c3db3a71793d515"
end
resource "click-plugins" do
url "https://files.pythonhosted.org/packages/5f/1d/45434f64ed749540af821fd7e42b8e4d23ac04b1eda7c26613288d6cd8a8/click-plugins-1.1.1.tar.gz"
sha256 "46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b"
end
resource "configobj" do
url "https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz"
sha256 "a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/fc/c7/829c73c64d3749da7811c06319458e47f3461944da9d98bb4df1cb1598c2/oauthlib-3.1.0.tar.gz"
sha256 "bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/6b/47/c14abc08432ab22dc18b9892252efaf005ab44066de871e72a38d6af464b/requests-2.25.1.tar.gz"
sha256 "27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/23/eb/68fc8fa86e0f5789832f275c8289257d8dc44dbe93fce7ff819112b9df8f/requests-oauthlib-1.3.0.tar.gz"
sha256 "b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/cb/cf/871177f1fc795c6c10787bc0e1f27bb6cf7b81dbde399fd35860472cecbc/urllib3-1.26.4.tar.gz"
sha256 "e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937"
end
def install
virtualenv_install_with_resources
end
test do
assert_equal "usage: twarc [-h] [--log LOG] [--consumer_key CONSUMER_KEY]",
shell_output("#{bin}/twarc -h").chomp.split("\n").first
end
end
|
class Twarc < Formula
include Language::Python::Virtualenv
desc "Command-line tool and Python library for archiving Twitter JSON"
homepage "https://github.com/DocNow/twarc"
url "https://files.pythonhosted.org/packages/48/0f/b0491173d98d7c0093d3ad912b281f6fefccfcd59b268b2e67581ca08434/twarc-1.10.1.tar.gz"
sha256 "db8d6f5fc4d786d9af3f9ca622e4e83175a34e93bda756923e5d6c546bca6c3e"
license "MIT"
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "74c4def26e79e513331d2a7aa2fd6c7edc115ca06124545707abd8f2d3031b98" => :catalina
sha256 "f219ea9b791a7700a3bbfdb4f57830af517f13942c004a5b1a962ebc80aecb69" => :mojave
sha256 "8a845fe5b8a179c99eca6df8ae3d14665ec7c705b3cd4b7dff8a9b8c61df54e8" => :high_sierra
end
depends_on "python@3.8"
resource "attrs" do
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/40/a7/ded59fa294b85ca206082306bba75469a38ea1c7d44ea7e1d64f5443d67a/certifi-2020.6.20.tar.gz"
sha256 "5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
end
resource "more-itertools" do
url "https://files.pythonhosted.org/packages/67/4a/16cb3acf64709eb0164e49ba463a42dc45366995848c4f0cf770f57b8120/more-itertools-8.4.0.tar.gz"
sha256 "68c70cc7167bdf5c7c9d8f6954a7837089c6a36bf565383919bb595efb8a17e5"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/fc/c7/829c73c64d3749da7811c06319458e47f3461944da9d98bb4df1cb1598c2/oauthlib-3.1.0.tar.gz"
sha256 "bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz"
sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"
end
resource "pluggy" do
url "https://files.pythonhosted.org/packages/f8/04/7a8542bed4b16a65c2714bf76cf5a0b026157da7f75e87cc88774aa10b14/pluggy-0.13.1.tar.gz"
sha256 "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"
end
resource "py" do
url "https://files.pythonhosted.org/packages/97/a6/ab9183fe08f69a53d06ac0ee8432bc0ffbb3989c575cc69b73a0229a9a99/py-1.9.0.tar.gz"
sha256 "9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz"
sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"
end
resource "pytest" do
url "https://files.pythonhosted.org/packages/8f/c4/e4a645f8a3d6c6993cb3934ee593e705947dfafad4ca5148b9a0fde7359c/pytest-5.4.3.tar.gz"
sha256 "7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/da/67/672b422d9daf07365259958912ba533a0ecab839d4084c487a5fe9a5405f/requests-2.24.0.tar.gz"
sha256 "b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/23/eb/68fc8fa86e0f5789832f275c8289257d8dc44dbe93fce7ff819112b9df8f/requests-oauthlib-1.3.0.tar.gz"
sha256 "b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/05/8c/40cd6949373e23081b3ea20d5594ae523e681b6f472e600fbc95ed046a36/urllib3-1.25.9.tar.gz"
sha256 "3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
end
def install
virtualenv_install_with_resources
end
test do
assert_equal "usage: twarc [-h] [--log LOG] [--consumer_key CONSUMER_KEY]",
shell_output("#{bin}/twarc -h").chomp.split("\n").first
end
end
twarc: migrate to python@3.9
Closes #62446.
Signed-off-by: Dustin Rodrigues <bb8ef414f2e67efe7ad38cfa83d7e2ec855def2b@gmail.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Twarc < Formula
include Language::Python::Virtualenv
desc "Command-line tool and Python library for archiving Twitter JSON"
homepage "https://github.com/DocNow/twarc"
url "https://files.pythonhosted.org/packages/48/0f/b0491173d98d7c0093d3ad912b281f6fefccfcd59b268b2e67581ca08434/twarc-1.10.1.tar.gz"
sha256 "db8d6f5fc4d786d9af3f9ca622e4e83175a34e93bda756923e5d6c546bca6c3e"
license "MIT"
revision 1
livecheck do
url :stable
end
bottle do
cellar :any_skip_relocation
sha256 "74c4def26e79e513331d2a7aa2fd6c7edc115ca06124545707abd8f2d3031b98" => :catalina
sha256 "f219ea9b791a7700a3bbfdb4f57830af517f13942c004a5b1a962ebc80aecb69" => :mojave
sha256 "8a845fe5b8a179c99eca6df8ae3d14665ec7c705b3cd4b7dff8a9b8c61df54e8" => :high_sierra
end
depends_on "python@3.9"
resource "attrs" do
url "https://files.pythonhosted.org/packages/98/c3/2c227e66b5e896e15ccdae2e00bbc69aa46e9a8ce8869cc5fa96310bf612/attrs-19.3.0.tar.gz"
sha256 "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/40/a7/ded59fa294b85ca206082306bba75469a38ea1c7d44ea7e1d64f5443d67a/certifi-2020.6.20.tar.gz"
sha256 "5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"
end
resource "chardet" do
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
end
resource "more-itertools" do
url "https://files.pythonhosted.org/packages/67/4a/16cb3acf64709eb0164e49ba463a42dc45366995848c4f0cf770f57b8120/more-itertools-8.4.0.tar.gz"
sha256 "68c70cc7167bdf5c7c9d8f6954a7837089c6a36bf565383919bb595efb8a17e5"
end
resource "oauthlib" do
url "https://files.pythonhosted.org/packages/fc/c7/829c73c64d3749da7811c06319458e47f3461944da9d98bb4df1cb1598c2/oauthlib-3.1.0.tar.gz"
sha256 "bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/55/fd/fc1aca9cf51ed2f2c11748fa797370027babd82f87829c7a8e6dbe720145/packaging-20.4.tar.gz"
sha256 "4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8"
end
resource "pluggy" do
url "https://files.pythonhosted.org/packages/f8/04/7a8542bed4b16a65c2714bf76cf5a0b026157da7f75e87cc88774aa10b14/pluggy-0.13.1.tar.gz"
sha256 "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"
end
resource "py" do
url "https://files.pythonhosted.org/packages/97/a6/ab9183fe08f69a53d06ac0ee8432bc0ffbb3989c575cc69b73a0229a9a99/py-1.9.0.tar.gz"
sha256 "9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/c1/47/dfc9c342c9842bbe0036c7f763d2d6686bcf5eb1808ba3e170afdb282210/pyparsing-2.4.7.tar.gz"
sha256 "c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"
end
resource "pytest" do
url "https://files.pythonhosted.org/packages/8f/c4/e4a645f8a3d6c6993cb3934ee593e705947dfafad4ca5148b9a0fde7359c/pytest-5.4.3.tar.gz"
sha256 "7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"
end
resource "python-dateutil" do
url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz"
sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/da/67/672b422d9daf07365259958912ba533a0ecab839d4084c487a5fe9a5405f/requests-2.24.0.tar.gz"
sha256 "b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b"
end
resource "requests-oauthlib" do
url "https://files.pythonhosted.org/packages/23/eb/68fc8fa86e0f5789832f275c8289257d8dc44dbe93fce7ff819112b9df8f/requests-oauthlib-1.3.0.tar.gz"
sha256 "b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a"
end
resource "six" do
url "https://files.pythonhosted.org/packages/6b/34/415834bfdafca3c5f451532e8a8d9ba89a21c9743a0c59fbd0205c7f9426/six-1.15.0.tar.gz"
sha256 "30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/05/8c/40cd6949373e23081b3ea20d5594ae523e681b6f472e600fbc95ed046a36/urllib3-1.25.9.tar.gz"
sha256 "3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
end
def install
virtualenv_install_with_resources
end
test do
assert_equal "usage: twarc [-h] [--log LOG] [--consumer_key CONSUMER_KEY]",
shell_output("#{bin}/twarc -h").chomp.split("\n").first
end
end
|
#
# Cookbook Name:: memcached
# Definition:: memcached_instance
#
# Copyright 2009-2013, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
define :memcached_instance do
include_recipe 'runit'
include_recipe 'memcached::package'
instance_name = params[:name] == 'memcached' ? 'memcached' : "memcached-#{params[:name]}"
opts = params
runit_service instance_name do
run_template_name 'memcached'
default_logger true
cookbook 'memcached'
options({
:memory => node['memcached']['memory'],
:port => node['memcached']['port'],
:udp_port => node['memcached']['udp_port'],
:listen => node['memcached']['listen'],
:maxconn => node['memcached']['maxconn'],
:user => node['memcached']['user'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size'],
:experimental_options => Array(node['memcached']['experimental_options']),
:ulimit => node['memcached']['ulimit']
}.merge(opts))
end
end
add conditional logic for unspecified runit_service instance name
#
# Cookbook Name:: memcached
# Definition:: memcached_instance
#
# Copyright 2009-2013, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
define :memcached_instance do
include_recipe 'runit'
include_recipe 'memcached::package'
instance_name = params[:name] == 'memcached' || params[:name] == nil ? 'memcached' : "memcached-#{params[:name]}"
opts = params
runit_service instance_name do
run_template_name 'memcached'
default_logger true
cookbook 'memcached'
options({
:memory => node['memcached']['memory'],
:port => node['memcached']['port'],
:udp_port => node['memcached']['udp_port'],
:listen => node['memcached']['listen'],
:maxconn => node['memcached']['maxconn'],
:user => node['memcached']['user'],
:threads => node['memcached']['threads'],
:max_object_size => node['memcached']['max_object_size'],
:experimental_options => Array(node['memcached']['experimental_options']),
:ulimit => node['memcached']['ulimit']
}.merge(opts))
end
end
|
require 'formula'
class Ufraw < Formula
url 'http://sourceforge.net/project/downloading.php?group_id=127649&filename=ufraw-0.18.tar.gz'
homepage 'http://ufraw.sourceforge.net'
sha1 '41c9ad7aa7f1cbb63a6b0b330b3599b18a7e8cd2'
depends_on 'pkg-config' => :build
depends_on 'glib'
depends_on 'libtiff'
depends_on ':libpng'
depends_on 'jpeg'
depends_on 'little-cms'
depends_on 'dcraw'
depends_on 'exiv2' => :optional
fails_with :llvm do
cause "Segfault while linking"
end
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--without-gtk",
"--without-gimp"
system "make install"
(share+'pixmaps').rmtree
end
end
ufraw: oops
require 'formula'
class Ufraw < Formula
url 'http://sourceforge.net/project/downloading.php?group_id=127649&filename=ufraw-0.18.tar.gz'
homepage 'http://ufraw.sourceforge.net'
sha1 '41c9ad7aa7f1cbb63a6b0b330b3599b18a7e8cd2'
depends_on 'pkg-config' => :build
depends_on :libpng
depends_on 'glib'
depends_on 'libtiff'
depends_on 'jpeg'
depends_on 'little-cms'
depends_on 'dcraw'
depends_on 'exiv2' => :optional
fails_with :llvm do
cause "Segfault while linking"
end
def install
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--without-gtk",
"--without-gimp"
system "make install"
(share+'pixmaps').rmtree
end
end
|
class Ugrep < Formula
desc "Ultra fast grep with query UI, fuzzy search, archive search, and more"
homepage "https://github.com/Genivia/ugrep"
url "https://github.com/Genivia/ugrep/archive/v3.3.10.tar.gz"
sha256 "8cf74bdf254bac78c19385028bbf8678d83be35522d452b71d16105a1c4c57b8"
license "BSD-3-Clause"
bottle do
sha256 arm64_monterey: "1a1a330e8ddbcad040ee6e27feec14c3a764f487c2ba05820690384eec77d4eb"
sha256 arm64_big_sur: "fd513b88aaa6f285a97555491fea561598f07b6f4b59b5b7411dce853f20f134"
sha256 monterey: "6b4f045a46ceb962f0121861d701734105f27546f3d3f2b795499fabcace5191"
sha256 big_sur: "a85c9166990bd812d422ff845a72a988a08529f45f8648e41c6e9d01116fd65a"
sha256 catalina: "177f51f0afdb20f2f46c41c00b8c850461847b7be99e748427c890da7eddfeba"
sha256 x86_64_linux: "8f538e1a53fc84dbd8edc1dbc103226dc14b36355a55271313b40584703f3346"
end
depends_on "pcre2"
depends_on "xz"
def install
system "./configure", "--enable-color",
"--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"Hello.txt").write("Hello World!")
assert_match "Hello World!", shell_output("#{bin}/ug 'Hello' '#{testpath}'").strip
assert_match "Hello World!", shell_output("#{bin}/ugrep 'World' '#{testpath}'").strip
end
end
ugrep: update 3.3.10 bottle.
class Ugrep < Formula
desc "Ultra fast grep with query UI, fuzzy search, archive search, and more"
homepage "https://github.com/Genivia/ugrep"
url "https://github.com/Genivia/ugrep/archive/v3.3.10.tar.gz"
sha256 "8cf74bdf254bac78c19385028bbf8678d83be35522d452b71d16105a1c4c57b8"
license "BSD-3-Clause"
bottle do
sha256 arm64_monterey: "2eb2df68d4134b1ab9e7bdc0662844d854da621da256e53213402f419547883c"
sha256 arm64_big_sur: "151167f433748abda7992e759dd07aefda5c2c9ab0e9921daaeb3a508bcf2267"
sha256 monterey: "2b89a817d6a760436998ed2d578d4bf8090fbde88de8665af98a3c1025d806b5"
sha256 big_sur: "96b6ca0c6d8d6e9d2811fa6a2229a40827f3ebf92c49b826fb671dfe8a6dedf0"
sha256 catalina: "e0f8a1abca264599e956af69bca6b377f48658935b59019ccd51c42517744542"
sha256 x86_64_linux: "ec4512276c6b9556c34baa373226ddbe4719588a6129d164101c4f1244503dcb"
end
depends_on "pcre2"
depends_on "xz"
def install
system "./configure", "--enable-color",
"--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"Hello.txt").write("Hello World!")
assert_match "Hello World!", shell_output("#{bin}/ug 'Hello' '#{testpath}'").strip
assert_match "Hello World!", shell_output("#{bin}/ugrep 'World' '#{testpath}'").strip
end
end
|
class Ugrep < Formula
desc "Ultra fast grep with query UI, fuzzy search, archive search, and more"
homepage "https://github.com/Genivia/ugrep"
url "https://github.com/Genivia/ugrep/archive/v3.2.1.tar.gz"
sha256 "a377b399227296caeca3e1b8945fcfc12001e78ad735f9d3d63d8015082608ee"
license "BSD-3-Clause"
bottle do
sha256 arm64_big_sur: "546c74a1c439123708de875c4da6ec666e3b9dbab6a7883cdfb9f531f4e12e10"
sha256 big_sur: "d75fb14835454d870a8dc52b51028e42d9983f887f3df0a78ba0d5a09cf9b569"
sha256 catalina: "fbeb23f7a09bacf3ae75faa4a0e5e77e25d5fd4b1a834128543e018cf4e26593"
sha256 mojave: "17f241f53694094870131b21e8a848e5ffee7231e61c533ca117146d8d5f46bc"
end
depends_on "pcre2"
depends_on "xz"
def install
system "./configure", "--enable-color",
"--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"Hello.txt").write("Hello World!")
assert_match "Hello World!", shell_output("#{bin}/ug 'Hello' '#{testpath}'").strip
assert_match "Hello World!", shell_output("#{bin}/ugrep 'World' '#{testpath}'").strip
end
end
ugrep 3.2.2
Closes #77169.
Signed-off-by: Nanda H Krishna <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@nandahkrishna.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Ugrep < Formula
desc "Ultra fast grep with query UI, fuzzy search, archive search, and more"
homepage "https://github.com/Genivia/ugrep"
url "https://github.com/Genivia/ugrep/archive/v3.2.2.tar.gz"
sha256 "daedcb76da090b46e98cd5dc2b8785b6dccfe28d80e1fd4b1076b4c251f7244d"
license "BSD-3-Clause"
bottle do
sha256 arm64_big_sur: "546c74a1c439123708de875c4da6ec666e3b9dbab6a7883cdfb9f531f4e12e10"
sha256 big_sur: "d75fb14835454d870a8dc52b51028e42d9983f887f3df0a78ba0d5a09cf9b569"
sha256 catalina: "fbeb23f7a09bacf3ae75faa4a0e5e77e25d5fd4b1a834128543e018cf4e26593"
sha256 mojave: "17f241f53694094870131b21e8a848e5ffee7231e61c533ca117146d8d5f46bc"
end
depends_on "pcre2"
depends_on "xz"
def install
system "./configure", "--enable-color",
"--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"Hello.txt").write("Hello World!")
assert_match "Hello World!", shell_output("#{bin}/ug 'Hello' '#{testpath}'").strip
assert_match "Hello World!", shell_output("#{bin}/ugrep 'World' '#{testpath}'").strip
end
end
|
require "language/node"
class Ungit < Formula
desc "The easiest way to use git. On any platform. Anywhere"
homepage "https://github.com/FredrikNoren/ungit"
url "https://registry.npmjs.org/ungit/-/ungit-1.4.46.tgz"
sha256 "cbb177f1f45276894daa1d2580535c29b8adeaedc5c0dfc2af9ec3e9cd2813f7"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "107c230eec3615678b6640184c5156236850de4ff3b82b19ca559f92f65a54d9" => :mojave
sha256 "a7e0c6abeb515541ef76cdeea81e516f628be258cc1cc55876f25f07566c0aa1" => :high_sierra
sha256 "773b35dec90a13ba957acad35b882321e2e747e4671006fc81f63c5a8c7af163" => :sierra
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
begin
require "nokogiri"
pid = fork do
exec bin/"ungit", "--no-launchBrowser", "--autoShutdownTimeout", "5000" # give it an idle timeout to make it exit
end
sleep 5
assert_match "ungit", Nokogiri::HTML(shell_output("curl -s 127.0.0.1:8448/")).at_css("title").text
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
ungit 1.4.47
Closes #44322.
Signed-off-by: FX Coudert <c329953660db96eae534be5bbf1a735c2baf69b5@gmail.com>
require "language/node"
class Ungit < Formula
desc "The easiest way to use git. On any platform. Anywhere"
homepage "https://github.com/FredrikNoren/ungit"
url "https://registry.npmjs.org/ungit/-/ungit-1.4.47.tgz"
sha256 "be09b1210dbd221e2df1545ba6f3f90607609dcd4f816acd10128f7b97142f24"
bottle do
cellar :any_skip_relocation
rebuild 1
sha256 "107c230eec3615678b6640184c5156236850de4ff3b82b19ca559f92f65a54d9" => :mojave
sha256 "a7e0c6abeb515541ef76cdeea81e516f628be258cc1cc55876f25f07566c0aa1" => :high_sierra
sha256 "773b35dec90a13ba957acad35b882321e2e747e4671006fc81f63c5a8c7af163" => :sierra
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
begin
require "nokogiri"
pid = fork do
exec bin/"ungit", "--no-launchBrowser", "--autoShutdownTimeout", "5000" # give it an idle timeout to make it exit
end
sleep 5
assert_match "ungit", Nokogiri::HTML(shell_output("curl -s 127.0.0.1:8448/")).at_css("title").text
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
require "language/node"
class Ungit < Formula
desc "The easiest way to use git. On any platform. Anywhere"
homepage "https://github.com/FredrikNoren/ungit"
url "https://registry.npmjs.org/ungit/-/ungit-1.4.46.tgz"
sha256 "cbb177f1f45276894daa1d2580535c29b8adeaedc5c0dfc2af9ec3e9cd2813f7"
bottle do
cellar :any_skip_relocation
sha256 "309b81a817280d6219cdaa460c2919deb3163faed9f42c3500280f020397a613" => :mojave
sha256 "07f0ba12becf748cdd02a64c5d2059f4e130f24452b45963c59234fc8ad257bc" => :high_sierra
sha256 "ee792bbbc4ac5ed8508e0c75ccd1be5cc3c6647e3a6194f2bc0dd997139b2686" => :sierra
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
begin
require "nokogiri"
pid = fork do
exec bin/"ungit", "--no-launchBrowser", "--autoShutdownTimeout", "5000" # give it an idle timeout to make it exit
end
sleep 3
assert_match "ungit", Nokogiri::HTML(shell_output("curl -s 127.0.0.1:8448/")).at_css("title").text
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
ungit: fix flaky test
Closes #42352.
Signed-off-by: Chongyu Zhu <042dc4512fa3d391c5170cf3aa61e6a638f84342@lembacon.com>
require "language/node"
class Ungit < Formula
desc "The easiest way to use git. On any platform. Anywhere"
homepage "https://github.com/FredrikNoren/ungit"
url "https://registry.npmjs.org/ungit/-/ungit-1.4.46.tgz"
sha256 "cbb177f1f45276894daa1d2580535c29b8adeaedc5c0dfc2af9ec3e9cd2813f7"
bottle do
cellar :any_skip_relocation
sha256 "309b81a817280d6219cdaa460c2919deb3163faed9f42c3500280f020397a613" => :mojave
sha256 "07f0ba12becf748cdd02a64c5d2059f4e130f24452b45963c59234fc8ad257bc" => :high_sierra
sha256 "ee792bbbc4ac5ed8508e0c75ccd1be5cc3c6647e3a6194f2bc0dd997139b2686" => :sierra
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
begin
require "nokogiri"
pid = fork do
exec bin/"ungit", "--no-launchBrowser", "--autoShutdownTimeout", "5000" # give it an idle timeout to make it exit
end
sleep 5
assert_match "ungit", Nokogiri::HTML(shell_output("curl -s 127.0.0.1:8448/")).at_css("title").text
ensure
Process.kill("TERM", pid)
Process.wait(pid)
end
end
end
|
# Please don't update this formula until the release is official via
# mailing list or blog post. There's a history of GitHub tags moving around.
# https://github.com/hashicorp/vault/issues/1051
class Vault < Formula
desc "Secures, stores, and tightly controls access to secrets"
homepage "https://vaultproject.io/"
url "https://github.com/hashicorp/vault.git",
tag: "v1.9.4",
revision: "fcbe948b2542a13ee8036ad07dd8ebf8554f56cb"
license "MPL-2.0"
head "https://github.com/hashicorp/vault.git", branch: "main"
livecheck do
url "https://releases.hashicorp.com/vault/"
regex(%r{href=.*?v?(\d+(?:\.\d+)+)/?["' >]}i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "4af8849bfb883c6709303e2f477bbf8118f7a610cb5a0588c6cdbefc77fe78aa"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "5873ce31a62c522bd87473dc52b896c98437fb8dc0c013b9e50de52d6dacc0a2"
sha256 cellar: :any_skip_relocation, monterey: "8e3641a34533f592e7766e76236113d47f96343a9eac94159d445560ba029904"
sha256 cellar: :any_skip_relocation, big_sur: "e9bbdf0d41dc238b40bb97fcee7d4d7626225d6c0aeb8620654c43fc0a452c4f"
sha256 cellar: :any_skip_relocation, catalina: "904390bafeb870c90cc66989e346b85b1ccae9871835fc3de8643e0c75076d7d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "9c6c56c8c8651fc682b696516da9c612531a3a5aca2752e75a31867c62ce0be8"
end
depends_on "go" => :build
depends_on "gox" => :build
# Cannot build with `node` while upstream depends on node-sass<6
depends_on "node@14" => :build
depends_on "yarn" => :build
def install
ENV.prepend_path "PATH", "#{ENV["GOPATH"]}/bin"
system "make", "bootstrap", "static-dist", "dev-ui"
bin.install "bin/vault"
end
service do
run [opt_bin/"vault", "server", "-dev"]
keep_alive true
working_dir var
log_path var/"log/vault.log"
error_log_path var/"log/vault.log"
end
test do
port = free_port
ENV["VAULT_DEV_LISTEN_ADDRESS"] = "127.0.0.1:#{port}"
ENV["VAULT_ADDR"] = "http://127.0.0.1:#{port}"
pid = fork { exec bin/"vault", "server", "-dev" }
sleep 5
system bin/"vault", "status"
Process.kill("TERM", pid)
end
end
vault: update 1.9.4 bottle.
# Please don't update this formula until the release is official via
# mailing list or blog post. There's a history of GitHub tags moving around.
# https://github.com/hashicorp/vault/issues/1051
class Vault < Formula
desc "Secures, stores, and tightly controls access to secrets"
homepage "https://vaultproject.io/"
url "https://github.com/hashicorp/vault.git",
tag: "v1.9.4",
revision: "fcbe948b2542a13ee8036ad07dd8ebf8554f56cb"
license "MPL-2.0"
head "https://github.com/hashicorp/vault.git", branch: "main"
livecheck do
url "https://releases.hashicorp.com/vault/"
regex(%r{href=.*?v?(\d+(?:\.\d+)+)/?["' >]}i)
end
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "bd093e6cc7f7c4185282a92d0844c0aa8527b3fcbff8ad9dda0f1f1259e19a00"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "e9f940a6c66cf751145ac8f35918653c2c76e1dc100bdd94f12a7a52e1842787"
sha256 cellar: :any_skip_relocation, monterey: "0e71de8e8d51257df8d55545d6c9b602f08cbc8b95e8f7c0b5eed176a0b7ea4b"
sha256 cellar: :any_skip_relocation, big_sur: "ccaa1a533d4a805f2e53ad5fc392a36e9814cafe5691ae921e2c421fd853fdd2"
sha256 cellar: :any_skip_relocation, catalina: "4200322afc0841b0a4e7c8b789f6913424a90e1c8e9952595671aac6445a8c72"
sha256 cellar: :any_skip_relocation, x86_64_linux: "c6c1a950343a5130c50d557804f6340ff7eec1c1cd49831f716bc81ff45127bd"
end
depends_on "go" => :build
depends_on "gox" => :build
# Cannot build with `node` while upstream depends on node-sass<6
depends_on "node@14" => :build
depends_on "yarn" => :build
def install
ENV.prepend_path "PATH", "#{ENV["GOPATH"]}/bin"
system "make", "bootstrap", "static-dist", "dev-ui"
bin.install "bin/vault"
end
service do
run [opt_bin/"vault", "server", "-dev"]
keep_alive true
working_dir var
log_path var/"log/vault.log"
error_log_path var/"log/vault.log"
end
test do
port = free_port
ENV["VAULT_DEV_LISTEN_ADDRESS"] = "127.0.0.1:#{port}"
ENV["VAULT_ADDR"] = "http://127.0.0.1:#{port}"
pid = fork { exec bin/"vault", "server", "-dev" }
sleep 5
system bin/"vault", "status"
Process.kill("TERM", pid)
end
end
|
class Viddy < Formula
desc "Modern watch command"
homepage "https://github.com/sachaos/viddy"
url "https://github.com/sachaos/viddy/archive/refs/tags/v0.3.2.tar.gz"
sha256 "441e057fb3e9ad75f034123ef023ff92eece67fe01d52745825f0c3c2ba89088"
license "MIT"
head "https://github.com/sachaos/viddy.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "94203d619dfa11db244cefeea6407b657809ad1758b2b9b9edec988c02ad775c"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7ed75fb4678c69f4b17e60b3f7d5d79062f9842d407065c5b8eea2f45408cb46"
sha256 cellar: :any_skip_relocation, monterey: "35004a320ef6ab389a7172546f4b99e56474868fd4cca70a89d39c4b008be374"
sha256 cellar: :any_skip_relocation, big_sur: "42683c3e7bbb2f3b9d9d17e48375ce6672a8b365f3a94f8c833e5058337c33a4"
sha256 cellar: :any_skip_relocation, catalina: "b904656d10800778f242c860c550d5da3508a51d735702c1f779dfc2f3b657ca"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41afacff33d7f52feda350cfbffe22634cd903e7c141ac8277933d47746417b7"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=v#{version}")
end
test do
on_linux do
# Errno::EIO: Input/output error @ io_fread - /dev/pts/0
return if ENV["HOMEBREW_GITHUB_ACTIONS"]
end
ENV["TERM"] = "xterm"
require "pty"
r, _, pid = PTY.spawn "#{bin}/viddy echo hello"
sleep 1
Process.kill "SIGINT", pid
assert_includes r.read, "Every"
assert_equal 0, $CHILD_STATUS.exitstatus
end
end
viddy 0.3.3
Closes #89263.
Signed-off-by: Sean Molenaar <2b250e3fea88cfef248b497ad5fc17f7dc435154@users.noreply.github.com>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Viddy < Formula
desc "Modern watch command"
homepage "https://github.com/sachaos/viddy"
url "https://github.com/sachaos/viddy/archive/refs/tags/v0.3.3.tar.gz"
sha256 "459d3ea43436b523e654f1f60356ef3150606ed17ca88895f54b7ee5999292a1"
license "MIT"
head "https://github.com/sachaos/viddy.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "94203d619dfa11db244cefeea6407b657809ad1758b2b9b9edec988c02ad775c"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7ed75fb4678c69f4b17e60b3f7d5d79062f9842d407065c5b8eea2f45408cb46"
sha256 cellar: :any_skip_relocation, monterey: "35004a320ef6ab389a7172546f4b99e56474868fd4cca70a89d39c4b008be374"
sha256 cellar: :any_skip_relocation, big_sur: "42683c3e7bbb2f3b9d9d17e48375ce6672a8b365f3a94f8c833e5058337c33a4"
sha256 cellar: :any_skip_relocation, catalina: "b904656d10800778f242c860c550d5da3508a51d735702c1f779dfc2f3b657ca"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41afacff33d7f52feda350cfbffe22634cd903e7c141ac8277933d47746417b7"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=v#{version}")
end
test do
on_linux do
# Errno::EIO: Input/output error @ io_fread - /dev/pts/0
return if ENV["HOMEBREW_GITHUB_ACTIONS"]
end
ENV["TERM"] = "xterm"
require "pty"
r, _, pid = PTY.spawn "#{bin}/viddy echo hello"
sleep 1
Process.kill "SIGINT", pid
assert_includes r.read, "Every"
assert_equal 0, $CHILD_STATUS.exitstatus
end
end
|
class Vultr < Formula
desc "Command-line tool for Vultr"
homepage "https://jamesclonk.github.io/vultr"
url "https://github.com/JamesClonk/vultr/archive/v2.0.1.tar.gz"
sha256 "928f6c3caf8149f836a609ec43a3d031f0206a8cba095e026535c33c390c1157"
head "https://github.com/JamesClonk/vultr.git"
bottle do
cellar :any_skip_relocation
sha256 "af7d3754f0136c4ed3f0067920c0351931df48f487457ba6f12741e745e636e4" => :mojave
sha256 "9384a5df861603c74301e8500d70c170f806348fbfdf5117b1c6d91bed7d26d2" => :high_sierra
sha256 "a49908fc98bd2c2e2322e1d9511352ece67dbedc02879c71811d82b7c9bdaa3e" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/JamesClonk").mkpath
ln_s buildpath, buildpath/"src/github.com/JamesClonk/vultr"
system "go", "build", "-o", bin/"vultr"
end
test do
system bin/"vultr", "version"
end
end
vultr: update 2.0.1 bottle.
class Vultr < Formula
desc "Command-line tool for Vultr"
homepage "https://jamesclonk.github.io/vultr"
url "https://github.com/JamesClonk/vultr/archive/v2.0.1.tar.gz"
sha256 "928f6c3caf8149f836a609ec43a3d031f0206a8cba095e026535c33c390c1157"
head "https://github.com/JamesClonk/vultr.git"
bottle do
cellar :any_skip_relocation
sha256 "11edd7b69bd41bf11ceab87cc0353305612887f53ed2429ffe7034c0179f4dd5" => :catalina
sha256 "af7d3754f0136c4ed3f0067920c0351931df48f487457ba6f12741e745e636e4" => :mojave
sha256 "9384a5df861603c74301e8500d70c170f806348fbfdf5117b1c6d91bed7d26d2" => :high_sierra
sha256 "a49908fc98bd2c2e2322e1d9511352ece67dbedc02879c71811d82b7c9bdaa3e" => :sierra
end
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/JamesClonk").mkpath
ln_s buildpath, buildpath/"src/github.com/JamesClonk/vultr"
system "go", "build", "-o", bin/"vultr"
end
test do
system bin/"vultr", "version"
end
end
|
class Whois < Formula
desc "Lookup tool for domain names and other internet resources"
homepage "https://packages.debian.org/sid/whois"
url "https://deb.debian.org/debian/pool/main/w/whois/whois_5.4.1.tar.xz"
sha256 "3ee6591fb14c103791430a8e6eb3d4c38a9f52aad799ea58c94250bd6985ec50"
revision 1
head "https://github.com/rfc1036/whois.git"
bottle do
cellar :any
sha256 "ea946cc40b9785347572dda2b7f62c2e26e45e52e3321e3675344bd3cfd13397" => :mojave
sha256 "0ce754d0d55a28926e7e52d3ed1b68ed6dc4c0cce93c17319471da33e933fcde" => :high_sierra
sha256 "00f07c1b7d94fddfef15e14c58a8f74b1b2313e4ce8c3864dbe68d6151e4a2fa" => :sierra
end
depends_on "pkg-config" => :build
depends_on "libidn2"
def install
ENV.append "LDFLAGS", "-L/usr/lib -liconv"
system "make", "whois", "HAVE_ICONV=1"
bin.install "whois"
man1.install "whois.1"
man5.install "whois.conf.5"
end
def caveats; <<~EOS
Debian whois has been installed as `whois` and may shadow the
system binary of the same name.
EOS
end
test do
system "#{bin}/whois", "brew.sh"
end
end
whois: update 5.4.1_1 bottle.
class Whois < Formula
desc "Lookup tool for domain names and other internet resources"
homepage "https://packages.debian.org/sid/whois"
url "https://deb.debian.org/debian/pool/main/w/whois/whois_5.4.1.tar.xz"
sha256 "3ee6591fb14c103791430a8e6eb3d4c38a9f52aad799ea58c94250bd6985ec50"
revision 1
head "https://github.com/rfc1036/whois.git"
bottle do
cellar :any
sha256 "3ddfaef6c60a75569e15abe0302ab6bc3c681b03a1092ea5c32bc8ab4af89d16" => :mojave
sha256 "44076fd65dbad4824f29d3f4e4257ad1337868f81e009e583e24b351a17bc6ae" => :high_sierra
sha256 "ce9876b716a7f0d3ea4edcfb40159dd2b664b8f0cda0f29b5de0c3ad3ade7bbc" => :sierra
end
depends_on "pkg-config" => :build
depends_on "libidn2"
def install
ENV.append "LDFLAGS", "-L/usr/lib -liconv"
system "make", "whois", "HAVE_ICONV=1"
bin.install "whois"
man1.install "whois.1"
man5.install "whois.conf.5"
end
def caveats; <<~EOS
Debian whois has been installed as `whois` and may shadow the
system binary of the same name.
EOS
end
test do
system "#{bin}/whois", "brew.sh"
end
end
|
require 'formula'
class FrameworkPython < Requirement
fatal true
satisfy do
q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
not q.chomp.empty?
end
def message
"Python needs to be built as a framework."
end
end
class Wxmac < Formula
homepage 'http://www.wxwidgets.org'
url 'http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2'
sha1 '9183b2ffc6631cb2551c51b655a9d08904aa7b52'
option 'disable-monolithic', "Build a non-monolithic library (split into multiple files)"
depends_on :python => :recommended
depends_on FrameworkPython if build.with? "python"
def install_wx_python
args = [
# Reference our wx-config
"WX_CONFIG=#{bin}/wx-config",
# At this time Wxmac is installed Unicode only
"UNICODE=1",
# Some scripts (e.g. matplotlib) expect to `import wxversion`, which is
# only available on a multiversion build. Besides that `import wx` still works.
"INSTALL_MULTIVERSION=1",
# OpenGL and stuff
"BUILD_GLCANVAS=1",
"BUILD_GIZMOS=1",
"BUILD_STC=1"
]
cd "wxPython" do
ENV.append_to_cflags "-arch #{MacOS.preferred_arch}"
python do
system python, "setup.py",
"build_ext",
"WXPORT=osx_cocoa",
*args
system python, "setup.py",
"install",
"--prefix=#{prefix}",
"WXPORT=osx_cocoa",
*args
end
end
end
def install
# need to set with-macosx-version-min to avoid configure defaulting to 10.5
# need to enable universal binary build in order to build all x86_64 headers
# need to specify x86_64 and i386 or will try to build for ppc arch and fail on newer OSes
# https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets30/Portfile#L80
ENV.universal_binary
args = [
"--disable-debug",
"--prefix=#{prefix}",
"--enable-shared",
"--enable-unicode",
"--enable-std_string",
"--enable-display",
"--with-opengl",
"--with-osx_cocoa",
"--with-libjpeg",
"--with-libtiff",
"--with-libpng",
"--with-zlib",
"--enable-dnd",
"--enable-clipboard",
"--enable-webkit",
"--enable-svg",
"--with-expat",
"--with-macosx-version-min=#{MacOS.version}",
"--with-macosx-sdk=#{MacOS.sdk_path}",
"--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}",
"--disable-precomp-headers"
]
args << "--enable-monolithic" unless build.include? 'disable-monolithic'
system "./configure", *args
system "make install"
if build.with? "python"
ENV['WXWIN'] = Dir.getwd
# We have already downloaded wxPython in a bundle with wxWidgets
install_wx_python
end
end
def caveats
s = ''
fp = FrameworkPython.new
unless build.without? 'python' or fp.satisfied?
s += fp.message
end
return s
end
end
wxmac: disable lzma in internal libtiff
Fixes Homebrew/homebrew#22732.
require 'formula'
class FrameworkPython < Requirement
fatal true
satisfy do
q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
not q.chomp.empty?
end
def message
"Python needs to be built as a framework."
end
end
class Wxmac < Formula
homepage 'http://www.wxwidgets.org'
url 'http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2'
sha1 '9183b2ffc6631cb2551c51b655a9d08904aa7b52'
option 'disable-monolithic', "Build a non-monolithic library (split into multiple files)"
depends_on :python => :recommended
depends_on FrameworkPython if build.with? "python"
def install_wx_python
args = [
# Reference our wx-config
"WX_CONFIG=#{bin}/wx-config",
# At this time Wxmac is installed Unicode only
"UNICODE=1",
# Some scripts (e.g. matplotlib) expect to `import wxversion`, which is
# only available on a multiversion build. Besides that `import wx` still works.
"INSTALL_MULTIVERSION=1",
# OpenGL and stuff
"BUILD_GLCANVAS=1",
"BUILD_GIZMOS=1",
"BUILD_STC=1"
]
cd "wxPython" do
ENV.append_to_cflags "-arch #{MacOS.preferred_arch}"
python do
system python, "setup.py",
"build_ext",
"WXPORT=osx_cocoa",
*args
system python, "setup.py",
"install",
"--prefix=#{prefix}",
"WXPORT=osx_cocoa",
*args
end
end
end
def install
# need to set with-macosx-version-min to avoid configure defaulting to 10.5
# need to enable universal binary build in order to build all x86_64 headers
# need to specify x86_64 and i386 or will try to build for ppc arch and fail on newer OSes
# https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets30/Portfile#L80
ENV.universal_binary
args = [
"--disable-debug",
"--prefix=#{prefix}",
"--enable-shared",
"--enable-unicode",
"--enable-std_string",
"--enable-display",
"--with-opengl",
"--with-osx_cocoa",
"--with-libjpeg",
"--with-libtiff",
# Otherwise, even in superenv, the internal libtiff can pick
# up on a nonuniversal xz and fail
# https://github.com/mxcl/homebrew/issues/22732
"--without-lzma",
"--with-libpng",
"--with-zlib",
"--enable-dnd",
"--enable-clipboard",
"--enable-webkit",
"--enable-svg",
"--with-expat",
"--with-macosx-version-min=#{MacOS.version}",
"--with-macosx-sdk=#{MacOS.sdk_path}",
"--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}",
"--disable-precomp-headers"
]
args << "--enable-monolithic" unless build.include? 'disable-monolithic'
system "./configure", *args
system "make install"
if build.with? "python"
ENV['WXWIN'] = Dir.getwd
# We have already downloaded wxPython in a bundle with wxWidgets
install_wx_python
end
end
def caveats
s = ''
fp = FrameworkPython.new
unless build.without? 'python' or fp.satisfied?
s += fp.message
end
return s
end
end
|
require 'formula'
class Wxmac <Formula
url 'http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.gz'
homepage 'http://www.wxwidgets.org'
md5 'd18668cbf7026b8633e2cfc69e2f3868'
def install
%w{ CFLAGS CXXFLAGS LDFLAGS OBJCFLAGS OBJCXXFLAGS }.each do |compiler_flag|
ENV.remove compiler_flag, "-arch x86_64"
ENV.append compiler_flag, "-arch i386"
end
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make install"
end
end
wxWidgets - use bz2 download.
require 'formula'
class Wxmac <Formula
url 'http://downloads.sourceforge.net/project/wxwindows/wxMac/2.8.10/wxMac-2.8.10.tar.bz2'
homepage 'http://www.wxwidgets.org'
md5 '67e5eb6823907081fc979d41e00f93d7'
def install
# Force i386
%w{ CFLAGS CXXFLAGS LDFLAGS OBJCFLAGS OBJCXXFLAGS }.each do |compiler_flag|
ENV.remove compiler_flag, "-arch x86_64"
ENV.append compiler_flag, "-arch i386"
end
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make install"
end
end
|
require "formula"
class X3270 < Formula
homepage "http://x3270.bgp.nu/"
url "https://downloads.sourceforge.net/project/x3270/x3270/3.3.15ga5/suite3270-3.3.15ga5-src.tgz"
sha1 "7f918e21c9134ce4bccb7e0f661763f9f18946ee"
bottle do
sha1 "c8d06fd2d78e89f65976c45c99b69e8b3f585102" => :yosemite
sha1 "305257a2615698a57341793cbda367588244faf8" => :mavericks
sha1 "c35fdab2f4223da207164eff643313b2ee291b37" => :mountain_lion
end
depends_on :x11
option "with-c3270", "Include c3270 (curses-based version)"
option "with-s3270", "Include s3270 (displayless version)"
option "with-tcl3270", "Include tcl3270 (integrated with Tcl)"
option "with-pr3287", "Include pr3287 (printer emulation)"
def make_directory(directory)
cd directory do
system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
system "make install.man"
end
end
def install
make_directory "x3270-3.3"
make_directory "c3270-3.3" if build.with? "c3270"
make_directory "pr3287-3.3" if build.with? "pr3287"
make_directory "s3270-3.3" if build.with? "s3270"
make_directory "tcl3270-3.3" if build.with? "tcl3270"
end
end
x3270 3.3.15ga5
Closes Homebrew/homebrew#34630.
Signed-off-by: Jack Nagel <43386ce32af96f5c56f2a88e458cb94cebee3751@gmail.com>
require "formula"
class X3270 < Formula
homepage "http://x3270.bgp.nu/"
url "https://downloads.sourceforge.net/project/x3270/x3270/3.3.15ga6/suite3270-3.3.15ga6-src.tgz"
sha1 "c2d492b11db25b53aca9e9643e6522982cc479b4"
bottle do
sha1 "c8d06fd2d78e89f65976c45c99b69e8b3f585102" => :yosemite
sha1 "305257a2615698a57341793cbda367588244faf8" => :mavericks
sha1 "c35fdab2f4223da207164eff643313b2ee291b37" => :mountain_lion
end
depends_on :x11
option "with-c3270", "Include c3270 (curses-based version)"
option "with-s3270", "Include s3270 (displayless version)"
option "with-tcl3270", "Include tcl3270 (integrated with Tcl)"
option "with-pr3287", "Include pr3287 (printer emulation)"
def make_directory(directory)
cd directory do
system "./configure", "--prefix=#{prefix}"
system "make"
system "make install"
system "make install.man"
end
end
def install
make_directory "x3270-3.3"
make_directory "c3270-3.3" if build.with? "c3270"
make_directory "pr3287-3.3" if build.with? "pr3287"
make_directory "s3270-3.3" if build.with? "s3270"
make_directory "tcl3270-3.3" if build.with? "tcl3270"
end
end
|
class X3270 < Formula
desc "IBM 3270 terminal emulator for the X Window System and Windows"
homepage "http://x3270.bgp.nu/"
url "http://x3270.bgp.nu/download/04.00/suite3270-4.0ga12-src.tgz"
sha256 "d2e5030b67f01aed7c74dd906114d44dbc89a103d32ed0db564bf80033b8e4fb"
license "BSD-3-Clause"
livecheck do
url "http://x3270.bgp.nu/download.html"
regex(/href=.*?suite3270[._-]v?(\d+(?:\.\d+)+(?:ga\d+)?)(?:-src)?\.t/i)
end
bottle do
sha256 "1207876192b9bd7bcf06c7811cb376426e47028027a47718dc32224972352e80" => :catalina
sha256 "d2d31ed1a62515d6acd00b2d3fa72a821b1d94bb13b581830e30664fe72f2626" => :mojave
sha256 "c68394dce8fc34be49786ebfd1c0beb914b1f894611fc97163ca5a3097967151" => :high_sierra
end
depends_on "readline"
def install
args = %W[
--prefix=#{prefix}
--enable-c3270
--enable-pr3287
--enable-s3270
--enable-tcl3270
]
system "./configure", *args
system "make", "install"
system "make", "install.man"
end
test do
system bin/"c3270", "--version"
end
end
x3270: update 4.0ga12 bottle.
class X3270 < Formula
desc "IBM 3270 terminal emulator for the X Window System and Windows"
homepage "http://x3270.bgp.nu/"
url "http://x3270.bgp.nu/download/04.00/suite3270-4.0ga12-src.tgz"
sha256 "d2e5030b67f01aed7c74dd906114d44dbc89a103d32ed0db564bf80033b8e4fb"
license "BSD-3-Clause"
livecheck do
url "http://x3270.bgp.nu/download.html"
regex(/href=.*?suite3270[._-]v?(\d+(?:\.\d+)+(?:ga\d+)?)(?:-src)?\.t/i)
end
bottle do
sha256 "910cfb45bab78112705869fd8bb3fac970d0bd84194ab9555635ff484d355bcb" => :catalina
sha256 "99fbe83bf0dfbfab1f11b536608d02cd93d530eca7f0ec72ebde4d4424293444" => :mojave
sha256 "e30468e4081beeab927279e9317f30107db6391ac4e8f9f5334d2ecc0e8e57e2" => :high_sierra
end
depends_on "readline"
def install
args = %W[
--prefix=#{prefix}
--enable-c3270
--enable-pr3287
--enable-s3270
--enable-tcl3270
]
system "./configure", *args
system "make", "install"
system "make", "install.man"
end
test do
system bin/"c3270", "--version"
end
end
|
class Xaric < Formula
desc "IRC client"
homepage "https://xaric.org/"
url "https://xaric.org/software/xaric/releases/xaric-0.13.9.tar.gz"
sha256 "cb6c23fd20b9f54e663fff7cab22e8c11088319c95c90904175accf125d2fc11"
license "GPL-2.0-or-later"
livecheck do
url "https://xaric.org/software/xaric/releases/"
regex(/href=.*?xaric[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "0679cb45a723581f21bd4295225c92e01a303155e772e07ad598303d8d3acff0"
sha256 arm64_big_sur: "9f89bb7adc21f31a7721a5b3cc0586820cc59e50e82f6316ef74f2dbce1c512f"
sha256 monterey: "914abc6071ee13379b8238fac06093d1e35277d1b36365ad346bc75dc7ee688c"
sha256 big_sur: "4c9e9e9d0ef2e7f5c8bb8996ef72220f2315e756e1a4c9c8e23869b8e0abc84e"
sha256 catalina: "5438f46156ba60b6658275aefdda7617296691d949f7dd0f85dcdac1225d254e"
sha256 mojave: "e8c40aad03fec80e9566a1bb9c7100cbb3a4e0fca3dbc9f79f65271d3e29631f"
end
depends_on "openssl@1.1"
uses_from_macos "ncurses"
def install
system "./configure", *std_configure_args,
"--with-openssl=#{Formula["openssl@1.1"].opt_prefix}"
system "make", "install"
end
test do
require "pty"
output = ""
PTY.spawn("#{bin}/xaric", "-v") do |r, _w, _pid|
r.each_line { |line| output += line }
rescue Errno::EIO
# GNU/Linux raises EIO when read is done on closed pty
end
assert_match "Xaric #{version}", output
end
end
xaric: update 0.13.9 bottle.
class Xaric < Formula
desc "IRC client"
homepage "https://xaric.org/"
url "https://xaric.org/software/xaric/releases/xaric-0.13.9.tar.gz"
sha256 "cb6c23fd20b9f54e663fff7cab22e8c11088319c95c90904175accf125d2fc11"
license "GPL-2.0-or-later"
livecheck do
url "https://xaric.org/software/xaric/releases/"
regex(/href=.*?xaric[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 arm64_monterey: "0679cb45a723581f21bd4295225c92e01a303155e772e07ad598303d8d3acff0"
sha256 arm64_big_sur: "9f89bb7adc21f31a7721a5b3cc0586820cc59e50e82f6316ef74f2dbce1c512f"
sha256 monterey: "914abc6071ee13379b8238fac06093d1e35277d1b36365ad346bc75dc7ee688c"
sha256 big_sur: "4c9e9e9d0ef2e7f5c8bb8996ef72220f2315e756e1a4c9c8e23869b8e0abc84e"
sha256 catalina: "5438f46156ba60b6658275aefdda7617296691d949f7dd0f85dcdac1225d254e"
sha256 mojave: "e8c40aad03fec80e9566a1bb9c7100cbb3a4e0fca3dbc9f79f65271d3e29631f"
sha256 x86_64_linux: "407b5776d290e11fa9dc958d03d7035c623ff5876bc2f2fa37de4462f9f6547d"
end
depends_on "openssl@1.1"
uses_from_macos "ncurses"
def install
system "./configure", *std_configure_args,
"--with-openssl=#{Formula["openssl@1.1"].opt_prefix}"
system "make", "install"
end
test do
require "pty"
output = ""
PTY.spawn("#{bin}/xaric", "-v") do |r, _w, _pid|
r.each_line { |line| output += line }
rescue Errno::EIO
# GNU/Linux raises EIO when read is done on closed pty
end
assert_match "Xaric #{version}", output
end
end
|
class Xauth < Formula
desc "X.Org Applications: xauth"
homepage "https://www.x.org/"
url "https://www.x.org/pub/individual/app/xauth-1.1.1.tar.bz2"
sha256 "164ea0a29137b284a47b886ef2affcb0a74733bf3aad04f9b106b1a6c82ebd92"
license "MIT-open-group"
bottle do
sha256 cellar: :any, arm64_monterey: "f03feb786d9b9d59d83f3019ae0422946bf2bb2c9a1c87aedb5cafb8d1f6c8b9"
sha256 cellar: :any, arm64_big_sur: "6eec2379cd9b33ef0a6f43fb987ae5c33f6023c252cdae90ae0c653ad26028f4"
sha256 cellar: :any, monterey: "53010640b1e9a7aca696d305b3524dd5a1b01a3c60e2963ec40cce547633890e"
sha256 cellar: :any, big_sur: "dbd7921c13d14ed10d9d011eea5cdf16b44f4019799c072ff492b7aa11063b31"
sha256 cellar: :any, catalina: "68b0119f7e2d4e4269d7f2ded4657700f2d66d83f3da3bb0a38c9aff94943bd6"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f7fef9c7735f8d5b3405f4ff95bbf749e173a992f4cdbc028372f3356bc2f873"
end
depends_on "pkg-config" => :build
depends_on "util-macros" => :build
depends_on "libx11"
depends_on "libxau"
depends_on "libxext"
depends_on "libxmu"
on_linux do
depends_on "libxcb"
depends_on "libxdmcp"
end
def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
--enable-unix-transport
--enable-tcp-transport
--enable-ipv6
--enable-local-transport
]
system "./configure", *args
system "make"
system "make", "install"
end
test do
assert_match "unable to open display", shell_output("xauth generate :0 2>&1", 1)
end
end
xauth 1.1.2
Closes #101033.
Signed-off-by: Yurii Kolesnykov <dc76e9f0c0006e8f919e0c515c66dbba3982f785@yurikoles.com>
Signed-off-by: Rui Chen <907c7afd57be493757f13ccd1dd45dddf02db069@chenrui.dev>
Signed-off-by: BrewTestBot <8a898ee6867e4f2028e63d2a6319b2224641c06c@users.noreply.github.com>
class Xauth < Formula
desc "X.Org Applications: xauth"
homepage "https://www.x.org/"
url "https://www.x.org/pub/individual/app/xauth-1.1.2.tar.xz"
sha256 "78ba6afd19536ced1dddb3276cba6e9555a211b468a06f95f6a97c62ff8ee200"
license "MIT-open-group"
bottle do
sha256 cellar: :any, arm64_monterey: "f03feb786d9b9d59d83f3019ae0422946bf2bb2c9a1c87aedb5cafb8d1f6c8b9"
sha256 cellar: :any, arm64_big_sur: "6eec2379cd9b33ef0a6f43fb987ae5c33f6023c252cdae90ae0c653ad26028f4"
sha256 cellar: :any, monterey: "53010640b1e9a7aca696d305b3524dd5a1b01a3c60e2963ec40cce547633890e"
sha256 cellar: :any, big_sur: "dbd7921c13d14ed10d9d011eea5cdf16b44f4019799c072ff492b7aa11063b31"
sha256 cellar: :any, catalina: "68b0119f7e2d4e4269d7f2ded4657700f2d66d83f3da3bb0a38c9aff94943bd6"
sha256 cellar: :any_skip_relocation, x86_64_linux: "f7fef9c7735f8d5b3405f4ff95bbf749e173a992f4cdbc028372f3356bc2f873"
end
depends_on "pkg-config" => :build
depends_on "util-macros" => :build
depends_on "libx11"
depends_on "libxau"
depends_on "libxext"
depends_on "libxmu"
on_linux do
depends_on "libxcb"
depends_on "libxdmcp"
end
def install
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--disable-dependency-tracking
--disable-silent-rules
--enable-unix-transport
--enable-tcp-transport
--enable-ipv6
--enable-local-transport
]
system "./configure", *args
system "make"
system "make", "install"
end
test do
assert_match "unable to open display", shell_output("xauth generate :0 2>&1", 1)
end
end
|
class Xmake < Formula
desc "Cross-platform build utility based on Lua"
homepage "https://xmake.io/"
url "https://github.com/xmake-io/xmake/releases/download/v2.3.9/xmake-v2.3.9.m1.tar.gz"
version "2.3.9.m1"
sha256 "25a8fc39c6859854d26cec918eca94e16427d76870a9f29f4b302f7d300674a2"
license "Apache-2.0"
head "https://github.com/xmake-io/xmake.git"
bottle do
cellar :any_skip_relocation
sha256 "9102ec2c17817f4aaf96710c73f568078ceba2201d35fd33cbeb09fc5a52c3e7" => :big_sur
sha256 "97601c30b48b566feede80e8c546fa8a7f8f47340d5fa99775ae89fa21ebf798" => :catalina
sha256 "1d38ca72d9c6b48a735ad97896956a795a74e85f99318eb84eb8ac856d363628" => :mojave
end
on_linux do
depends_on "readline"
end
def install
on_linux do
ENV["XMAKE_ROOT"] = "y" if ENV["CI"]
end
system "make", "build"
system "make", "install", "prefix=#{prefix}"
end
test do
system bin/"xmake", "create", "test"
cd "test" do
system bin/"xmake"
assert_equal "hello world!", shell_output("#{bin}/xmake run").chomp
end
end
end
xmake: update 2.3.9.m1 bottle.
class Xmake < Formula
desc "Cross-platform build utility based on Lua"
homepage "https://xmake.io/"
url "https://github.com/xmake-io/xmake/releases/download/v2.3.9/xmake-v2.3.9.m1.tar.gz"
version "2.3.9.m1"
sha256 "25a8fc39c6859854d26cec918eca94e16427d76870a9f29f4b302f7d300674a2"
license "Apache-2.0"
head "https://github.com/xmake-io/xmake.git"
bottle do
cellar :any_skip_relocation
sha256 "304929df3becb98dbb71c977c378c7bee7a82b625e4829178d744ecba9733df8" => :big_sur
sha256 "2934592e40f18bfa65bd290b7343a30178117e8f88a4a344745774760fc8cbba" => :arm64_big_sur
sha256 "5b43f0aecef9254ea7d2f8bcff909165d6b3dce3f7c93afe8294a429173596bd" => :catalina
sha256 "66edef034918bdaec425876134c341d6092f1fd83e346403d14b23ac483c906d" => :mojave
end
on_linux do
depends_on "readline"
end
def install
on_linux do
ENV["XMAKE_ROOT"] = "y" if ENV["CI"]
end
system "make", "build"
system "make", "install", "prefix=#{prefix}"
end
test do
system bin/"xmake", "create", "test"
cd "test" do
system bin/"xmake"
assert_equal "hello world!", shell_output("#{bin}/xmake run").chomp
end
end
end
|
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-powered, cross-platform, Unix-gazing shell language and command prompt"
homepage "https://xon.sh/"
url "https://files.pythonhosted.org/packages/7f/3d/a29fe1f9dc61502a0cdee70e4bd4f97164106975209b6feaa2e064d241fc/xonsh-0.9.25.tar.gz"
sha256 "20af3480d6ac1b8a48f03288796b16a35f498f047e3472c300e4ef5a26f03d60"
license "BSD-2-Clause-Views"
head "https://github.com/xonsh/xonsh.git"
bottle do
sha256 cellar: :any_skip_relocation, big_sur: "f452f1a1bb8d5d47fcc882a8fc9819b39a38570e4b5a5aa259569f974e88619e"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "adf5638b08a02469fda9b604245892717519c3e2e6672f2a0d45fde285e235b6"
sha256 cellar: :any_skip_relocation, catalina: "c32fcc12a0c3e00d98929d4d2a31f7d3c890ac5210a48a17087eb3e854af7982"
sha256 cellar: :any_skip_relocation, mojave: "3ef62348b98b48176fb167fefc2097bb88fc5c0d4194c895234f72e86f79101c"
end
depends_on "python@3.9"
# Resources based on `pip3 install xonsh[ptk,pygments,proctitle]`
# See https://xon.sh/osx.html#dependencies
resource "prompt-toolkit" do
url "https://files.pythonhosted.org/packages/b1/46/4eb242362c43cf033b4ec4d7205612c46c9f904a8984cdfdb64d35476175/prompt_toolkit-3.0.14.tar.gz"
sha256 "7e966747c18ececaec785699626b771c1ba8344c8d31759a1915d6b12fad6525"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/e1/86/8059180e8217299079d8719c6e23d674aadaba0b1939e25e0cc15dcf075b/Pygments-2.7.4.tar.gz"
sha256 "df49d09b498e83c1a73128295860250b0b7edd4c723a32e9bc0d295c7c2ec337"
end
resource "pyperclip" do
url "https://files.pythonhosted.org/packages/6f/4c/0b1d507ad7e8bc31d690d04b4f475e74c2002d060f7994ce8c09612df707/pyperclip-1.8.1.tar.gz"
sha256 "9abef1e79ce635eb62309ecae02dfb5a3eb952fa7d6dce09c1aef063f81424d3"
end
resource "setproctitle" do
url "https://files.pythonhosted.org/packages/a1/7f/a1d4f4c7b66f0fc02f35dc5c85f45a8b4e4a7988357a29e61c14e725ef86/setproctitle-1.2.2.tar.gz"
sha256 "7dfb472c8852403d34007e01d6e3c68c57eb66433fb8a5c77b13b89a160d97df"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
end
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
xonsh: update 0.9.25 bottle.
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-powered, cross-platform, Unix-gazing shell language and command prompt"
homepage "https://xon.sh/"
url "https://files.pythonhosted.org/packages/7f/3d/a29fe1f9dc61502a0cdee70e4bd4f97164106975209b6feaa2e064d241fc/xonsh-0.9.25.tar.gz"
sha256 "20af3480d6ac1b8a48f03288796b16a35f498f047e3472c300e4ef5a26f03d60"
license "BSD-2-Clause-Views"
head "https://github.com/xonsh/xonsh.git"
bottle do
sha256 cellar: :any_skip_relocation, big_sur: "f452f1a1bb8d5d47fcc882a8fc9819b39a38570e4b5a5aa259569f974e88619e"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "adf5638b08a02469fda9b604245892717519c3e2e6672f2a0d45fde285e235b6"
sha256 cellar: :any_skip_relocation, catalina: "c32fcc12a0c3e00d98929d4d2a31f7d3c890ac5210a48a17087eb3e854af7982"
sha256 cellar: :any_skip_relocation, mojave: "3ef62348b98b48176fb167fefc2097bb88fc5c0d4194c895234f72e86f79101c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "2ca2fe502a6cb348331cbe0d7f1dd3f751c15af47361d961d80dbc0c41e47a09"
end
depends_on "python@3.9"
# Resources based on `pip3 install xonsh[ptk,pygments,proctitle]`
# See https://xon.sh/osx.html#dependencies
resource "prompt-toolkit" do
url "https://files.pythonhosted.org/packages/b1/46/4eb242362c43cf033b4ec4d7205612c46c9f904a8984cdfdb64d35476175/prompt_toolkit-3.0.14.tar.gz"
sha256 "7e966747c18ececaec785699626b771c1ba8344c8d31759a1915d6b12fad6525"
end
resource "Pygments" do
url "https://files.pythonhosted.org/packages/e1/86/8059180e8217299079d8719c6e23d674aadaba0b1939e25e0cc15dcf075b/Pygments-2.7.4.tar.gz"
sha256 "df49d09b498e83c1a73128295860250b0b7edd4c723a32e9bc0d295c7c2ec337"
end
resource "pyperclip" do
url "https://files.pythonhosted.org/packages/6f/4c/0b1d507ad7e8bc31d690d04b4f475e74c2002d060f7994ce8c09612df707/pyperclip-1.8.1.tar.gz"
sha256 "9abef1e79ce635eb62309ecae02dfb5a3eb952fa7d6dce09c1aef063f81424d3"
end
resource "setproctitle" do
url "https://files.pythonhosted.org/packages/a1/7f/a1d4f4c7b66f0fc02f35dc5c85f45a8b4e4a7988357a29e61c14e725ef86/setproctitle-1.2.2.tar.gz"
sha256 "7dfb472c8852403d34007e01d6e3c68c57eb66433fb8a5c77b13b89a160d97df"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
end
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
|
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.6.7.tar.gz"
sha256 "1ff04ac5aa8a9cfc6d88303bcf9ee304721be27e77ce14978804d9b52f3a1d3c"
head "https://github.com/xonsh/xonsh.git"
bottle do
cellar :any_skip_relocation
sha256 "f5d0fa80ffcf417374a1dda1b1652c8da378f54d4bd8269e3f4638202406e31d" => :high_sierra
sha256 "16d711d47e9c84483a86d499ab90e8d3d9c11a6fada10ce650d36e85a4f73e03" => :sierra
sha256 "024b243f0619ab8658620246717e4179963a6e9c070388fe6ecfc5c0e7722003" => :el_capitan
end
depends_on "python"
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
xonsh: update 0.6.7 bottle for Linuxbrew.
Closes Linuxbrew/homebrew-core#8056.
Signed-off-by: Michka Popoff <7b0496f66f66ee22a38826c310c38b415671b832@gmail.com>
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.6.7.tar.gz"
sha256 "1ff04ac5aa8a9cfc6d88303bcf9ee304721be27e77ce14978804d9b52f3a1d3c"
head "https://github.com/xonsh/xonsh.git"
bottle do
cellar :any_skip_relocation
sha256 "f5d0fa80ffcf417374a1dda1b1652c8da378f54d4bd8269e3f4638202406e31d" => :high_sierra
sha256 "16d711d47e9c84483a86d499ab90e8d3d9c11a6fada10ce650d36e85a4f73e03" => :sierra
sha256 "024b243f0619ab8658620246717e4179963a6e9c070388fe6ecfc5c0e7722003" => :el_capitan
sha256 "37f77b257735ff98169303a677e5aeca2e779876ba8ec122c4af8eb86d6d926f" => :x86_64_linux
end
depends_on "python"
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
|
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.5.0.tar.gz"
sha256 "171ce4824bc0109e2b1366cdc0bafa68d74285f4fa157d5f0c62a37d2a4d3972"
revision 1
head "https://github.com/scopatz/xonsh.git"
bottle do
sha256 "da5d3e32d9b9b940c0e7d6c8e7e8406d06fb8a5dd13bcdbfdb0b8059c056855c" => :sierra
sha256 "25f8db5eb66b1482862c3c411a1f761f40c54c273578953bf274eaeea3384bf6" => :el_capitan
sha256 "6218b185c3ffa22c1867f552b5b804faaef1c350f36523f68d20e77e055f88f9" => :yosemite
end
depends_on :python3
resource "ply" do
url "https://files.pythonhosted.org/packages/a8/4d/487e12d0478ee0cbb15d6fe9b8916e98fe4e2fce4cc65e4de309209c0b24/ply-3.9.tar.gz"
sha256 "0d7e2940b9c57151392fceaa62b0865c45e06ce1e36687fd8d03f011a907f43e"
end
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
xonsh 0.5.2
Closes #8543.
Signed-off-by: Tomasz Pajor <ea73344294b1c6e2cb529d7fc98a4971de7607ac@polishgeeks.com>
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.5.2.tar.gz"
sha256 "58bd878acdfe46372b56b3f4b764e85c1038bd149334731f778daa12ab072294"
head "https://github.com/scopatz/xonsh.git"
bottle do
sha256 "da5d3e32d9b9b940c0e7d6c8e7e8406d06fb8a5dd13bcdbfdb0b8059c056855c" => :sierra
sha256 "25f8db5eb66b1482862c3c411a1f761f40c54c273578953bf274eaeea3384bf6" => :el_capitan
sha256 "6218b185c3ffa22c1867f552b5b804faaef1c350f36523f68d20e77e055f88f9" => :yosemite
end
depends_on :python3
resource "ply" do
url "https://files.pythonhosted.org/packages/a8/4d/487e12d0478ee0cbb15d6fe9b8916e98fe4e2fce4cc65e4de309209c0b24/ply-3.9.tar.gz"
sha256 "0d7e2940b9c57151392fceaa62b0865c45e06ce1e36687fd8d03f011a907f43e"
end
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
|
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.6.7.tar.gz"
sha256 "1ff04ac5aa8a9cfc6d88303bcf9ee304721be27e77ce14978804d9b52f3a1d3c"
head "https://github.com/xonsh/xonsh.git"
bottle do
cellar :any_skip_relocation
sha256 "f5d0fa80ffcf417374a1dda1b1652c8da378f54d4bd8269e3f4638202406e31d" => :high_sierra
sha256 "16d711d47e9c84483a86d499ab90e8d3d9c11a6fada10ce650d36e85a4f73e03" => :sierra
sha256 "024b243f0619ab8658620246717e4179963a6e9c070388fe6ecfc5c0e7722003" => :el_capitan
end
depends_on "python"
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
xonsh 0.6.8
Closes #29562.
Signed-off-by: ilovezfs <fbd54dbbcf9e596abad4ccdc4dfc17f80ebeaee2@icloud.com>
class Xonsh < Formula
include Language::Python::Virtualenv
desc "Python-ish, BASHwards-compatible shell language and command prompt"
homepage "http://xon.sh"
url "https://github.com/xonsh/xonsh/archive/0.6.8.tar.gz"
sha256 "77d8b64ddc600549fd073a3ead20c41e049e61e26e7f3337322449f7c9b11b71"
head "https://github.com/xonsh/xonsh.git"
bottle do
cellar :any_skip_relocation
sha256 "f5d0fa80ffcf417374a1dda1b1652c8da378f54d4bd8269e3f4638202406e31d" => :high_sierra
sha256 "16d711d47e9c84483a86d499ab90e8d3d9c11a6fada10ce650d36e85a4f73e03" => :sierra
sha256 "024b243f0619ab8658620246717e4179963a6e9c070388fe6ecfc5c0e7722003" => :el_capitan
end
depends_on "python"
def install
virtualenv_install_with_resources
end
test do
assert_match "4", shell_output("#{bin}/xonsh -c 2+2")
end
end
|
class Xrick < Formula
desc "Clone of Rick Dangerous"
homepage "https://www.bigorno.net/xrick/"
url "https://www.bigorno.net/xrick/xrick-021212.tgz"
# There is a repo at https://github.com/zpqrtbnk/xrick but it is organized
# differently than the tarball
sha256 "aa8542120bec97a730258027a294bd16196eb8b3d66134483d085f698588fc2b"
bottle do
rebuild 1
sha256 big_sur: "301f75c04e2c98c81b58868d7357e817b7dec1bc8a29747b27f088a10c1863ec"
sha256 catalina: "b391e62a9cf0a3537ec68c03d215370d875a70a90fb7a8cb48cac8cc7281e2c2"
sha256 mojave: "cf85542617f6e39a8fec0239a57d1bc1707f50289e5c91bee89e84664603f43c"
end
depends_on "sdl"
def install
inreplace "src/xrick.c", "data.zip", "#{pkgshare}/data.zip"
system "make"
bin.install "xrick"
man6.install "xrick.6.gz"
pkgshare.install "data.zip"
end
test do
assert_match "xrick [version ##{version}]", shell_output("#{bin}/xrick --help", 1)
end
end
xrick: update 021212 bottle.
class Xrick < Formula
desc "Clone of Rick Dangerous"
homepage "https://www.bigorno.net/xrick/"
url "https://www.bigorno.net/xrick/xrick-021212.tgz"
# There is a repo at https://github.com/zpqrtbnk/xrick but it is organized
# differently than the tarball
sha256 "aa8542120bec97a730258027a294bd16196eb8b3d66134483d085f698588fc2b"
bottle do
rebuild 2
sha256 arm64_big_sur: "06c5d5c23d3a83ae82c8efa8303c186cb8b07f2f274b911062c0a56df4207e96"
sha256 big_sur: "07143daa9065782675e5288a66dc2ea8ce418754d4842175b016dbc097b982cd"
sha256 catalina: "67d2a811a5ecd67de860f226fc88feec5ed479ae05fc22e917d6fbe0686be783"
sha256 mojave: "1a2f4d0cc564fd627d83f2b54606c59845b50fb3db04e7a118ca281377b4805a"
end
depends_on "sdl"
def install
inreplace "src/xrick.c", "data.zip", "#{pkgshare}/data.zip"
system "make"
bin.install "xrick"
man6.install "xrick.6.gz"
pkgshare.install "data.zip"
end
test do
assert_match "xrick [version ##{version}]", shell_output("#{bin}/xrick --help", 1)
end
end
|
class Xsimd < Formula
desc "Modern, portable C++ wrappers for SIMD intrinsics"
homepage "https://xsimd.readthedocs.io/en/latest/"
url "https://github.com/QuantStack/xsimd/archive/7.5.0.tar.gz"
sha256 "45337317c7f238fe0d64bb5d5418d264a427efc53400ddf8e6a964b6bcb31ce9"
license "BSD-3-Clause"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, big_sur: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, catalina: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, mojave: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
end
depends_on "cmake" => :build
def install
args = std_cmake_args
args << "-DBUILD_TESTS=OFF"
system "cmake", ".", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <vector>
#include <type_traits>
#include "xsimd/memory/xsimd_alignment.hpp"
using namespace xsimd;
struct mock_container {};
int main(void) {
using u_vector_type = std::vector<double>;
using a_vector_type = std::vector<double, aligned_allocator<double, XSIMD_DEFAULT_ALIGNMENT>>;
using u_vector_align = container_alignment_t<u_vector_type>;
using a_vector_align = container_alignment_t<a_vector_type>;
using mock_align = container_alignment_t<mock_container>;
if(!std::is_same<u_vector_align, unaligned_mode>::value) abort();
if(!std::is_same<a_vector_align, aligned_mode>::value) abort();
if(!std::is_same<mock_align, unaligned_mode>::value) abort();
return 0;
}
EOS
system ENV.cxx, "test.c", "-std=c++14", "-I#{include}", "-o", "test"
system "./test"
end
end
xsimd: update 7.5.0 bottle.
class Xsimd < Formula
desc "Modern, portable C++ wrappers for SIMD intrinsics"
homepage "https://xsimd.readthedocs.io/en/latest/"
url "https://github.com/QuantStack/xsimd/archive/7.5.0.tar.gz"
sha256 "45337317c7f238fe0d64bb5d5418d264a427efc53400ddf8e6a964b6bcb31ce9"
license "BSD-3-Clause"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, big_sur: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, catalina: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, mojave: "c8c0550dcc933117abe0a9ac6369dcfa3f5fc67192a5470213200d70e8b34a49"
sha256 cellar: :any_skip_relocation, x86_64_linux: "65cdb6754f3b1b6c42569b851e81ff800b95f2de91d246bce8f4f881eca4035f"
end
depends_on "cmake" => :build
def install
args = std_cmake_args
args << "-DBUILD_TESTS=OFF"
system "cmake", ".", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <vector>
#include <type_traits>
#include "xsimd/memory/xsimd_alignment.hpp"
using namespace xsimd;
struct mock_container {};
int main(void) {
using u_vector_type = std::vector<double>;
using a_vector_type = std::vector<double, aligned_allocator<double, XSIMD_DEFAULT_ALIGNMENT>>;
using u_vector_align = container_alignment_t<u_vector_type>;
using a_vector_align = container_alignment_t<a_vector_type>;
using mock_align = container_alignment_t<mock_container>;
if(!std::is_same<u_vector_align, unaligned_mode>::value) abort();
if(!std::is_same<a_vector_align, aligned_mode>::value) abort();
if(!std::is_same<mock_align, unaligned_mode>::value) abort();
return 0;
}
EOS
system ENV.cxx, "test.c", "-std=c++14", "-I#{include}", "-o", "test"
system "./test"
end
end
|
class Zbctl < Formula
desc "Zeebe CLI client"
homepage "https://docs.camunda.io/docs/apis-clients/cli-client/index/"
url "https://github.com/camunda/zeebe.git",
tag: "8.1.3",
revision: "1b72df6594134e7b7fc60f1801d418c51bbcc3d7"
license "Apache-2.0"
head "https://github.com/camunda/zeebe.git", branch: "develop"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "7bd176589d8afa4ee8b9443cf2ac4c53bb5357ecaaa11e16f41a7ae9ff10f695"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7bd176589d8afa4ee8b9443cf2ac4c53bb5357ecaaa11e16f41a7ae9ff10f695"
sha256 cellar: :any_skip_relocation, monterey: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, big_sur: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, catalina: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, x86_64_linux: "12799955bd8ae11e903b762284cfaf25090766b6de39fd39ba0cf12c201c267a"
end
depends_on "go" => :build
def install
commit = Utils.git_short_head
chdir "clients/go/cmd/zbctl" do
project = "github.com/camunda/zeebe/clients/go/v8/cmd/zbctl/internal/commands"
ldflags = %W[
-w
-X #{project}.Version=#{version}
-X #{project}.Commit=#{commit}
]
system "go", "build", "-tags", "netgo", *std_go_args(ldflags: ldflags)
generate_completions_from_executable(bin/"zbctl", "completion")
end
end
test do
# Check status for a nonexistent cluster
status_error_message =
"Error: rpc error: code = " \
"Unavailable desc = connection error: " \
"desc = \"transport: Error while dialing dial tcp 127.0.0.1:26500: connect: connection refused\""
output = shell_output("#{bin}/zbctl status 2>&1", 1)
assert_match status_error_message, output
# Check version
commit = stable.specs[:revision][0..7]
expected_version = "zbctl #{version} (commit: #{commit})"
assert_match expected_version, shell_output("#{bin}/zbctl version")
end
end
zbctl: update 8.1.3 bottle.
class Zbctl < Formula
desc "Zeebe CLI client"
homepage "https://docs.camunda.io/docs/apis-clients/cli-client/index/"
url "https://github.com/camunda/zeebe.git",
tag: "8.1.3",
revision: "1b72df6594134e7b7fc60f1801d418c51bbcc3d7"
license "Apache-2.0"
head "https://github.com/camunda/zeebe.git", branch: "develop"
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "7bd176589d8afa4ee8b9443cf2ac4c53bb5357ecaaa11e16f41a7ae9ff10f695"
sha256 cellar: :any_skip_relocation, arm64_monterey: "7bd176589d8afa4ee8b9443cf2ac4c53bb5357ecaaa11e16f41a7ae9ff10f695"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7bd176589d8afa4ee8b9443cf2ac4c53bb5357ecaaa11e16f41a7ae9ff10f695"
sha256 cellar: :any_skip_relocation, monterey: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, big_sur: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, catalina: "eceb000a78b1653efee4d544347f27529ad910c4da2b68823ecd16025415edd9"
sha256 cellar: :any_skip_relocation, x86_64_linux: "12799955bd8ae11e903b762284cfaf25090766b6de39fd39ba0cf12c201c267a"
end
depends_on "go" => :build
def install
commit = Utils.git_short_head
chdir "clients/go/cmd/zbctl" do
project = "github.com/camunda/zeebe/clients/go/v8/cmd/zbctl/internal/commands"
ldflags = %W[
-w
-X #{project}.Version=#{version}
-X #{project}.Commit=#{commit}
]
system "go", "build", "-tags", "netgo", *std_go_args(ldflags: ldflags)
generate_completions_from_executable(bin/"zbctl", "completion")
end
end
test do
# Check status for a nonexistent cluster
status_error_message =
"Error: rpc error: code = " \
"Unavailable desc = connection error: " \
"desc = \"transport: Error while dialing dial tcp 127.0.0.1:26500: connect: connection refused\""
output = shell_output("#{bin}/zbctl status 2>&1", 1)
assert_match status_error_message, output
# Check version
commit = stable.specs[:revision][0..7]
expected_version = "zbctl #{version} (commit: #{commit})"
assert_match expected_version, shell_output("#{bin}/zbctl version")
end
end
|
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{sandbox}
s.version = "0.0.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brandon Dimcheff"]
s.date = %q{2009-02-13}
s.description = %q{TODO}
s.email = %q{bdimchef-git@wieldim.com}
s.files = ["README.rdoc", "VERSION.yml", "lib/sandbox.rb", "spec/sandbox_spec.rb", "spec/spec_helper.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/bdimcheff/sandbox}
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
s.summary = %q{TODO}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end
Regenerated gemspec for version 0.0.1
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{sandbox}
s.version = "0.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Brandon Dimcheff"]
s.date = %q{2009-02-13}
s.description = %q{TODO}
s.email = %q{bdimchef-git@wieldim.com}
s.files = ["README.rdoc", "VERSION.yml", "lib/sandbox.rb", "spec/sandbox_spec.rb", "spec/spec_helper.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/bdimcheff/sandbox}
s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
s.summary = %q{TODO}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end
|
$LOAD_PATH.unshift(File.expand_path(
File.join('..', '..', 'oauth2-core', 'lib'),
File.dirname(__FILE__)
))
require "rubygems"
require "bundler"
Bundler.setup
require 'oauth2/server'
require 'rspec'
require 'rspec/autorun'
Dir.glob(File.dirname(__FILE__) + "/support/**/*.rb").each do |file|
require file
end
Rspec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# config.mock_with :rspec
config.include OAuth2::Matchers
end
Update spec_helper to complain about missing gems
$LOAD_PATH.unshift(File.expand_path(
File.join('..', '..', 'oauth2-core', 'lib'),
File.dirname(__FILE__)
))
require "rubygems"
begin
require "bundler"
Bundler.setup
rescue LoadError => e
puts 'Bundler not found. Please install bundler with the command gem install bundler'
end
begin
require 'rspec'
require 'rspec/autorun'
rescue LoadError => e
puts 'RSpec not found. Please install rspec with command bundle install'
end
require 'oauth2/server'
Dir.glob(File.dirname(__FILE__) + "/support/**/*.rb").each do |file|
require file
end
Rspec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# config.mock_with :rspec
config.include OAuth2::Matchers
end |
begin
require 'dotenv'
Dotenv.load
rescue LoadError
end
task :environment do
ENV['RACK_ENV'] = 'development' unless ENV['RACK_ENV']
require 'celluloid'
require 'sucker_punch'
require 'roda'
require 'mongoid'
require 'json'
require 'mutations'
require 'logger'
require 'msgpack'
require 'tilt/jbuilder.rb'
Dir[__dir__ + '/../../models/*.rb'].each {|file| require file }
require_relative '../../app/initializers/mongoid'
end
remove sucker_punch
begin
require 'dotenv'
Dotenv.load
rescue LoadError
end
task :environment do
ENV['RACK_ENV'] = 'development' unless ENV['RACK_ENV']
require 'celluloid'
require 'roda'
require 'mongoid'
require 'json'
require 'mutations'
require 'logger'
require 'msgpack'
require 'tilt/jbuilder.rb'
Dir[__dir__ + '/../../models/*.rb'].each {|file| require file }
require_relative '../../app/initializers/mongoid'
end
|
# Test.rb
#
# Description: Implements replacive fuzzing by testing a set of URL's with
# attack vectors and determines if a vulnerabilty occured on
# the target.
#
# Author: Peter Mikitsh pam3961
# Author: Akshay Karnawat
require 'mechanize'
require 'net/http'
require 'timeout'
class Test
# url: string of absolute URL paths to test
# vectors: string array of replacive vectors to append to urls
# authAgent: optional 'Mechanize' agent (if authentication used
def self.test(url, vectors, authAgent, random, timeout)
puts "Testing Vectors..."
# create a new agent with timeout attributes
agent = authAgent ? authAgent : Mechanize.new
vectors.each do |vector|
Test.replaciveFuzz(url, vector, agent, timeout)
end
end
def self.createAttackURL(url, vector)
return url + "/" + vector;
end
def self.replaciveFuzz(url, vector, agent, timeout)
begin
attack_url = Test.createAttackURL(url, vector)
puts "Testing URL #{attack_url}"
Timeout.timeout(timeout) { response = agent.get(attack_url) }
if response.body.include? vector
puts "\t Possible vulnerability identified. The response body contains the attack vector."
end
rescue Mechanize::ResponseCodeError => e
puts "\t Possible vulnerability identified. #{e.response_code} - Unexcepted response code."
rescue Timeout::Error
puts "\t Possible vulnerability identified. Timeout error."
end
end
end
fix runtime error
# Test.rb
#
# Description: Implements replacive fuzzing by testing a set of URL's with
# attack vectors and determines if a vulnerabilty occured on
# the target.
#
# Author: Peter Mikitsh pam3961
# Author: Akshay Karnawat
require 'mechanize'
require 'net/http'
require 'timeout'
class Test
# url: string of absolute URL paths to test
# vectors: string array of replacive vectors to append to urls
# authAgent: optional 'Mechanize' agent (if authentication used
def self.test(url, vectors, authAgent, random, timeout)
puts "Testing Vectors..."
# create a new agent with timeout attributes
agent = authAgent ? authAgent : Mechanize.new
vectors.each do |vector|
Test.replaciveFuzz(url, vector, agent, timeout)
end
end
def self.createAttackURL(url, vector)
return url + "/" + vector;
end
def self.replaciveFuzz(url, vector, agent, timeout)
begin
attack_url = Test.createAttackURL(url, vector)
puts "Testing URL #{attack_url}"
Timeout.timeout(timeout) {
response = agent.get(attack_url)
if response.body.include? vector
puts "\t Possible vulnerability identified. The response body contains the attack vector."
end
}
rescue Mechanize::ResponseCodeError => e
puts "\t Possible vulnerability identified. #{e.response_code} - Unexcepted response code."
rescue Timeout::Error
puts "\t Possible vulnerability identified. Timeout error."
end
end
end
|
# encoding: UTF-8
require 'rubygems'
require 'test/unit'
require 'highline/import' # Password prompt
LDAPPWD = ask("Enter LDAP admin password: ") { |q| q.echo = false }
require 'yunohost/functions'
require 'pp'
class TestYunoHostFunctions < Test::Unit::TestCase
def test_ldap_search
result = [{
"objectclass" => ["mailAccount", "organizationalRole", "posixAccount", "simpleSecurityObject"],
"dn" => "cn=admin," + LDAPDOMAIN.chomp
},
{
"objectclass" => ["sudoRole", "top"],
"dn" => "cn=admin,ou=sudo," + LDAPDOMAIN.chomp
},
{
"objectclass" => ["groupOfNames", "top"],
"dn" => "cn=admin,ou=groups," + LDAPDOMAIN.chomp
}]
assert_equal(result, @@yunoldap.search(LDAPDOMAIN, "(cn=admin)", ["dn", "objectclass"], false))
end
def test_user_add
attrs_hash = {
"username" => "toto",
"mail" => "toto@tata.net",
"lastname" => "Tata Titi",
"firstname" => "Toto",
"password" => "yayaya"
}
result = {
:dn=>"cn=Toto Tata Titi,ou=users," + LDAPDOMAIN,
:attrs => {
:objectclass => ["mailAccount", "inetorgperson"],
:uid => "toto",
:givenName => "Toto",
:sn => "Tata Titi",
:mail => "toto@tata.net",
:displayName => "Toto Tata Titi",
:userPassword => "{MD5}odEjpjk2q77oeCPi8a/6mw==",
:cn => "Toto Tata Titi"
}
}
user_delete("toto") if @@yunoldap.search(LDAPDOMAIN, "(uid=toto)")
assert_equal(result, user_add(attrs_hash))
end
def test_user_delete
assert_equal(true, user_delete("toto"))
end
end
user_info Test
# encoding: UTF-8
require 'rubygems'
require 'test/unit'
require 'highline/import' # Password prompt
LDAPPWD = ask("Enter LDAP admin password: ") { |q| q.echo = false }
require 'yunohost/functions'
require 'pp'
@@user_hash = {
"username" => "toto",
"mail" => "toto@tata.net",
"lastname" => "Tata Titi",
"firstname" => "Toto",
"password" => "yayaya"
}
class TestYunoHostFunctions < Test::Unit::TestCase
def test_ldap_search
result = [{
"objectclass" => ["mailAccount", "organizationalRole", "posixAccount", "simpleSecurityObject"],
"dn" => "cn=admin," + LDAPDOMAIN.chomp
},
{
"objectclass" => ["sudoRole", "top"],
"dn" => "cn=admin,ou=sudo," + LDAPDOMAIN.chomp
},
{
"objectclass" => ["groupOfNames", "top"],
"dn" => "cn=admin,ou=groups," + LDAPDOMAIN.chomp
}]
assert_equal(result, @@yunoldap.search(LDAPDOMAIN, "(cn=admin)", ["dn", "objectclass"], false))
end
def test_user_add
result = {
:dn =>"cn=Toto Tata Titi,ou=users," + LDAPDOMAIN,
:attrs => {
:objectclass => ["mailAccount", "inetorgperson"],
:uid => "toto",
:givenName => "Toto",
:sn => "Tata Titi",
:mail => "toto@tata.net",
:displayName => "Toto Tata Titi",
:userPassword => "{MD5}odEjpjk2q77oeCPi8a/6mw==",
:cn => "Toto Tata Titi"
}
}
user_delete("toto") if @@yunoldap.search(LDAPDOMAIN, "(uid=toto)")
assert_equal(result, user_add(@@user_hash))
end
def test_user_info
result = {
"givenName" => "Toto",
"mailalias" => "none",
"uid" => "toto",
"mail" => "toto@tata.net",
"sn" => "Tata Titi"
}
user_add(@@user_hash) unless @@yunoldap.search(LDAPDOMAIN, "(uid=toto)")
assert_equal(result, user_info("toto"))
end
def test_user_delete
user_add(@@user_hash) unless @@yunoldap.search(LDAPDOMAIN, "(uid=toto)")
assert_equal(true, user_delete("toto"))
end
end
|
#!/usr/local/bin/ruby -w
#
$LOAD_PATH.unshift("lib")
require 'madeleine'
require 'test/unit'
class Append
def initialize(value)
@value = value
end
def execute(system)
system << @value
end
end
module TestUtils
def delete_directory(directory_name)
Dir.foreach(directory_name) do |file|
next if file == "."
next if file == ".."
assert(File.delete(directory_name + File::SEPARATOR + file) == 1,
"Unable to delete #{file}")
end
Dir.delete(directory_name)
end
end
class SnapshotMadeleineTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(persistence_base)
end
def persistence_base
"closing-test"
end
def test_closing
madeleine = SnapshotMadeleine.new(persistence_base) { "hello" }
madeleine.close
assert_raises(RuntimeError) do
madeleine.execute_command(Append.new("world"))
end
end
end
class NumberedFileTest < Test::Unit::TestCase
def test_main
target = Madeleine::NumberedFile.new(File::SEPARATOR + "foo", "bar", 321)
assert_equal(File::SEPARATOR + "foo" + File::SEPARATOR +
"000000000000000000321.bar",
target.name)
end
end
class CommandLogTest < Test::Unit::TestCase
def setup
@target = Madeleine::CommandLog.new(".")
end
def teardown
@target.close
File.delete(expected_file_name)
end
def test_logging
f = open(expected_file_name, 'r')
assert(f.stat.file?)
@target.store(Addition.new(7))
read_command = Marshal.load(f)
assert_equal(Addition, read_command.class)
assert_equal(7, read_command.value)
assert_equal(f.stat.size, f.tell)
@target.store(Addition.new(3))
read_command = Marshal.load(f)
assert_equal(3, read_command.value)
assert_equal(f.stat.size, f.tell)
f.close
end
def expected_file_name
"000000000000000000001.command_log"
end
end
class LoggerTest < Test::Unit::TestCase
def test_creation
@log = Object.new
def @log.store(command)
unless defined? @commands
@commands = []
end
@commands << command
end
def @log.commands
@commands
end
log_factory = self
target = Madeleine::Logger.new("whoah", log_factory)
target.store(:foo)
assert(@log.commands.include?(:foo))
end
# Self-shunt
def create_log(directory_name)
@log
end
end
class CommandVerificationTest < Test::Unit::TestCase
def teardown
Dir.delete("foo")
end
def test_broken_command
target = SnapshotMadeleine.new("foo") { :a_system }
assert_raises(Madeleine::InvalidCommandException) do
target.execute_command(:not_a_command)
end
end
end
class CustomMarshallerTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"custom-marshaller-test"
end
def madeleine_class
SnapshotMadeleine
end
def test_changing_marshaller
@log = ""
marshaller = self
target = madeleine_class.new(prevalence_base, marshaller) { "hello world" }
target.take_snapshot
assert_equal("dump ", @log)
target = nil
madeleine_class.new(prevalence_base, marshaller) { flunk() }
assert_equal("dump load ", @log)
end
def load(io)
@log << "load "
assert_equal("dump data", io.read())
end
def dump(system, io)
@log << "dump "
assert_equal("hello world", system)
io.write("dump data")
end
end
class ErrorRaisingCommand
def execute(system)
raise "woo-hoo"
end
end
class ErrorHandlingTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"error-handling-base"
end
def test_exception_in_command
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
assert_raises(RuntimeError) do
madeleine.execute_command(ErrorRaisingCommand.new)
end
madeleine.close
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
madeleine.close
end
end
class QueryTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"query-base"
end
def test_querying
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
query = Object.new
def query.execute(system)
system.size
end
# 'query' is an un-marshallable singleton, so we implicitly test
# that querys aren't stored.
assert_equal(5, madeleine.execute_query(query))
# TODO: assert that no logging was done
# TODO: assert that lock was held
end
end
class TimeOptimizingLoggerTest < Test::Unit::TestCase
def setup
@target = Madeleine::Logger.new("some_directory", self)
@log = []
def @log.store(command)
self << command
end
end
def test_optimizing_ticks
assert_equal(0, @log.size)
@target.store(Madeleine::Clock::Tick.new(Time.at(3)))
assert_equal(0, @log.size)
@target.store(Madeleine::Clock::Tick.new(Time.at(22)))
assert_equal(0, @log.size)
@target.store(Addition.new(100))
assert_kind_of(Madeleine::Clock::Tick, @log[0])
assert_equal(22, value_of_tick(@log[0]))
assert_equal(100, @log[1].value)
assert_equal(2, @log.size)
end
def value_of_tick(tick)
@clock = Object.new
def @clock.forward_to(time)
@value = time.to_i
end
def @clock.value
@value
end
tick.execute(self)
@clock.value
end
# Self-shunt
def create_log(directory_name)
assert_equal("some_directory", directory_name)
@log
end
# Self-shunt
def clock
@clock
end
end
suite = Test::Unit::TestSuite.new("Madeleine")
suite << SnapshotMadeleineTest.suite
suite << NumberedFileTest.suite
suite << CommandLogTest.suite
suite << LoggerTest.suite
suite << CommandVerificationTest.suite
suite << CustomMarshallerTest.suite
suite << ErrorHandlingTest.suite
suite << QueryTest.suite
suite << TimeOptimizingLoggerTest.suite
require 'test_clocked'
add_clocked_tests(suite)
require 'test_automatic'
add_automatic_tests(suite)
require 'test_persistence'
add_persistence_tests(suite)
require 'test/unit/ui/console/testrunner'
Test::Unit::UI::Console::TestRunner.run(suite)
Tests don't leave junk directories around now.
#!/usr/local/bin/ruby -w
#
$LOAD_PATH.unshift("lib")
require 'madeleine'
require 'test/unit'
class Append
def initialize(value)
@value = value
end
def execute(system)
system << @value
end
end
module TestUtils
def delete_directory(directory_name)
Dir.foreach(directory_name) do |file|
next if file == "."
next if file == ".."
assert(File.delete(directory_name + File::SEPARATOR + file) == 1,
"Unable to delete #{file}")
end
Dir.delete(directory_name)
end
end
class SnapshotMadeleineTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(persistence_base)
end
def persistence_base
"closing-test"
end
def test_closing
madeleine = SnapshotMadeleine.new(persistence_base) { "hello" }
madeleine.close
assert_raises(RuntimeError) do
madeleine.execute_command(Append.new("world"))
end
end
end
class NumberedFileTest < Test::Unit::TestCase
def test_main
target = Madeleine::NumberedFile.new(File::SEPARATOR + "foo", "bar", 321)
assert_equal(File::SEPARATOR + "foo" + File::SEPARATOR +
"000000000000000000321.bar",
target.name)
end
end
class CommandLogTest < Test::Unit::TestCase
def setup
@target = Madeleine::CommandLog.new(".")
end
def teardown
@target.close
File.delete(expected_file_name)
end
def test_logging
f = open(expected_file_name, 'r')
assert(f.stat.file?)
@target.store(Addition.new(7))
read_command = Marshal.load(f)
assert_equal(Addition, read_command.class)
assert_equal(7, read_command.value)
assert_equal(f.stat.size, f.tell)
@target.store(Addition.new(3))
read_command = Marshal.load(f)
assert_equal(3, read_command.value)
assert_equal(f.stat.size, f.tell)
f.close
end
def expected_file_name
"000000000000000000001.command_log"
end
end
class LoggerTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory("whoah")
end
def test_creation
@log = Object.new
def @log.store(command)
unless defined? @commands
@commands = []
end
@commands << command
end
def @log.commands
@commands
end
log_factory = self
target = Madeleine::Logger.new("whoah", log_factory)
target.store(:foo)
assert(@log.commands.include?(:foo))
end
# Self-shunt
def create_log(directory_name)
@log
end
end
class CommandVerificationTest < Test::Unit::TestCase
def teardown
Dir.delete("foo")
end
def test_broken_command
target = SnapshotMadeleine.new("foo") { :a_system }
assert_raises(Madeleine::InvalidCommandException) do
target.execute_command(:not_a_command)
end
end
end
class CustomMarshallerTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"custom-marshaller-test"
end
def madeleine_class
SnapshotMadeleine
end
def test_changing_marshaller
@log = ""
marshaller = self
target = madeleine_class.new(prevalence_base, marshaller) { "hello world" }
target.take_snapshot
assert_equal("dump ", @log)
target = nil
madeleine_class.new(prevalence_base, marshaller) { flunk() }
assert_equal("dump load ", @log)
end
def load(io)
@log << "load "
assert_equal("dump data", io.read())
end
def dump(system, io)
@log << "dump "
assert_equal("hello world", system)
io.write("dump data")
end
end
class ErrorRaisingCommand
def execute(system)
raise "woo-hoo"
end
end
class ErrorHandlingTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"error-handling-base"
end
def test_exception_in_command
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
assert_raises(RuntimeError) do
madeleine.execute_command(ErrorRaisingCommand.new)
end
madeleine.close
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
madeleine.close
end
end
class QueryTest < Test::Unit::TestCase
include TestUtils
def teardown
delete_directory(prevalence_base)
end
def prevalence_base
"query-base"
end
def test_querying
madeleine = SnapshotMadeleine.new(prevalence_base) { "hello" }
query = Object.new
def query.execute(system)
system.size
end
# 'query' is an un-marshallable singleton, so we implicitly test
# that querys aren't stored.
assert_equal(5, madeleine.execute_query(query))
# TODO: assert that no logging was done
# TODO: assert that lock was held
end
end
class TimeOptimizingLoggerTest < Test::Unit::TestCase
include TestUtils
def setup
@target = Madeleine::Logger.new("some_directory", self)
@log = []
def @log.store(command)
self << command
end
end
def teardown
delete_directory("some_directory")
end
def test_optimizing_ticks
assert_equal(0, @log.size)
@target.store(Madeleine::Clock::Tick.new(Time.at(3)))
assert_equal(0, @log.size)
@target.store(Madeleine::Clock::Tick.new(Time.at(22)))
assert_equal(0, @log.size)
@target.store(Addition.new(100))
assert_kind_of(Madeleine::Clock::Tick, @log[0])
assert_equal(22, value_of_tick(@log[0]))
assert_equal(100, @log[1].value)
assert_equal(2, @log.size)
end
def value_of_tick(tick)
@clock = Object.new
def @clock.forward_to(time)
@value = time.to_i
end
def @clock.value
@value
end
tick.execute(self)
@clock.value
end
# Self-shunt
def create_log(directory_name)
assert_equal("some_directory", directory_name)
@log
end
# Self-shunt
def clock
@clock
end
end
suite = Test::Unit::TestSuite.new("Madeleine")
suite << SnapshotMadeleineTest.suite
suite << NumberedFileTest.suite
suite << CommandLogTest.suite
suite << LoggerTest.suite
suite << CommandVerificationTest.suite
suite << CustomMarshallerTest.suite
suite << ErrorHandlingTest.suite
suite << QueryTest.suite
suite << TimeOptimizingLoggerTest.suite
require 'test_clocked'
add_clocked_tests(suite)
require 'test_automatic'
add_automatic_tests(suite)
require 'test_persistence'
add_persistence_tests(suite)
require 'test/unit/ui/console/testrunner'
Test::Unit::UI::Console::TestRunner.run(suite)
|
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "built_in_data/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "built_in_data"
s.version = BuiltInData::VERSION
s.authors = ['Aaron Baldwin', 'Jonathan S. Garvin', 'WWIDEA, Inc']
s.email = ["developers@wwidea.org"]
s.homepage = "https://github.com/wwidea/built_in_data"
s.summary = "Data management for Rails models."
s.description = "BuiltInData is a simple tool for loading and updating data in a Rails application."
s.license = 'MIT'
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_dependency "rails", "~> 3.2.13"
s.add_development_dependency "sqlite3"
end
update rails dependency for rails 4
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "built_in_data/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "built_in_data"
s.version = BuiltInData::VERSION
s.authors = ['Aaron Baldwin', 'Jonathan S. Garvin', 'WWIDEA, Inc']
s.email = ["developers@wwidea.org"]
s.homepage = "https://github.com/wwidea/built_in_data"
s.summary = "Data management for Rails models."
s.description = "BuiltInData is a simple tool for loading and updating data in a Rails application."
s.license = 'MIT'
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_dependency "rails", ">= 3.2.13"
s.add_development_dependency "sqlite3"
end
|
#!/usr/bin/env ruby
# Socket::PF_INET
# Socket::SOCK_STREAM
# s = Socket.new Socket::INET, Socket::SOCK_STREAM
# s.connect Socket.pack_sockaddr_in(80, 'example.com')
# # Using TCPSocket
# s = TCPSocket.new 'example.com', 80
require "socket"
STATUS_EXP = %r{\AHTTP/(\d+\.\d+) (?<code>\d+)}
def set_light!(light, &callback)
# Hue Bridge generally gives us:
# * Response status line
# * 3x cache-related header
# * Connection close indicator
# * 5x access control header
# * Content type
# * Body separator (blank)
# * Response body, as a one-liner
# ... so we allocate 14 entries right off the bat to avoid reallocating any
# under-the-hood blocks of memory, etc.
timings = []
timings << Time.now.to_f
response = Array.new(14)
uri = "/api/1234567890/lights/#{light}/state"
timings << Time.now.to_f
s = TCPSocket.new("192.168.2.10", 80)
timings << Time.now.to_f
body = %({"hue":#{callback.call},"transitiontime":0})
len = body.length
s.puts("PUT #{uri} HTTP/1.0\nContent-Length: #{len}\n\n#{body}\n\n")
timings << Time.now.to_f
idx = 0
loop do
tmp = s.gets
break unless tmp
response[idx] = tmp
idx += 1
end
timings << Time.now.to_f
s.close
timings << Time.now.to_f
status = nil
body = []
state = :find_status
response.each do |line|
case state
when :find_status
matches = STATUS_EXP.match(line)
status = matches[:code].to_i if matches && matches[:code]
state = :find_body
when :find_body
state = :capture_body if line == "\r\n"
when :capture_body
body << line
end
end
timings << Time.now.to_f
[status,
body,
timings[1..-1].zip(timings).map { |(a, b)| ((a - b) * 1000).round }]
end
LIGHTS = [37, 36, 38, 39, 40, 35]
LAST_TIME = Array.new(LIGHTS.length)
def error?(status, body)
return true if status != 200
!!body.find { |line| line =~ /error/ }
end
start_time = Time.now.to_f
successes = 0
failures = 0
trap("EXIT") do
requests = successes + failures
end_time = Time.now.to_f
elapsed = end_time - start_time
puts
puts "Results: #{requests} requests in #{elapsed.round(2)} sec"
puts " #{successes} successes, #{failures} failures"
puts "Performance: #{(requests / elapsed).round(2)} req/sec"
puts "Stability: #{((successes / requests.to_f) * 100).round(1)}% succeeded"
puts
exit 0
end
iterations = 0
GC.disable
begin
loop do
break if iterations >= 30
iterations += 1
hue = Random.rand(65_535)
extra_wait = 0
LIGHTS.each do |light|
status, body, _timings = set_light!(light) { hue }
failed = error?(status, body)
if failed
failures += 1
extra_wait += 50
else
successes += 1
end
printf failed ? "-" : "*"
end
sleep 0.06 + (extra_wait / 1000.0)
printf " (#{extra_wait}ms)" if extra_wait > 0
puts
end
rescue Interrupt
puts "Goodbye."
end
This seems a hair more stable/robust...
#!/usr/bin/env ruby
# Socket::PF_INET
# Socket::SOCK_STREAM
# s = Socket.new Socket::INET, Socket::SOCK_STREAM
# s.connect Socket.pack_sockaddr_in(80, 'example.com')
# # Using TCPSocket
# s = TCPSocket.new 'example.com', 80
require "socket"
STATUS_EXP = %r{\AHTTP/(\d+\.\d+) (?<code>\d+)}
def set_light!(light, &callback)
# Hue Bridge generally gives us:
# * Response status line
# * 3x cache-related header
# * Connection close indicator
# * 5x access control header
# * Content type
# * Body separator (blank)
# * Response body, as a one-liner
# ... so we allocate 14 entries right off the bat to avoid reallocating any
# under-the-hood blocks of memory, etc.
timings = []
timings << Time.now.to_f
response = Array.new(14)
uri = "/api/1234567890/lights/#{light}/state"
timings << Time.now.to_f
s = TCPSocket.new("192.168.2.10", 80)
timings << Time.now.to_f
body = %({"hue":#{callback.call},"transitiontime":0})
len = body.length
s.puts("PUT #{uri} HTTP/1.0\nContent-Length: #{len}\n\n#{body}\n\n")
timings << Time.now.to_f
idx = 0
loop do
tmp = s.gets
break unless tmp
response[idx] = tmp
idx += 1
end
timings << Time.now.to_f
s.close
timings << Time.now.to_f
status = nil
body = []
state = :find_status
response.each do |line|
case state
when :find_status
matches = STATUS_EXP.match(line)
status = matches[:code].to_i if matches && matches[:code]
state = :find_body
when :find_body
state = :capture_body if line == "\r\n"
when :capture_body
body << line
end
end
timings << Time.now.to_f
[status,
body,
timings[1..-1].zip(timings).map { |(a, b)| ((a - b) * 1000).round }]
end
LIGHTS = [37, 36, 38, 39, 40, 35]
LAST_TIME = Array.new(LIGHTS.length)
def error?(status, body)
return true if status != 200
!!body.find { |line| line =~ /error/ }
end
start_time = Time.now.to_f
successes = 0
failures = 0
trap("EXIT") do
requests = successes + failures
end_time = Time.now.to_f
elapsed = end_time - start_time
puts
puts "Results: #{requests} requests in #{elapsed.round(2)} sec"
puts " #{successes} successes, #{failures} failures"
puts "Performance: #{(requests / elapsed).round(2)} req/sec"
puts "Stability: #{((successes / requests.to_f) * 100).round(1)}% succeeded"
puts
exit 0
end
iterations = 0
GC.disable
begin
loop do
break if iterations >= 30
iterations += 1
hue = Random.rand(65_535)
extra_wait = 0
LIGHTS.each do |light|
status, body, _timings = set_light!(light) { hue }
failed = error?(status, body)
if failed
failures += 1
extra_wait += 10
else
successes += 1
end
printf failed ? "-" : "*"
sleep 0.015 + (extra_wait / 1000.0)
end
# sleep 0.08 + (extra_wait / 1000.0)
printf " (#{extra_wait}ms)" if extra_wait > 0
puts
end
rescue Interrupt
puts "Goodbye."
end
|
simple run and compare harness for different algos
#!/usr/bin/env ruby
# arg1 = number of entries to take from test data
USE_RUBY = false
raise "usage: test.rb NUM_ENTRIES MIN_RESEMBLANCE=0.6" unless ARGV.size==1 or ARGV.size==2
N = ARGV[0].to_i
MIN_RES = ARGV[1] ? ARGV[1].to_f : 0.6
puts "NUM_ENTRIES=#{N} MIN_RESEMBLANCE=#{MIN_RES}"
raise "test.rb configured to assume min_resem >= 0.6" unless MIN_RES >= 0.6 and MIN_RES <= 1
alias _puts puts
def puts msg
_puts "#{Time.now} #{msg}"
end
def time_call
start = Time.now
yield
puts "time #{Time.now-start}s"
end
def run_unless_file_exists file
if File.exists? file
puts "using cached version of #{file}"
else
puts "calculating #{file}"
yield
end
end
def head_command n
# "head -n #{n} name_addr | perl -pnle'tr/A-Z/a-z/'"
"head -n #{n} name_addr"
end
def run command
puts "exec #{command}"
`#{command}`
end
def combine_resemblance_results file
puts "combining resemblance.out files"
resems = Dir.glob("resemblance.*.out")
resems_sorted = resems.collect {|r| "#{r}.sorted"}
resems.zip(resems_sorted).each { |p| `sort -rn -k3 < #{p[0]} > #{p[1]}` }
`sort -rnm -k3 #{resems_sorted.join(' ')} > #{file}`
resems.each { |r| File.delete(r) }
resems_sorted.each { |r| File.delete(r) }
end
puts "---running #{N} entries"
# assuming never want to compare any resemblances UNDER 0.6 so
# its hardcoded. strange things happen if a run is done with x and then y using
# cached x when y < x
puts "---running shingling (#{USE_RUBY ? "ruby" : "cpp"} version)"
file = "shingle.result.#{N}"
run_unless_file_exists(file) do
if USE_RUBY
time_call { run "#{head_command(N)} | ruby shingle.rb coeff 0.6 > #{file}" }
`cat #{file} | sort -rn -k3 > tmp.#{$$}`
`mv tmp.#{$$} #{file}`
else
time_call { run "#{head_command(N)} | ./cpp/bin/Release/resemblance 0.6" }
combine_resemblance_results file
end
end
puts "#lines= #{`wc -l shingle.result.#{N}`}"
=begin
NUM_BITS = 64
puts "---running simhash #{NUM_BITS} bit"
file = "simhash.result.#{N}.#{NUM_BITS}"
run_unless_file_exists(file) do
time_call { run "head -n #{N} name_addr | ruby simhash.rb #{NUM_BITS} 0.6" }
combine_resemblance_results file
end
puts "#lines= #{`wc -l #{file}`}"
puts run "./compare.rb shingle.result.#{N} #{file} #{MIN_RES}"
=end
def compare_sketch num_bits, sketch_size, cutoff
puts "---running sketch num_bits=#{num_bits} sketch_size=#{sketch_size} cutoff=#{cutoff}"
file = "sketch.result.#{N}.#{num_bits}b.#{sketch_size}s.#{cutoff}c"
run_unless_file_exists(file) do
time_call { run "#{head_command(N)} | ruby sketch.rb #{num_bits} #{sketch_size} #{cutoff} > #{file}" }
end
puts "#lines= #{`wc -l #{file}`}"
puts run "./compare.rb shingle.result.#{N} #{file} #{MIN_RES}"
end
compare_sketch 64, 10, 2
|
$: << 'lib'
require 'travis'
require 'resque/heartbeat'
handler do |job|
Resque.redis = Travis.config['redis']['url']
Resque.prune_dead_workers
end
every 5.seconds, 'travis.purge_dead_workers'
try disconnecting from redis in clock.rb
$: << 'lib'
require 'travis'
require 'resque/heartbeat'
handler do |job|
Resque.redis = Travis.config['redis']['url']
Resque.prune_dead_workers
Resque.redis.instance_variable_get(:@redis).client.disconnect
end
every 5.seconds, 'travis.purge_dead_workers'
|
Gem::Specification.new do |gem|
gem.name = "config-parser"
gem.summary = %Q{Parsing an options.yml file into a Hash with convenience.}
gem.description = "Parsing an options.yml file into a Hash with convenience methods like
overwriting variables per Rails environment and overwriting variables with a local
options_local.yml file."
gem.homepage = "https://github.com/openSUSE/rubygem_config-parser"
gem.authors = ['cschum@suse.de', 'tom@opensuse.org']
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.require_paths = ['lib']
gem.version = '0.1'
end
Bump version
Gem::Specification.new do |gem|
gem.name = "config-parser"
gem.summary = %Q{Parsing an options.yml file into a Hash with convenience.}
gem.description = "Parsing an options.yml file into a Hash with convenience methods like
overwriting variables per Rails environment and overwriting variables with a local
options_local.yml file."
gem.homepage = "https://github.com/openSUSE/rubygem_config-parser"
gem.authors = ['cschum@suse.de', 'tom@opensuse.org']
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.require_paths = ['lib']
gem.version = '0.2'
end
|
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{transmission-connect}
s.version = "0.2.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dmitry Brazhkin"]
s.date = %q{2011-04-12}
s.description = %q{Simple connector to transmission bittorrent client by HTTP-RPC}
s.email = %q{dbrazhkin@gmail.com}
s.extra_rdoc_files = [
"LICENSE.txt",
"README.rdoc"
]
s.files = [
".document",
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
"README.rdoc",
"Rakefile",
"VERSION",
"lib/transmission-connect.rb",
"lib/transmission-connect/client.rb",
"test/helper.rb",
"test/test_client.rb",
"test/test_transmission-connect.rb",
"transmission-connect.gemspec"
]
s.homepage = %q{http://github.com/Daem0n/transmission-connect}
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.7.2}
s.summary = %q{Simple connector to transmission bittorrent client}
s.test_files = [
"test/helper.rb",
"test/test_client.rb",
"test/test_transmission-connect.rb"
]
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<json>, [">= 0"])
s.add_development_dependency(%q<shoulda>, [">= 0"])
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_development_dependency(%q<rcov>, [">= 0"])
else
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_dependency(%q<rcov>, [">= 0"])
end
else
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_dependency(%q<rcov>, [">= 0"])
end
end
Regenerate gemspec for version 0.3.0
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{transmission-connect}
s.version = "0.3.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Dmitry Brazhkin"]
s.date = %q{2011-04-19}
s.description = %q{Simple connector to transmission bittorrent client by HTTP-RPC}
s.email = %q{dbrazhkin@gmail.com}
s.executables = ["transmission.rb"]
s.extra_rdoc_files = [
"LICENSE.txt",
"README.rdoc"
]
s.files = [
".document",
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
"README.rdoc",
"Rakefile",
"VERSION",
"bin/transmission.rb",
"config/transmission.yml",
"lib/transmission-connect.rb",
"lib/transmission-connect/client.rb",
"lib/transmission-connect/configuration.rb",
"test/helper.rb",
"test/test_client.rb",
"test/test_transmission-connect.rb",
"transmission-connect.gemspec"
]
s.homepage = %q{http://github.com/Daem0n/transmission-connect}
s.licenses = ["MIT"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.7.2}
s.summary = %q{Simple connector to transmission bittorrent client}
s.test_files = [
"test/helper.rb",
"test/test_client.rb",
"test/test_transmission-connect.rb"
]
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<json>, [">= 0"])
s.add_runtime_dependency(%q<transmission-client>, [">= 0.0.3"])
s.add_development_dependency(%q<shoulda>, [">= 0"])
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_development_dependency(%q<rcov>, [">= 0"])
else
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<transmission-client>, [">= 0.0.3"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_dependency(%q<rcov>, [">= 0"])
end
else
s.add_dependency(%q<json>, [">= 0"])
s.add_dependency(%q<transmission-client>, [">= 0.0.3"])
s.add_dependency(%q<shoulda>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
s.add_dependency(%q<rcov>, [">= 0"])
end
end
|
module PersonMatchStrategies
class FirstLastDob
def match(options = {})
return [nil, nil] if options[:dob].blank?
name_first_regex = Regexp.compile(Regexp.escape(options[:name_first].to_s.strip.downcase), true)
name_last_regex = Regexp.compile(Regexp.escape(options[:name_last].to_s.strip.downcase), true)
search_dob = cast_dob(options[:dob], options)
found_people = Person.where({"members.dob" => search_dob, "name_first" => name_first_regex, "name_last" => name_last_regex})
if found_people.any?
if found_people.many?
raise AmbiguousMatchError.new("Multiple people with same first, last, and dob: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
else
select_authority_member(found_people.first, options)
end
else
[nil, nil]
end
end
def cast_dob(dob, options)
if dob.kind_of?(Date)
return dob
elsif dob.kind_of?(DateTime)
return dob
end
begin
Date.parse(dob)
rescue
raise AmbiguousMatchError.new("Invalid DOB: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
end
end
def select_authority_member(person, options)
if !person.authority_member.present?
raise AmbiguousMatchError.new("No authority member for person with first, last, and dob: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
end
[person, person.authority_member]
end
end
end
Don't run the dob match if they don't provide dob.
module PersonMatchStrategies
class FirstLastDob
def match(options = {})
return([nil, nil]) if options[:dob].blank?
name_first_regex = Regexp.compile(Regexp.escape(options[:name_first].to_s.strip.downcase), true)
name_last_regex = Regexp.compile(Regexp.escape(options[:name_last].to_s.strip.downcase), true)
search_dob = cast_dob(options[:dob], options)
found_people = Person.where({"members.dob" => search_dob, "name_first" => name_first_regex, "name_last" => name_last_regex})
if found_people.any?
if found_people.many?
raise AmbiguousMatchError.new("Multiple people with same first, last, and dob: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
else
select_authority_member(found_people.first, options)
end
else
[nil, nil]
end
end
def cast_dob(dob, options)
if dob.kind_of?(Date)
return dob
elsif dob.kind_of?(DateTime)
return dob
end
begin
Date.parse(dob)
rescue
raise AmbiguousMatchError.new("Invalid DOB: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
end
end
def select_authority_member(person, options)
if !person.authority_member.present?
raise AmbiguousMatchError.new("No authority member for person with first, last, and dob: #{options[:name_first]}, #{options[:name_last]}, #{options[:dob]}")
end
[person, person.authority_member]
end
end
end
|
Deface::Override.new(
:name => 'remove_wrapper_grid_class',
:virtual_path => 'spree/layouts/spree_application',
:set_attributes => '#wrapper',
:attributes => {:class => ''})
Deface::Override.new(
:name => 'wrap_wrapper_content_in_row',
:virtual_path => 'spree/layouts/spree_application',
:surround_contents => '#wrapper',
:text => '<div class="row"><%= render_original %></div>')
Deface::Override.new(
:name => 'change_content_grid_class',
:virtual_path => 'spree/layouts/spree_application',
:set_attributes => '#content',
:attributes => {
"data-erb-class" => '<%= !content_for?(:sidebar) ? "span12" : "span9" %>'
})
Move breadcrumbs inside content
Deface::Override.new(
:name => 'remove_wrapper_grid_class',
:virtual_path => 'spree/layouts/spree_application',
:set_attributes => '#wrapper',
:attributes => {:class => ''})
Deface::Override.new(
:name => 'wrap_wrapper_content_in_row',
:virtual_path => 'spree/layouts/spree_application',
:surround_contents => '#wrapper',
:text => '<div class="row"><%= render_original %></div>')
Deface::Override.new(
:name => 'change_content_grid_class',
:virtual_path => 'spree/layouts/spree_application',
:set_attributes => '#content',
:attributes => {
"data-erb-class" => '<%= !content_for?(:sidebar) ? "span12" : "span9" %>'
})
Deface::Override.new(
:name => 'remove_breadcrumbs',
:virtual_path => 'spree/layouts/spree_application',
:remove => 'code[erb-loud]:contains("breadcrumbs")')
Deface::Override.new(
:name => 'add_breadcrumbs_into_content_area',
:virtual_path => 'spree/layouts/spree_application',
:insert_top => '#content',
:text => '<%= breadcrumbs(@taxon) %>')
|
require 'thor'
require 'httmultiparty'
require 'crossfader/rcfile'
module Crossfader
class CLI < Thor
include HTTMultiParty
base_uri 'http://api.djz.com/v3'
def initialize(*)
@rcfile = Crossfader::RCFile.instance
@loop_ids = []
super
end
desc 'auth', 'Allow the user to get their api access token'
def auth
say "Welcome! Before you can use crossfader, you'll first need to log in"
say 'to your account and get an access token. Follow the steps below:'
email = ask 'Enter your crossdfader.fm email address: '
password = ask('Enter your crossfader.fm password: ', :echo => false)
options = { :body => {email: email, password: password } }
response = self.class.post('/users/login', options)
if response.code == 200
@rcfile[email] = { email: email, api_access_token: response['api_access_token'], dj_name: response['dj_name'] }
say "\nAuthorized successfully!\n"
else
say "\nSomething went wrong. Tell Adam.\n"
end
end
desc 'convert', 'Batch convert .wav files to .mp3 files'
def convert
say "Let's convert wavs to MP3s!"
dir = ask('Select a folder of loops to convert: ')
dir = dir.gsub(/\\/, "").strip
Dir.foreach(dir) { |file| convert_wav_to_mp3(file.to_s, dir.to_s) }
say "The loops were converted successfully"
end
desc 'upload', 'Batch upload loops'
def upload
say "Time to upload some loops!"
dir = ask('Select a folder of loops to upload: ')
dir = dir.gsub(/\\/, "").strip
Dir.foreach(dir) { |file| create_loop_from_file(file, dir) }
say "The loops were uploaded successfully"
end
desc 'create_pack', 'Create a new pack'
def create_pack
say "Create a new pack? That's a great idea!"
pack_name = ask "What should we call this pack?"
pack_sub = ask "Enter the subtitle for this pack:"
response = create_new_pack(pack_name, pack_sub)
say response
if response.code == 200
say "Successfully created a pack named #{pack_name}"
else
say "Something went wrong."
end
end
desc 'help', "Show available commands."
def help
say "\nYou can perform the following actions:"
say "---\n\n"
say "\`crossfader auth\` Authorize this app to work with the Crossfader.fm API.\n"
say "\`crossfader convert\` : Convert a folder of .wav files to .mp3.\n"
say "\`crossfader upload\` : Upload a folder of .mp3s to the server to create new loops.\n"
say "\`crossfader batch\` : Create a new pack, convert a folder of .wav files to .mp3 files and upload them to the server in one step.\n"
say "\`crossfader create_pack\` : Create a new empty pack.\n\n"
say "---\n"
say "Have questions, comments, or feed back? Contact Adam at adam@djz.com\n\n"
end
desc 'batch', "Create a new pack, convert wavs to mp3s, upload mp3s/jpgs as loops, and add loops to pack."
def batch
say "Time to batch convert and upload!"
pack_name = ask "What do you want to name your new pack?"
pack_sub = ask "Enter the subtitle for this pack:"
dir = ask('Select a folder of loops to process and upload:')
clean_dir = dir.gsub(/\\/, '').strip
say clean_dir
Dir.foreach(clean_dir) { |file| convert_wav_to_mp3(file.to_s, clean_dir.to_s) }
Dir.foreach(clean_dir) { |file| create_loop_from_file(file.to_s, clean_dir.to_s) }
response = create_new_pack(pack_name, pack_sub)
if response.code == 200
say "Success!"
else
say "Something went wrong."
end
end
private
def convert_wav_to_mp3(file, dir)
file_path = File.join(dir, file)
if File.file? file_path and File.extname(file_path) == ".wav"
mp3_path = "#{file_path}.mp3".gsub!('.wav', '')
mp3_path_low = "#{file_path}-low.mp3".gsub!('.wav', '')
%x(lame -b 192 -h "#{file_path}" "#{mp3_path}")
%x(lame -b 96 -m m -h "#{file_path}" "#{mp3_path_low}")
end
end
def create_loop_from_file(file, dir)
file_path = File.join(dir, file)
if File.file? file_path and File.extname(file_path) == ".wav"
loop_high = open(file_path.gsub('.wav', '.mp3'), 'r+b')
loop_low = open(file_path.gsub('.wav', '-low.mp3'), 'r+b')
artwork = open(file_path.gsub('.wav', '.jpg'), 'r+b')
length, bpm, key, artist, title = file.to_s.gsub('.mp3', '').split(' - ')
headers = { 'Authorization' => "Token: #{@rcfile.api_access_token}" }
body = { title: title, type: 'loop', content: { artist_name: artist, bpm: bpm, key: key, bar_count: length, loop_type: "Instrumental Song" }, loop_high: loop_high, loop: loop_low, artwork: artwork, published: 'true' }
options = { headers: headers , body: body }
response = self.class.post('/feed_items', options)
@loop_ids << response['id']
say "New loop for #{title} created with an id of #{response['id']}"
end
end
def create_new_pack(pack_name, pack_sub)
headers = { 'Authorization' => "Token: #{@rcfile.api_access_token}" }
body = { title: pack_name, content: { subtitle: pack_sub }, type: 'pack', pack_items: @loop_ids }
options = { headers: headers , body: body }
response = self.class.post('/feed_items', options)
return response
end
end
end
keep uploading high quality mp3 as primary audio track
require 'thor'
require 'httmultiparty'
require 'crossfader/rcfile'
module Crossfader
class CLI < Thor
include HTTMultiParty
base_uri 'http://api.djz.com/v3'
def initialize(*)
@rcfile = Crossfader::RCFile.instance
@loop_ids = []
super
end
desc 'auth', 'Allow the user to get their api access token'
def auth
say "Welcome! Before you can use crossfader, you'll first need to log in"
say 'to your account and get an access token. Follow the steps below:'
email = ask 'Enter your crossdfader.fm email address: '
password = ask('Enter your crossfader.fm password: ', :echo => false)
options = { :body => {email: email, password: password } }
response = self.class.post('/users/login', options)
if response.code == 200
@rcfile[email] = { email: email, api_access_token: response['api_access_token'], dj_name: response['dj_name'] }
say "\nAuthorized successfully!\n"
else
say "\nSomething went wrong. Tell Adam.\n"
end
end
desc 'convert', 'Batch convert .wav files to .mp3 files'
def convert
say "Let's convert wavs to MP3s!"
dir = ask('Select a folder of loops to convert: ')
dir = dir.gsub(/\\/, "").strip
Dir.foreach(dir) { |file| convert_wav_to_mp3(file.to_s, dir.to_s) }
say "The loops were converted successfully"
end
desc 'upload', 'Batch upload loops'
def upload
say "Time to upload some loops!"
dir = ask('Select a folder of loops to upload: ')
dir = dir.gsub(/\\/, "").strip
Dir.foreach(dir) { |file| create_loop_from_file(file, dir) }
say "The loops were uploaded successfully"
end
desc 'create_pack', 'Create a new pack'
def create_pack
say "Create a new pack? That's a great idea!"
pack_name = ask "What should we call this pack?"
pack_sub = ask "Enter the subtitle for this pack:"
response = create_new_pack(pack_name, pack_sub)
say response
if response.code == 200
say "Successfully created a pack named #{pack_name}"
else
say "Something went wrong."
end
end
desc 'help', "Show available commands."
def help
say "\nYou can perform the following actions:"
say "---\n\n"
say "\`crossfader auth\` Authorize this app to work with the Crossfader.fm API.\n"
say "\`crossfader convert\` : Convert a folder of .wav files to .mp3.\n"
say "\`crossfader upload\` : Upload a folder of .mp3s to the server to create new loops.\n"
say "\`crossfader batch\` : Create a new pack, convert a folder of .wav files to .mp3 files and upload them to the server in one step.\n"
say "\`crossfader create_pack\` : Create a new empty pack.\n\n"
say "---\n"
say "Have questions, comments, or feed back? Contact Adam at adam@djz.com\n\n"
end
desc 'batch', "Create a new pack, convert wavs to mp3s, upload mp3s/jpgs as loops, and add loops to pack."
def batch
say "Time to batch convert and upload!"
pack_name = ask "What do you want to name your new pack?"
pack_sub = ask "Enter the subtitle for this pack:"
dir = ask('Select a folder of loops to process and upload:')
clean_dir = dir.gsub(/\\/, '').strip
say clean_dir
Dir.foreach(clean_dir) { |file| convert_wav_to_mp3(file.to_s, clean_dir.to_s) }
Dir.foreach(clean_dir) { |file| create_loop_from_file(file.to_s, clean_dir.to_s) }
response = create_new_pack(pack_name, pack_sub)
if response.code == 200
say "Success!"
else
say "Something went wrong."
end
end
private
def convert_wav_to_mp3(file, dir)
file_path = File.join(dir, file)
if File.file? file_path and File.extname(file_path) == ".wav"
mp3_path = "#{file_path}.mp3".gsub!('.wav', '')
mp3_path_low = "#{file_path}-low.mp3".gsub!('.wav', '')
%x(lame -b 192 -h "#{file_path}" "#{mp3_path}")
%x(lame -b 96 -m m -h "#{file_path}" "#{mp3_path_low}")
end
end
def create_loop_from_file(file, dir)
file_path = File.join(dir, file)
if File.file? file_path and File.extname(file_path) == ".wav"
loop_high = open(file_path.gsub('.wav', '.mp3'), 'r+b')
loop_low = open(file_path.gsub('.wav', '-low.mp3'), 'r+b')
artwork = open(file_path.gsub('.wav', '.jpg'), 'r+b')
length, bpm, key, artist, title = file.to_s.gsub('.mp3', '').split(' - ')
headers = { 'Authorization' => "Token: #{@rcfile.api_access_token}" }
body = { title: title, type: 'loop', content: { artist_name: artist, bpm: bpm, key: key, bar_count: length, loop_type: "Instrumental Song" }, loop: loop_high, loop_low: loop_low, artwork: artwork, published: 'true' }
options = { headers: headers , body: body }
response = self.class.post('/feed_items', options)
@loop_ids << response['id']
say "New loop for #{title} created with an id of #{response['id']}"
end
end
def create_new_pack(pack_name, pack_sub)
headers = { 'Authorization' => "Token: #{@rcfile.api_access_token}" }
body = { title: pack_name, content: { subtitle: pack_sub }, type: 'pack', pack_items: @loop_ids }
options = { headers: headers , body: body }
response = self.class.post('/feed_items', options)
return response
end
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.