Repository is archived
No commit activity in last 3 years
No release in over 3 years
Gem for parsing racktables-style vlan configuration of ports.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
>= 0
>= 0
 Project Readme

Build Status Code Climate Test Coverage

RackTables::VLANParse

Gem for parsing racktables-style vlan configuration of ports.

Installation

Add this line to your application's Gemfile:

gem 'racktables-vlanparse'

And then execute:

$ bundle

Or install it yourself as:

$ gem install racktables-vlanparse

Usage

2.1.2 :001 > require 'racktables/vlanparse'
 => true
2.1.2 :003 > puts RackTables::VLAN.parse("100")
{:native=>"100", :allowed=>["100"], :type=>:access}
 => nil
2.1.2 :004 > puts RackTables::VLAN.parse("T")
{:native=>nil, :allowed=>[], :type=>:trunk}
 => nil
2.1.2 :005 > puts RackTables::VLAN.parse("T+200")
{:native=>nil, :allowed=>["200"], :type=>:trunk}
 => nil
2.1.2 :006 > puts RackTables::VLAN.parse("A100")
{:native=>"100", :allowed=>["100"], :type=>:access}
 => nil
2.1.2 :007 > puts RackTables::VLAN.parse("T100")
{:native=>"100", :allowed=>["100"], :type=>:trunk}
 => nil
2.1.2 :008 > puts RackTables::VLAN.parse("T100+200")
{:native=>"100", :allowed=>["100", "200"], :type=>:trunk}
 => nil
2.1.2 :009 > puts RackTables::VLAN.parse("T100+200+300")
{:native=>"100", :allowed=>["100", "200", "300"], :type=>:trunk}
 => nil

Contributing

  1. Fork it ( https://github.com/iavael/racktables-vlanparse/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request