From 99b03e299489cbf8af33d70ce81918584bbd0571 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 28 Oct 2014 21:57:59 -0700 Subject: [PATCH] Initial commit of vmfloaty --- .gitignore | 6 +++--- Gemfile | 5 +++++ LICENSE | 15 +++++++++++++++ bin/floaty | 4 ++++ lib/vmfloaty.rb | 1 + lib/vmfloaty/cli.rb | 25 +++++++++++++++++++++++++ lib/vmfloaty/version.rb | 5 +++++ spec/spec_helper.rb | 1 + vmfloaty.gemspec | 17 +++++++++++++++++ 9 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 Gemfile create mode 100644 LICENSE create mode 100755 bin/floaty create mode 100644 lib/vmfloaty.rb create mode 100644 lib/vmfloaty/cli.rb create mode 100644 lib/vmfloaty/version.rb create mode 100644 spec/spec_helper.rb create mode 100644 vmfloaty.gemspec diff --git a/.gitignore b/.gitignore index f2c1360..f211644 100644 --- a/.gitignore +++ b/.gitignore @@ -26,9 +26,9 @@ build/ # for a library or gem, you might want to ignore these files since the code is # intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset +Gemfile.lock +.ruby-version +.ruby-gemset # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: .rvmrc diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..6c10f3a --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source 'https://rubygems.org' + +gem 'thor' + +gemspec diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..698cf4f --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ + vmpooler + + Copyright (C) 2014 Puppet Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bin/floaty b/bin/floaty new file mode 100755 index 0000000..795638b --- /dev/null +++ b/bin/floaty @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__)) + +require 'vmfloaty/cli' diff --git a/lib/vmfloaty.rb b/lib/vmfloaty.rb new file mode 100644 index 0000000..2db041a --- /dev/null +++ b/lib/vmfloaty.rb @@ -0,0 +1 @@ +require 'vmfloaty/cli' diff --git a/lib/vmfloaty/cli.rb b/lib/vmfloaty/cli.rb new file mode 100644 index 0000000..52b4497 --- /dev/null +++ b/lib/vmfloaty/cli.rb @@ -0,0 +1,25 @@ +require 'thor' + +class CLI < Thor + desc "get", "Gets a vm" + def get + say 'Get a vm here' + end + + desc "modify", "Modify a vm" + def modify + say 'Modify a vm' + end + + desc "list", "List all active vms" + def list + say 'Listing your vms' + end + + desc "release", "Schedules a vm for deletion" + def release + say 'Releases a vm' + end +end + +CLI.start(ARGV) diff --git a/lib/vmfloaty/version.rb b/lib/vmfloaty/version.rb new file mode 100644 index 0000000..7da0994 --- /dev/null +++ b/lib/vmfloaty/version.rb @@ -0,0 +1,5 @@ +module Vmfloaty + module CLI + VERSION = '0.1.0' + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..4784b01 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'vmfloaty' diff --git a/vmfloaty.gemspec b/vmfloaty.gemspec new file mode 100644 index 0000000..f20500b --- /dev/null +++ b/vmfloaty.gemspec @@ -0,0 +1,17 @@ +require File.expand_path '../lib/vmfloaty/version', __FILE__ + +Gem::Specification.new do |s| + s.name = 'vmfloaty' + s.version = Vmfloaty::CLI::VERSION.dup + s.authors = ['Brian Cain'] + s.email = ['brian.cain@puppetlabs.com'] + s.license = 'Apache' + s.homepage = 'https://github.com/briancain/vmfloaty' + s.description = 'A helper tool for vmpooler to help you stay afloat' + s.summary = 'CLI application to interface with vmpooler' + s.executables = ['floaty'] + s.files = Dir['LICENSE', 'README.md', 'lib/**/*'] + s.test_files = Dir['spec/**/*'] + s.require_path = 'lib' + s.add_dependency 'thor', '~> 0.19' +end