Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

DSL: document the new-style header line #251

Merged
merged 2 commits into from
Nov 13, 2014
Merged
Show file tree
Hide file tree
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
22 changes: 6 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Making a Font Cask is easy: a Cask is a small Ruby file.

Here's a Cask for the font [Inconsolata](http://levien.com/type/myfonts/inconsolata.html) as an example:
```ruby
class FontInconsolata < Cask
cask :v1 => 'font-inconsolata' do
version :latest
sha256 :no_check

Expand All @@ -29,7 +29,7 @@ Note that you may repeat the `font` stanza as many times as you need to, if mult
be installed from the same package:

```ruby
class FontFantasqueSansMono < Cask
cask :v1 => 'font-fantasque-sans-mono' do
version '1.6.4'
sha256 'da5a7f84ac0e1c02b49334690d7451d936691718fb1332f863eacc521816dccd'

Expand Down Expand Up @@ -105,22 +105,12 @@ To get from the Font's canonical name to the Cask name:
Casks are stored in a Ruby file matching their name. That is, the "cask
name" derived above, followed by the `.rb` file extension.

### Class Names

Casks are implemented as Ruby classes, so a Font Cask's "class" needs to be
a valid Ruby class name.

To get from a Cask name to a Class name:

* convert to UpperCamelCased form
* wherever a hyphen occurs in the __Cask name__, the __Class name__ has a case change

### Font Name Examples

Canonical Font Name | Cask Name | Cask Class
--------------------|----------------------|------------------------
Anonymous Pro | `font-anonymous-pro` | `FontAnonymousPro`
FreeSans | `font-freesans` | `FontFreesans`
Canonical Font Name | Cask Name
--------------------|----------------------
Anonymous Pro | `font-anonymous-pro`
FreeSans | `font-freesans`

## Multiple Fonts per Cask

Expand Down
3 changes: 1 addition & 2 deletions developer/bin/font_casker
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# TODO:
# font_cask_namer
# cask name - relevant code is in cask_namer
# class name - relevant code is in cask_namer
# font version
# report/resolve version conflicts
# cask generation
Expand Down Expand Up @@ -128,7 +127,7 @@ end
# todo: named parameters, after switching to Ruby 2.x
def caskify(family, klass, version, sha, url, homepage, paths)
output = ["FAMILY: #{family}"]
output << 'class FIXME < Cask'
output << %q{cask :v1 => 'FIXME' do}
output << stanzify('version', version)
output << stanzify('sha256', sha)
output << ''
Expand Down