Commit c32a87c8 authored by Praveen Arimbrathodiyil's avatar Praveen Arimbrathodiyil
Browse files

Imported Upstream version 1.21.1+gh

parent d565e1d9
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
.#*
\ No newline at end of file
language: ruby
gemfile:
- Gemfile
- Gemfile.1.8.7
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
- jruby-18mode
- jruby-19mode
- jruby-head
script: bundle exec rake travis
matrix:
include:
- rvm: 2.1.0
gemfile: Gemfile
env: COVERAGE=true
exclude:
- rvm: 1.8.7
gemfile: Gemfile
- rvm: 1.9.2
gemfile: Gemfile.1.8.7
- rvm: 1.9.3
gemfile: Gemfile.1.8.7
- rvm: 2.0.0
gemfile: Gemfile.1.8.7
- rvm: 2.1.0
gemfile: Gemfile.1.8.7
- rvm: jruby-18mode
gemfile: Gemfile
- rvm: jruby-19mode
gemfile: Gemfile.1.8.7
- rvm: jruby-head
gemfile: Gemfile.1.8.7
allow_failures:
- rvm: jruby-head
notifications:
email: false
irc:
channels:
- "irc.freenode.org#ruby-fog"
template:
- "[#%{build_number}] %{message} %{build_url}"
- "[#%{build_number}] %{commit} on %{branch} by %{author}"
- "[#%{build_number}] %{compare_url}"
on_success: always
on_failure: always
use_notice: false
before_install:
- gem update --system # todo: workaround for https://github.com/rubygems/rubygems/pull/763
## 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-core/pulls).
* Review open [issues](https://github.com/fog/fog-core/issues) for things to help on.
* [Create an issue](https://github.com/fog/fog-core/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-core` to ensure everything is up to date.
* [Submit a pull request](https://github.com/fog/fog-core/compare/)
### Non-Coding
* Offer feedback on open [issues](https://github.com/fog/fog-core/issues).
* Write and help edit [documentation](https://github.com/fog/fog.github.com).
* Translate [documentation](https://github.com/fog/fog.github.com) in to other languages.
* Organize or volunteer at events.
* [Donate](https://www.gittip.com/geemus/)
* Discuss other ideas for contribution with [geemus](mailto:geemus+fog@gmail.com).
* Evan Light <evan@tripledogdare.net>
* Paul Thornthwaite <tokengeek@gmail.com>
* Wesley Beary <geemus+github@gmail.com>
* geemus <geemus@gmail.com>
\ No newline at end of file
source 'https://rubygems.org'
# Specify your gem's dependencies in fog-core.gemspec
gemspec
source "https://rubygems.org"
gem 'nokogiri', '~>1.5.11'
gem 'mime-types', '~>1.16'
group :development, :test do
# This is here because gemspec doesn't support require: false
gem 'coveralls', :require => false
end
gemspec
The MIT License (MIT)
Copyright (c) 2014 [CONTRIBUTORS.md](https://github.com/fog/fog/blob/master/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.
# Fog::Core
Shared classes and tests for fog providers and services.
[![Build Status](https://secure.travis-ci.org/fog/fog-core.png?branch=master)](http://travis-ci.org/fog/fog-core)
## Installation
Add this line to your application's Gemfile:
gem 'fog-core'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fog-core
## Usage
TODO: Write usage instructions here
## Contributing
1. Fork it ( http://github.com/<my-github-username>/fog-core/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 new Pull Request
require 'bundler/setup'
task :travis => ['test:travis', 'coveralls_push_workaround']
require "tasks/test_task"
Fog::Rake::TestTask.new
namespace :test do
mock = 'true' || ENV['FOG_MOCK']
task :travis do
# jruby coveralls causes an OOM in travis
ENV['COVERAGE'] = 'false' if RUBY_PLATFORM == 'java'
sh("export FOG_MOCK=#{mock} && bundle exec shindont")
end
end
#require "tasks/changelog_task"
#Fog::Rake::ChangelogTask.new
task :coveralls_push_workaround do
use_coveralls = (Gem::Version.new(RUBY_VERSION) > Gem::Version.new('1.9.2'))
if (ENV['COVERAGE'] != 'false') && use_coveralls
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task["coveralls:push"].invoke
end
end
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fog/version'
Gem::Specification.new do |spec|
spec.name = "fog-core"
spec.version = Fog::VERSION
spec.authors = ["Evan Light", "Wesley Beary"]
spec.email = ["evan@tripledogdare.net", "geemus@gmail.com"]
spec.summary = %q{Shared classes and tests for fog providers and services.}
spec.description = %q{Shared classes and tests for fog providers and services.}
spec.homepage = ""
spec.license = "MIT"
spec.files = Dir.glob(File.join("lib", "**", "*.rb"))
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.add_dependency('builder')
spec.add_dependency('excon', '~>0.32')
spec.add_dependency('formatador', '~>0.2.0')
spec.add_dependency('mime-types')
spec.add_dependency('net-scp', '~>1.1')
spec.add_dependency('net-ssh', '>=2.1.3')
## List your development dependencies here. Development dependencies are
## those that are only needed during development
spec.add_development_dependency('rake')
spec.add_development_dependency('yard')
spec.add_development_dependency('thor')
spec.add_development_dependency('shindo', '~>0.3.4')
spec.add_development_dependency('pry')
spec.add_development_dependency('coveralls')
end
--- !ruby/object:Gem::Specification
name: fog-core
version: !ruby/object:Gem::Version
version: 1.21.1
platform: ruby
authors:
- Evan Light
- Wesley Beary
autorequire:
bindir: bin
cert_chain: []
date: 2014-03-14 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: builder
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: excon
requirement: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: '0.32'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: '0.32'
- !ruby/object:Gem::Dependency
name: formatador
requirement: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: 0.2.0
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: 0.2.0
- !ruby/object:Gem::Dependency
name: mime-types
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: net-scp
requirement: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: '1.1'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: '1.1'
- !ruby/object:Gem::Dependency
name: net-ssh
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 2.1.3
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: 2.1.3
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: yard
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: thor
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: shindo
requirement: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: 0.3.4
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ~>
- !ruby/object:Gem::Version
version: 0.3.4
- !ruby/object:Gem::Dependency
name: pry
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
name: coveralls
requirement: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
description: Shared classes and tests for fog providers and services.
email:
- evan@tripledogdare.net
- geemus@gmail.com
executables: []
extensions: []
extra_rdoc_files: []
files:
- lib/fog/account.rb
- lib/fog/billing.rb
- lib/fog/cdn.rb
- lib/fog/compute.rb
- lib/fog/compute/models/server.rb
- lib/fog/core.rb
- lib/fog/core/attributes.rb
- lib/fog/core/class_from_string.rb
- lib/fog/core/collection.rb
- lib/fog/core/connection.rb
- lib/fog/core/credentials.rb
- lib/fog/core/current_machine.rb
- lib/fog/core/deprecated_connection_accessors.rb
- lib/fog/core/deprecation.rb
- lib/fog/core/errors.rb
- lib/fog/core/hmac.rb
- lib/fog/core/logger.rb
- lib/fog/core/mock.rb
- lib/fog/core/model.rb
- lib/fog/core/provider.rb
- lib/fog/core/scp.rb
- lib/fog/core/service.rb
- lib/fog/core/ssh.rb
- lib/fog/core/time.rb
- lib/fog/core/uuid.rb
- lib/fog/core/wait_for.rb
- lib/fog/core/wait_for_defaults.rb
- lib/fog/dns.rb
- lib/fog/identity.rb
- lib/fog/image.rb
- lib/fog/metering.rb
- lib/fog/monitoring.rb
- lib/fog/network.rb
- lib/fog/orchestration.rb
- lib/fog/schema/data_validator.rb
- lib/fog/storage.rb
- lib/fog/support.rb
- lib/fog/test_helpers.rb
- lib/fog/test_helpers/collection_helper.rb
- lib/fog/test_helpers/compute/flavors_helper.rb
- lib/fog/test_helpers/compute/server_helper.rb
- lib/fog/test_helpers/compute/servers_helper.rb
- lib/fog/test_helpers/formats_helper.rb
- lib/fog/test_helpers/helper.rb
- lib/fog/test_helpers/mock_helper.rb
- lib/fog/test_helpers/model_helper.rb
- lib/fog/test_helpers/responds_to_helper.rb
- lib/fog/test_helpers/succeeds_helper.rb
- lib/fog/version.rb
- lib/fog/volume.rb
- lib/fog/vpn.rb
- lib/tasks/test_task.rb
homepage: ''
licenses:
- MIT
metadata: {}
post_install_message:
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ! '>='
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project:
rubygems_version: 2.2.2
signing_key:
specification_version: 4
summary: Shared classes and tests for fog providers and services.
test_files: []
has_rdoc:
class FogAttributeTestModel < Fog::Model
attribute :key, :aliases => 'keys', :squash => "id"
attribute :time, :type => :time
attribute :bool, :type => :boolean
end
Shindo.tests('Fog::Attributes', 'core') do
@model = FogAttributeTestModel.new
tests('squash') do
tests('"keys" => {:id => "value"}').returns('value') do
@model.merge_attributes("keys" => {:id => "value"})
@model.key
end
tests('"keys" => {"id" => "value"}').returns('value') do
@model.merge_attributes("keys" => {'id' => "value"})
@model.key
end
tests('"keys" => {"id" => false}').returns(false) do
@model.merge_attributes("keys" => {'id' => false })
@model.key
end
tests('"keys" => {:id => false}').returns(false) do
@model.merge_attributes("keys" => {:id => false })
@model.key
end
end
tests(':type => :time') do
@time = Time.now
tests(':time => nil').returns(nil) do
@model.merge_attributes(:time => nil)
@model.time
end
tests(':time => ""').returns('') do
@model.merge_attributes(:time => '')
@model.time
end
tests(':time => "#{@time.to_s}"').returns(Time.parse(@time.to_s)) do
@model.merge_attributes(:time => @time.to_s)
@model.time
end
end
tests(':type => :boolean') do
tests(':bool => "true"').returns(true) do
@model.merge_attributes(:bool => 'true')
@model.bool
end
tests(':bool => true').returns(true) do
@model.merge_attributes(:bool => true)
@model.bool
end
tests(':bool => "false"').returns(false) do
@model.merge_attributes(:bool => 'false')
@model.bool
end
tests(':bool => false').returns(false) do
@model.merge_attributes(:bool => false)
@model.bool
end
tests(':bool => "foo"').returns(nil) do
@model.merge_attributes(:bool => "foo")
@model.bool
end
end
end
Shindo.tests('Fog::Core::Connection', ['core']) do
raises(ArgumentError, "raises ArgumentError when no arguments given") do
Fog::Core::Connection.new
end
tests('new("http://example.com")') do
@instance = Fog::Core::Connection.new("http://example.com")
responds_to([:request, :reset])
tests('user agent').returns("fog/#{Fog::VERSION}") do
@instance.instance_variable_get(:@excon).data[:headers]['User-Agent']
end
end
tests('new("http://example.com", true)') do
Fog::Core::Connection.new("http://example.com", true)
end
tests('new("http://example.com", false, options")') do
options = {
:debug_response => false
}
Fog::Core::Connection.new("http://example.com", true, options)
end
end
Shindo.tests do
before do
@old_home = ENV['HOME']
@old_rc = ENV['FOG_RC']
@old_credential = ENV['FOG_CREDENTIAL']