-
Notifications
You must be signed in to change notification settings - Fork 103
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.
- Download ubuntu-14.04.3-desktop-amd64.iso from http://releases.ubuntu.com/14.04/.
- Open up Hyper-V Manager.
- 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.
- 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.
- Start up the VM and go through the OS installation process. You will need to restart it when it finishes.
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.
-
Install the developer's public key.
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
-
Install RVM.
curl -sSL https://get.rvm.io | bash
-
Refresh your terminal (either open a new one or use the following command to reload the profile):
source ~/.bash_profile
-
Confirm that rvm is installed.
rvm -v
-
Install your choice of Ruby versions.
rvm install 2.2.3
-
Set the default Ruby version to use for new windows.
rvm --default use 2.2.3
-
Confirm that Ruby was installed.
ruby -v
-
Install Bundler. Bundler is a tool for managing Gem versions in projects.
gem install bundle
-
Install some Ruby dev tool native headers.
sudo apt-get install libgmp-dev
-
Install git.
sudo apt-get install git
-
Clone the repo.
git clone https://github.com/AzureAD/omniauth-azure-activedirectory-priv.git
-
cd omniauth-azure-activedirectory-priv
-
Bundle the dependencies.
bundle
-
Run the tests.
bundle exec rake spec
-
View the code coverage results by navigating a web browser to
file:///home/adam/omniauth-azure-activedirectory-priv/coverage/index.html
. -
Run the linter.
bundle exec rake rubocop
Congrats, if all went well you should be ready to develop.