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

Setting Up Environment

Adam Michael edited this page Aug 28, 2015 · 1 revision

Setting Up Environment

This guide assumes that you have a Windows 8+ computer and little to no knowledge of Ruby, Hyper-V, Linux or Git. It will walk you through setting up an Ubuntu VM in Hyper-V, checking out the code, running tests, running samples and making changes.

Note that there are many ways to set up a Ruby dev environment and this is just one of them. If you think you know better than this guide, you probably do.

Setting up your VM

  1. Download ubuntu-14.04.3-desktop-amd64.iso from http://releases.ubuntu.com/14.04/.
  2. Open up Hyper-V Manager.
  3. In the Actions tab, select Virtual Switch Manager. Create a new External Virtual Switch. Ensure that the checkbox for 'Allow management operating system to share this network adapter' is enabled.
  4. In the Actions tab, select New > Virtual Machine and go through the set up wizard. Select Generation 1 instead of Generation 2. Install the OS from the Ubuntu ISO. Everything else is up to you.
  5. Start up the VM and go through the OS installation process. You will need to restart it when it finishes.

Installing Ruby

Ubuntu does not ship with Ruby. There are many ways to install Ruby, but my personal favorite is through Ruby Version Manager (rvm) which allows you to easily switch between versions.

The following instructions are taken from https://rvm.io/rvm/install.

  1. Install the developer's public key.

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

  2. Install RVM.

    curl -sSL https://get.rvm.io | bash

  3. Refresh your terminal (either open a new one or use the following command to reload the profile):

    source ~/.bash_profile

  4. Confirm that rvm is installed.

    rvm -v

  5. Install your choice of Ruby versions.

    rvm install 2.2.3

  6. Set the default Ruby version to use for new windows.

    rvm --default use 2.2.3

  7. Confirm that Ruby was installed.

    ruby -v

  8. Install Bundler. Bundler is a tool for managing Gem versions in projects.

    gem install bundle

  9. Install some Ruby dev tool native headers.

    sudo apt-get install libgmp-dev

Cloning the repo

  1. Install git.

    sudo apt-get install git

  2. Clone the repo.

    git clone https://github.com/AzureAD/omniauth-azure-activedirectory-priv.git

Run the unit tests

  1. cd omniauth-azure-activedirectory-priv

  2. Bundle the dependencies.

    bundle

  3. Run the tests.

    bundle exec rake spec

  4. View the code coverage results by navigating a web browser to file:///home/adam/omniauth-azure-activedirectory-priv/coverage/index.html.

  5. Run the linter.

    bundle exec rake rubocop

Congrats, if all went well you should be ready to develop.

Clone this wiki locally