Skip to content

Commit

Permalink
Initial provider extraction from fog/fog
Browse files Browse the repository at this point in the history
  • Loading branch information
J.R. Garcia committed Oct 29, 2015
0 parents commit 561017e
Show file tree
Hide file tree
Showing 109 changed files with 5,015 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
*.bundle
*.so
*.o
*.a
mkmf.log
gemfiles/*.lock
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
language: ruby
sudo: false
script: bundle exec rake test
matrix:
fast_finish: true
include:
- rvm: 1.8.7
gemfile: gemfiles/Gemfile.1.9.2-
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.1.9.2+
- rvm: 2.0.0
gemfile: Gemfile
- rvm: 2.1.0
gemfile: Gemfile
- rvm: 2.1.1
gemfile: Gemfile
- rvm: 2.2.0
gemfile: Gemfile
- rvm: jruby-18mode
gemfile: gemfiles/Gemfile.1.9.2-
- rvm: jruby-19mode
gemfile: gemfiles/Gemfile.1.9.2+
- rvm: jruby-head
gemfile: Gemfile
allow_failures:
- rvm: jruby-head
notifications:
email: false
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Getting Involved

New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.

### Coding

* Pick a task:
* Offer feedback on open [pull requests](https://github.com/fog/fog-vsphere/pulls).
* Review open [issues](https://github.com/fog/fog-vsphere/issues) for things to help on.
* [Create an issue](https://github.com/fog/fog-vsphere/issues/new) to start a discussion on additions or features.
* Fork the project, add your changes and tests to cover them in a topic branch.
* Commit your changes and rebase against `fog/fog-vsphere` to ensure everything is up to date.
* [Submit a pull request](https://github.com/fog/fog-vsphere/compare/)

### Non-Coding

* Offer feedback on open [issues](https://github.com/fog/fog-vsphere/issues).
* Organize or volunteer at events.
57 changes: 57 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
* Ahmed Elsabbahy <[email protected]>
* Alan Sebastian <[email protected]>
* Carl Caum <[email protected]>
* Carlos Sanchez <[email protected]>
* Chris Thompson <[email protected]>
* Chris Thompson <[email protected]>
* Cyrus Team <[email protected]>
* Darren Foo <[email protected]>
* Dominic Cleal <[email protected]>
* Eric Stonfer <[email protected]>
* Ewoud Kohl van Wijngaarden <[email protected]>
* Francois Herbert <[email protected]>
* Francois Herbert <[email protected]>
* Ivan Nečas <[email protected]>
* James Herdman <[email protected]>
* Jeff McCune <[email protected]>
* Justin Clayton <[email protected]>
* Justin Pratt <[email protected]>
* Justin Pratt <[email protected]>
* Karan Misra <[email protected]>
* Kelsey Hightower <[email protected]>
* Kevin Menard <[email protected]>
* Kevin Menard <[email protected]>
* Lance Ivy <[email protected]>
* Lukas Zapletal <[email protected]>
* Marc Grimme <[email protected]>
* Marc Grimme <[email protected]>
* Martin Matuska <[email protected]>
* Matt Darby <[email protected]>
* Matthew Black <[email protected]>
* Matthew Black <[email protected]>
* Michael Moll <[email protected]>
* Mick Pollard <[email protected]>
* Ming Jin <[email protected]>
* Nick Huanca <[email protected]>
* Nick Huanca <[email protected]>
* Nick Huanuca <[email protected]>
* Ohad Levy <[email protected]>
* Ohad Levy <[email protected]>
* Oscar Elfving <[email protected]>
* Paul Thornthwaite <[email protected]>
* Paul Thornthwaite <[email protected]>
* Rich Lane <[email protected]>
* Samuel Keeley <[email protected]>
* Shlomi Zadok <[email protected]>
* Simon Josi <[email protected]>
* Tejas Ravindra Mandke <[email protected]>
* Timur Alperovich <[email protected]>
* Wesley Beary <[email protected]>
* Wesley Beary <[email protected]>
* Xavier Fontrodona <[email protected]>
* alan <[email protected]>
* endzyme <[email protected]>
* geemus <[email protected]>
* karmab <[email protected]>
* slivik <[email protected]>
* tipt0e <[email protected]>
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in fog-vsphere.gemspec
gemspec
20 changes: 20 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2014-2015 [CONTRIBUTORS.md](CONTRIBUTORS.md)

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Fog::Vsphere

[![Gem Version](https://badge.fury.io/rb/fog-vsphere.svg)](http://badge.fury.io/rb/fog-vsphere) [![Build Status](https://travis-ci.org/fog/fog-vsphere.svg?branch=master)](https://travis-ci.org/fog/fog-vsphere) [![Dependency Status](https://gemnasium.com/fog/fog-vsphere.svg)](https://gemnasium.com/fog/fog-vsphere) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-vsphere.svg)](https://coveralls.io/r/fog/fog-vsphere) [![Code Climate](https://codeclimate.com/github/fog/fog-vsphere.png)](https://codeclimate.com/github/fog/fog-vsphere) [![Stories in Ready](https://badge.waffle.io/fog/fog-vsphere.png?label=ready&title=Ready)](https://waffle.io/fog/fog-vsphere)

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

gem 'fog-vsphere'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fog-vsphere

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( https://github.com/fog/fog-vsphere/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
15 changes: 15 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'bundler/gem_tasks'
# require 'rake/testtask'

# Rake::TestTask.new do |t|
# t.libs << 'spec/'
# t.test_files = Rake::FileList['spec/**/*_spec.rb']
# t.verbose = true
# end

