Skip to content

Commit

Permalink
Change code blocks in readme to fenced
Browse files Browse the repository at this point in the history
  • Loading branch information
Nullreff committed Jan 19, 2014
1 parent 4fb47f3 commit 2026f28
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,39 +60,53 @@ Usage

Bukin works by reading a list of dependencies from a `Bukfile`. The most basic usage would be:

echo "server 'craftbukkit'" > Bukfile
bukin install
```bash
echo "server 'craftbukkit'" > Bukfile
bukin install
```

Specify a server using the `server` keyword and a plugin using the `plugin` keyword.

server 'craftbukkit'
plugin 'worldedit'
plugin 'worldguard'
```ruby
server 'craftbukkit'
plugin 'worldedit'
plugin 'worldguard'
```

You can specify specific versions of a plugin or server to install. Craftbukkit uses its own [special version naming](http://dl.bukkit.org/about/) (artifact slugs).

server 'craftbukkit', 'build-2754'
plugin 'worldedit', '5.5.5'
plugin 'worldguard', '5.7.3'
```ruby
server 'craftbukkit', 'build-2754'
plugin 'worldedit', '5.5.5'
plugin 'worldguard', '5.7.3'
```

By default, bukin will try to download jar files from bukkit dev. If only zip files are available, it will automatically extract all jar files from it. If you want to specify what files are extracted from a zip file, use the `extract` option. It takes a string or [ruby regular expression](http://ruby-doc.org/core-1.9.3/Regexp.html) used to match file names in the zip file.

plugin 'permissionsex', '1.19.5', extract: /PermissionsEx.*\.jar/
```ruby
plugin 'permissionsex', '1.19.5', extract: /PermissionsEx.*\.jar/
```

Plugins or servers can also be downloaded from Jenkins. Just specify the base url for Jenkins and a [ruby regular expression](http://ruby-doc.org/core-1.9.3/Regexp.html) matching the file you want to download. If no file is specified, bukin will download the first one listed.

server 'spigot', 'build-844', jenkins: 'http://ci.md-5.net', file: /spigot\.jar/
```ruby
server 'spigot', 'build-844', jenkins: 'http://ci.md-5.net', file: /spigot\.jar/
```

Need something custom? Use the `download` option. Version is optional but will display when the plugin is downloading.

plugin 'mycustomplugin', '2.4', download: 'http://example.com/My-Custom-Plugin.jar'
```ruby
plugin 'mycustomplugin', '2.4', download: 'http://example.com/My-Custom-Plugin.jar'
```

When installing, the entire Bukfile is evaluated as ruby code. This means that you can do just about anything with it. For instance, if you wanted to conditionally install spigot if the file `spigot.yml` exists, you could do

if File.exist? 'spigot.yml'
server 'spigot', jenkins: 'http://ci.md-5.net'
else
server 'craftbukkit'
end
```ruby
if File.exist? 'spigot.yml'
server 'spigot', jenkins: 'http://ci.md-5.net'
else
server 'craftbukkit'
end
```

Just make sure that you read and trust it any Bukfile you download before running `bukin install`.

0 comments on commit 2026f28

Please sign in to comment.