mdv 0.1.2 (new formula)

mdv (new formula)

Closes #31.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
This commit is contained in:
Decors 2016-04-04 13:22:17 +09:00 committed by Andrew Janke
parent fbe564f15d
commit 465d0f7d23

48
Formula/mdv.rb Normal file
View file

@ -0,0 +1,48 @@
class Mdv < Formula
desc "Styled terminal markdown viewer"
homepage "https://github.com/axiros/terminal_markdown_viewer"
url "https://github.com/axiros/terminal_markdown_viewer/archive/v0.1.2.tar.gz"
sha256 "547f223658714d130f3a642d2aa366239f16d05ae93caf54e87f3d07455c5f1c"
head "https://github.com/axiros/terminal_markdown_viewer.git"
depends_on :python if MacOS.version <= :snow_leopard
resource "markdown" do
url "https://pypi.python.org/packages/source/M/Markdown/Markdown-2.6.5.tar.gz"
sha256 "8d94cf6273606f76753fcb1324623792b3738c7612c2b180c85cc5e88642e560"
end
resource "pygments" do
url "https://pypi.python.org/packages/source/P/Pygments/Pygments-2.1.tar.gz"
sha256 "13a0ef5fafd7b16cf995bc28fe7aab0780dab1b2fda0fc89e033709af8b8a47b"
end
resource "yaml" do
url "https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz"
sha256 "c36c938a872e5ff494938b33b14aaa156cb439ec67548fcab3535bb78b0846e8"
end
def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
%w[markdown pygments yaml].each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
(libexec/"bin").install %w[mdv.py docopt.py tabulate.py ansi_tables.json]
bin.install_symlink "mdv.py" => "mdv"
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
(testpath/"test.md").write <<-EOF.undent
# Header 1
## Header 2
### Header 3
EOF
system "#{bin}/mdv", "#{testpath}/test.md"
end
end