cisco_abbrev 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODhkNTU4N2YyYmQ4YTQ1YjA5OWNiOTRmZjllYmM1NGY4ZDMxOTZlMA==
5
+ data.tar.gz: !binary |-
6
+ Nzk2N2UxODAzNGE5M2E2ZTIwYmY2ZjFlNzVlMDE5YzE3ZjA0OTc0OQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZTZkYTJiODJiNGE1OWQ3ZDYzZjMwNmY5Mjg5N2VhZWU4YmQwZjUwZTRiOTEx
10
+ NjE2ZmJjMzIxOTE1NzRlNmMyMWZjMDA0MmUwZjIyYjgwYmFlNTI1MzBhODA1
11
+ YzliNzI2NjU2YjRmYjZkMzcyZjU4ZDg4NDhhMjFkNmYwODkxNjg=
12
+ data.tar.gz: !binary |-
13
+ MjNmMGFhMDgxYTNmYTUxYWU4Njk0YTgxYWQ4MzI4MTNjODk3M2M1MWU1NDFh
14
+ Yzc5NzlkNmU1NWZlMzQxNzBjMzZhMjM1YWRlODI2ZTM0NjZhODA5YTMzZDVi
15
+ ODVmZmI2OGM0MDA5MGQyMTgxOTliNTNlMTJiZGQyM2Q5M2JjNWQ=
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cisco_abbrev.gemspec
4
+ gemspec
@@ -0,0 +1,44 @@
1
+
2
+ [![Gem Version](https://badge.fury.io/rb/cisco_abbrev.svg)](https://badge.fury.io/rb/cisco_abbrev)
3
+ [![Build Status](https://travis-ci.org/oystersauce8/cisco_abbrev.svg?branch=master)](https://travis-ci.org/oystersauce8/check_tfn)
4
+ [![Dependency Status](https://gemnasium.com/badges/github.com/oystersauce8/cisco_abbrev.svg)](https://gemnasium.com/github.com/oystersauce8/cisco_abbrev)
5
+ [![Code Climate](https://codeclimate.com/github/oystersauce8/cisco_abbrev/badges/gpa.svg)](https://codeclimate.com/github/oystersauce8/cisco_abbrev)
6
+ [![Coverage Status](https://coveralls.io/repos/github/oystersauce8/cisco_abbrev/badge.svg?branch=master)](https://coveralls.io/github/oystersauce8/cisco_abbrev?branch=master)
7
+
8
+
9
+ # CiscoAbbrev
10
+
11
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cisco_abbrev`. To experiment with that code, run `bin/console` for an interactive prompt.
12
+
13
+ TODO: Delete this and the text above, and describe your gem
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'cisco_abbrev'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install cisco_abbrev
30
+
31
+ ## Usage
32
+
33
+ TODO: Write usage instructions here
34
+
35
+ ## Development
36
+
37
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+
39
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+
41
+ ## Contributing
42
+
43
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cisco_abbrev.
44
+
@@ -0,0 +1,7 @@
1
+ require 'rspec/core/rake_task'
2
+ require 'bundler/gem_tasks'
3
+
4
+ # Default directory to look within is `/specs`
5
+ RSpec::Core::RakeTask.new(:spec)
6
+
7
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cisco_abbrev"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cisco_abbrev/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cisco_abbrev"
8
+ spec.version = CiscoAbbrev::VERSION
9
+ spec.authors = ["Sam Weerasinghe"]
10
+ spec.email = ["oystersauce8@gmail.com"]
11
+
12
+ spec.summary = %q{Translate to/from Cisco Interface Abbreviations}
13
+ spec.description = %q{This gem converts between Cisco canonical interface names
14
+ (i.e. GigabitEthernet0/1) and the abbreviated forms often output by their
15
+ devices (i.e. Gi0/1).}
16
+ spec.homepage = "http://github.com/oystersauce8/cisco_abbrev"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.10"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "coveralls"
27
+ end
@@ -0,0 +1,47 @@
1
+ require "cisco_abbrev/version"
2
+
3
+ module CiscoAbbrev
4
+
5
+ ABBREVS = {
6
+ 'Fa' => 'FastEthernet',
7
+ 'Gi' => 'GigabitEthernet',
8
+ 'Te' => 'TenGigabitEthernet',
9
+ 'Et' => 'Ethernet',
10
+ 'Eth' => 'Ethernet',
11
+ 'Vl' => 'Vlan',
12
+ 'FD' => 'Fddi',
13
+ 'PortCh' => 'Port-channel',
14
+ 'Po' => 'Port-channel',
15
+
16
+ 'Tu' => 'Tunnel',
17
+ 'Lo' => 'Loopback',
18
+ 'Vi' => 'Virtual-Access',
19
+ 'Vt' => 'Virtual-Template',
20
+ 'EO' => 'EOBC',
21
+
22
+ 'Se' => 'Serial',
23
+ 'PO' => 'POS',
24
+ 'PosCh' => 'Pos-channel',
25
+ 'Mu' => 'Multilink',
26
+ 'AT' => 'ATM',
27
+
28
+ 'Async' => 'Async',
29
+ 'Group-Async' => 'Group-Async',
30
+ 'MFR' => 'MFR',
31
+ }
32
+
33
+ def self.encode(str)
34
+ ABBREVS.each_pair do |a,b|
35
+ str.sub!(b,a)
36
+ end
37
+ str
38
+ end
39
+
40
+ def self.decode(str)
41
+ ABBREVS.each_pair do |a,b|
42
+ ret_val = str.sub!(a,b)
43
+ break if ret_val
44
+ end
45
+ str
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ module CiscoAbbrev
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cisco_abbrev
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sam Weerasinghe
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: ! 'This gem converts between Cisco canonical interface names
70
+
71
+ (i.e. GigabitEthernet0/1) and the abbreviated forms often output by their
72
+
73
+ devices (i.e. Gi0/1).'
74
+ email:
75
+ - oystersauce8@gmail.com
76
+ executables: []
77
+ extensions: []
78
+ extra_rdoc_files: []
79
+ files:
80
+ - .coveralls.yml
81
+ - .gitignore
82
+ - .travis.yml
83
+ - Gemfile
84
+ - README.md
85
+ - Rakefile
86
+ - bin/console
87
+ - bin/setup
88
+ - cisco_abbrev.gemspec
89
+ - lib/cisco_abbrev.rb
90
+ - lib/cisco_abbrev/version.rb
91
+ homepage: http://github.com/oystersauce8/cisco_abbrev
92
+ licenses: []
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.4.8
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: Translate to/from Cisco Interface Abbreviations
114
+ test_files: []