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

adding ruby syntax highlighting #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
51 changes: 32 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,26 @@ depends will go here.

Here's an example `Cheffile`:

site "https://supermarket.getchef.com/api/v1"
```ruby
site "https://supermarket.getchef.com/api/v1"

cookbook "ntp"
cookbook "timezone", "0.0.1"
cookbook "ntp"
cookbook "timezone", "0.0.1"

cookbook "rvm",
:git => "https://github.com/fnichol/chef-rvm",
:ref => "v0.7.1"
cookbook "rvm",
:git => "https://github.com/fnichol/chef-rvm",
:ref => "v0.7.1"

cookbook "cloudera",
:path => "vendor/cookbooks/cloudera-cookbook"
cookbook "cloudera",
:path => "vendor/cookbooks/cloudera-cookbook"
```

Here's how it works:

We start off by declaring the *default source* for this `Cheffile`.

site "https://supermarket.getchef.com/api/v1"
```ruby
site "https://supermarket.getchef.com/api/v1"
```

This default source in this example is the Opscode Community Site API. This is
most likely what you will want for your default source. However, you can
Expand All @@ -72,19 +75,25 @@ Any time we declare a cookbook dependency that has subsidiary cookbook
dependencies of its own, Librarian-Chef assumes we want it to look for the
subsidiary cookbook dependencies in the default source.

cookbook "ntp"
```ruby
cookbook "ntp"
```

Our infrastructure repository depends on the `ntp` cookbook from the default
source. Any version of the `ntp` cookbook will fulfill our requirements.

cookbook "timezone", "0.0.1"
```ruby
cookbook "timezone", "0.0.1"
```

Our infrastructure repository depends on the `timezone` cookbook from the
default source. But only version `0.0.1` of that cookbook will do.

cookbook "rvm",
:git => "https://github.com/fnichol/chef-rvm",
:ref => "v0.7.1"
```ruby
cookbook "rvm",
:git => "https://github.com/fnichol/chef-rvm",
:ref => "v0.7.1"
```

Our infrastructure repository depends on the `rvm` cookbook, but not the one
from the default source. Instead, the cookbook is to be fetched from the
Expand All @@ -107,8 +116,10 @@ with many cookbooks in it. If we need a cookbook from such a repository, we can
use the `:path =>` option here to help Librarian-Chef drill down and find the
cookbook subdirectory.

cookbook "cloudera",
:path => "vendor/cookbooks/cloudera-cookbook"
```ruby
cookbook "cloudera",
:path => "vendor/cookbooks/cloudera-cookbook"
```

Our infrastructure repository depends on the `cloudera` cookbook, which we have
downloaded and copied into our repository. In this example, `vendor/cookbooks/`
Expand All @@ -121,8 +132,10 @@ option.

Also, there is shortcut for cookbooks hosted on GitHub, so we may write:

cookbook "rvm",
:github => "fnichol/chef-rvm"
```ruby
cookbook "rvm",
:github => "fnichol/chef-rvm"
```

### How to Use

Expand Down