<commit_before># IRuby

[![Gem Version](https://badge.fury.io/rb/iruby.svg)](https://badge.fury.io/rb/iruby)
[![Build Status](https://travis-ci.org/SciRuby/iruby.svg?branch=master)](https://travis-ci.org/SciRuby/iruby)

IRuby is a Ruby kernel for [Jupyter project](http://try.jupyter.org/).

## Installation
How to set up [ZeroMQ](http://zeromq.org/) depends on your environment.
You can use one of the following libraries. 
* [CZTop](https://gitlab.com/paddor/cztop) and [CZMQ](https://github.com/zeromq/czmq) >= 4.0.0
* [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq) and [libzmq
](https://github.com/zeromq/libzmq) >= 3.2

### Ubuntu
Install Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 

#### Setup ZeroMQ on Ubuntu 16.04
CZTop requires CZMQ >= 4.0.0 and ZMQ >= 4.2.0. The official packages for Ubuntu 16.04 don't satisfy these version requrements, so you need to install from source.

```shell
sudo apt install libtool libffi-dev ruby ruby-dev make
sudo apt install git libzmq-dev autoconf pkg-config
git clone https://github.com/zeromq/czmq
cd czmq
./autogen.sh && ./configure && sudo make && sudo make install
```

#### Setup ZeroMQ on Ubuntu 17.04 to 18.10
Use official packages.

```shell
sudo apt install libtool libffi-dev ruby ruby-dev make
sudo apt install libzmq3-dev libczmq-dev
```

#### Install CZTop and IRuby
```shell
gem install cztop
gem install iruby --pre
iruby register --force
```

### Windows
Install git and Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 
[DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.

```shell
gem install cztop
gem install iruby --pre
iruby register --force
```

### macOS
Install ruby with rbenv or rvm.
Install Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 

#### Homebrew
```shell
brew install automake gmp libtool wget
brew install zeromq --HEAD
brew install czmq --HEAD
```

Setup environment variables. 
```
export LIBZMQ_PATH=$(brew --prefix zeromq)/lib
export LIBCZMQ_PATH=$(brew --prefix czmq)/lib
```

```shell
gem install cztop
# gem install ffi-rzmq
gem install iruby --pre
iruby register --force
```

#### MacPorts
```shell
port install libtool autoconf automake autogen
gem install ffi-rzmq
gem install iruby
```

### FreeBSD
At first install IPython/Jupyter. 
There is a pyzmq ports (ports/net/py-pyzmq) which depends on libzmq4, however, it doesn't works with ipython.
Therefore we use libzmq3 like the following:

1. make your ports tree up-to-date.
2. replace LIBDEPENDS line in ports/net/py-pyzmq/Makefile

```shell
LIB_DEPENDS=    libzmq.so:${PORTSDIR}/net/libzmq4
```
with
```shell
LIB_DEPENDS=    libzmq.so:${PORTSDIR}/net/libzmq3
```
3. install related packages<commit_msg>update installation in REAMDE<commit_after># IRuby

[![Gem Version](https://badge.fury.io/rb/iruby.svg)](https://badge.fury.io/rb/iruby)
[![Build Status](https://travis-ci.org/SciRuby/iruby.svg?branch=master)](https://travis-ci.org/SciRuby/iruby)

IRuby is a Ruby kernel for [Jupyter project](http://try.jupyter.org/).

## Installation
How to set up [ZeroMQ](http://zeromq.org/) depends on your environment.
You can use one of the following libraries. 
* [CZTop](https://gitlab.com/paddor/cztop) and [CZMQ](https://github.com/zeromq/czmq) >= 4.0.0
* [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq) and [libzmq
](https://github.com/zeromq/libzmq) >= 3.2

### Ubuntu
Install Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 

#### Setup ZeroMQ on Ubuntu 16.04
CZTop requires CZMQ >= 4.0.0 and ZMQ >= 4.2.0. The official packages for Ubuntu 16.04 don't satisfy these version requrements, so you need to install from source.

```shell
sudo apt install libtool libffi-dev ruby ruby-dev make
sudo apt install git libzmq-dev autoconf pkg-config
git clone https://github.com/zeromq/czmq
cd czmq
./autogen.sh && ./configure && sudo make && sudo make install
```

#### Setup ZeroMQ on Ubuntu 17.04 to 18.10
Use official packages.

```shell
sudo apt install libtool libffi-dev ruby ruby-dev make
sudo apt install libzmq3-dev libczmq-dev
```

#### Install CZTop and IRuby
```shell
gem install cztop
gem install iruby --pre
iruby register --force
```

### Windows
Install git and Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 
[DevKit](https://rubyinstaller.org/add-ons/devkit.html) is necessary for building RubyGems with native C-based extensions.

Install ZeroMQ. 
```shell
pacman -S mingw64/mingw-w64-x86_64-zeromq
```

```shell
gem install ffi-rzmq
gem install iruby --pre
iruby register --force
```

### macOS
Install ruby with rbenv or rvm.
Install Jupyter with [Anaconda](https://www.anaconda.com/) (recommended). 

#### Homebrew
```shell
brew install automake gmp libtool wget
brew install zeromq --HEAD
brew install czmq --HEAD
```

```shell
# export LIBZMQ_PATH=$(brew --prefix zeromq)/lib
# export LIBCZMQ_PATH=$(brew --prefix czmq)/lib
# gem install cztop
gem install ffi-rzmq
gem install iruby --pre
iruby register --force
```

#### MacPorts
```shell
port install libtool autoconf automake autogen
gem install ffi-rzmq
gem install iruby
```

### FreeBSD
At first install IPython/Jupyter. 
There is a pyzmq ports (ports/net/py-pyzmq) which depends on libzmq4, however, it doesn't works with ipython.
Therefore we use libzmq3 like the following:

1. make your ports tree up-to-date.
2. replace LIBDEPENDS line in ports/net/py-pyzmq/Makefile

```shell
LIB_DEPENDS=    libzmq.so:${PORTSDIR}/net/libzmq4
```
with
```shell
LIB_DEPENDS=    libzmq.so:${PORTSDIR}/net/libzmq3
```
3. install related packages
{'fraction_non_alphanumeric': 0.13983276996975627, 'fraction_numerical': 0.01387653442447963, 'mean_word_length': 4.344106463878327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 26, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4761195', 'n_tokens_mistral': 2182, 'n_tokens_neox': 2006, 'n_words': 587}