mock = ENV['FOG_MOCK'] || 'true'
task :test do
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end

task(:default => [:test])
30 changes: 30 additions & 0 deletions fog-vsphere.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fog/vsphere/version'

Gem::Specification.new do |spec|
spec.name = 'fog-vsphere'
spec.version = Fog::Vsphere::VERSION
spec.authors = ['J.R. Garcia']
spec.email = ['[email protected]']

spec.summary = "Module for the 'fog' gem to support VMware vSphere."
spec.description = 'This library can be used as a module for `fog` or as standalone provider to use the XENSERVER in applications.'
spec.homepage = 'https://github.com/fog/fog-vsphere'
spec.license = 'MIT'

spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(%r{^tests\/})

spec.require_paths = ['lib']

spec.add_runtime_dependency 'fog-core', '~> 1.32'
spec.add_runtime_dependency 'rbvmomi', '~> 1.8'

spec.add_development_dependency 'bundler', '~> 1.10'
spec.add_development_dependency 'pry', '~> 0.10'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rubocop', '~> 0.34'
spec.add_development_dependency 'shindo', '~> 0.3'
end
6 changes: 6 additions & 0 deletions gemfiles/Gemfile.1.9.2+
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'net-ssh', '~> 2.9'
gem 'rubocop', '~> 0.34'

gemspec :path => '..'
10 changes: 10 additions & 0 deletions gemfiles/Gemfile.1.9.2-
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source 'https://rubygems.org'

gem 'mime-types', '~> 1.25'
gem 'net-ssh', '~> 2.9'
gem 'nokogiri', '~> 1.5.11'
gem 'rainbow', '~> 1.99'
gem 'rest-client', '~> 1.6.8'
gem 'rubocop', '~> 0.5.0'

gemspec :path => '..'
40 changes: 40 additions & 0 deletions lib/fog/vsphere.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
require 'fog/core'
require 'fog/vsphere/compute'

module Fog
module Vsphere
extend Fog::Provider

module Errors
class ServiceError < Fog::Errors::Error; end
class SecurityError < ServiceError; end
class NotFound < ServiceError; end
end

service(:compute, 'Compute')

# This helper was originally added as Fog.class_as_string and moved to core but only used here
def self.class_from_string classname, defaultpath=""
if classname and classname.is_a? String then
chain = classname.split("::")
klass = Kernel
chain.each do |klass_string|
klass = klass.const_get klass_string
end
if klass.is_a? Class then
klass
elsif defaultpath != nil then
class_from_string((defaultpath.split("::")+chain).join("::"), nil)
else
nil
end
elsif classname and classname.is_a? Class then
classname
else
nil
end
rescue NameError
defaultpath != nil ? class_from_string((defaultpath.split("::")+chain).join("::"), nil) : nil
end
end
end
Loading

0 comments on commit 561017e

Please sign in to comment.