Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diesel 1.4.3 (new formula) #46458

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Formula/diesel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Diesel < Formula
desc "Command-line tool for Rust ORM Diesel"
homepage "https://diesel.rs"
url "https://github.com/diesel-rs/diesel/archive/v1.4.3.tar.gz"
sha256 "79769964028e5cc85219d100d4945d69a5d2ec5a4125c36fd50b9ef1dc326d5a"

head "https://github.com/diesel-rs/diesel.git"

depends_on "rust" => [:build, :test]
depends_on "libpq"
depends_on "mysql-client"
uses_from_macos "sqlite"

def install
system "cargo", "install", "--root", prefix, "--path", "diesel_cli"

system "#{bin}/diesel completions bash > diesel.bash"
system "#{bin}/diesel completions zsh > _diesel"
system "#{bin}/diesel completions fish > diesel.fish"

bash_completion.install "diesel.bash"
zsh_completion.install "_diesel"
fish_completion.install "diesel.fish"
Comment on lines +17 to +23
Copy link
Member

Choose a reason for hiding this comment

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

end

test do
ENV["DATABASE_URL"] = "db.sqlite"
system "cargo", "init"
system bin/"diesel", "setup"
assert_predicate testpath/"db.sqlite", :exist?, "SQLite database should be created"
end
end