tl;dr
homebrew-[name]
brew tap [user name]/[name]
brew install [name]
This time, I prepared a simple script that just converts dollars to yen. Flow until Web API is dropped into a command line tool using Python This will allow you to brew install
First, create a repository named homebrew-usdex and clone it.
$ git clone https://github.com/kei-sato/homebrew-usdex.git
$ cd homebrew-usdex
Create a file called [name] .rb in the root
usdex.rb
class Usdex < Formula
desc "Exchange usd to any currency, or any currency to usd"
homepage "https://gist.github.com/kei-sato/98675769952ec7538d6a"
url "https://gist.githubusercontent.com/kei-sato/98675769952ec7538d6a/raw/3b041cdd0e93c93986b15d158bff158927cb84b1/usdex"
sha256 "976ae1b2066b2cb40be934fb2265ccd3bd8489f78683c6eaecba29c50edd4758"
version "1.0.0"
def install
bin.install "usdex"
end
end
Then push, tap, install
$ git push origin master
$ brew tap kei-sato/usdex
$ brew install usdex
$ usdex -p 2.5 -v
1(USD) => 122.54078(JPY)
2.5(USD) => 306.35195(JPY)
SHA256? SHA-256 (Secure Hash Algorithm 256-bit)
SHA-256 is one of the calculation procedures (algorithms) for finding the "hash value", which is a characteristic value of fixed length, from the original text of arbitrary length.
Can be generated with openssl
$ echo "hello" | openssl dgst -sha256
5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
$ echo "hello, world" | openssl dgst -sha256
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$ echo "hello, world" > /tmp/hello
$ openssl dgst -sha256 /tmp/hello
SHA256(/tmp/hello)= 853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
Generate a hash value for the file you download with Homebrew
$ openssl dgst -sha256 usdex
SHA256(usdex)= 976ae1b2066b2cb40be934fb2265ccd3bd8489f78683c6eaecba29c50edd4758
http://deeeet.com/writing/2014/05/20/brew-tap/ http://qiita.com/masawada/items/484bbf83ef39cad7af74
Recommended Posts