haiju's 開発メモ

開発に必要な情報を自分用にメモ

Nimのパッケージマネージャnimbleの使い方

NimでWebアプリを開発するのに最低限、必要なライブラリ

としてWebフレームワークのjesterとテンプレートエンジンの

Nim-templatesをインストールするので、パッケージマネージャ

nimbleを使う。

[インストール]

1. github から clone

% git clone https://github.com/nim-lang/nimble

2. nimbleディレクトリに移動

% cd nimble

3. コンパイル

% nim c -r src/nimble install

4. PATHを設定(.zshrcも.bash_profileも多分同じ)

nimbleのバイナリをインストールするディレクトリを設定

% vim ~/.zshrc (または ~/.bash_profile)

export PATH="$HOME/.nimble/bin:PATH"

% source ~/.zshrc

[使い方]

(ex)アップデート

% nimble update

Downloading package list from https://.../packages.json

(ex)ライブラリを探す

% nimble search templates

templates:

   url:                https://github.com/onionhammer/nim-templates.git (git)

   tags:             web, html, template

   description:  A simple string templating library for Nimrod.

   license:         BSD

   website:        https://github.com/onionhammer/nim-templates

(ex)ライブラリをインストール --- パッケージ名を指定

% nimble install jester

(ex)ライブラリをインストール --- リポジトリの最新を指定

% nimble install templates@#head

(ex)ライブラリをインストール --- 特定のバージョンを範囲指定

% nimble install nimgame@"> 0.5%"

(ex)ライブラリをアンインストール

% nimble uninstall nimgame@0.5

 

[参考サイト]

github.com

How I Start.