Commit ced1259c authored by Sudheeshshetty's avatar Sudheeshshetty
Browse files

Imported Upstream version 1.37.0

parent 1214a0ac
......@@ -2,15 +2,11 @@ language: ruby
gemfile:
- Gemfile
- Gemfile.1.8.7
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- jruby-18mode
- jruby-19mode
- 2.2.0
- jruby9k
- jruby-head
sudo: false
......@@ -22,26 +18,9 @@ matrix:
- 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
- rvm: jruby9k
notifications:
email: false
......
* Aaron Patterson <aaron.patterson@gmail.com>
* Akira Matsuda <ronnie@dio.jp>
* Anatol <anatol.pomozov@gmail.com>
* Artem <temikus@google.com>
* Artem Yakimenko <temikus@google.com>
* Brandon Dunne <bdunne@redhat.com>
* Bryan Paxton <starbelly@pobox.com>
* Chris Johnson <wchrisjohnson@gmail.com>
* Chris Sinjakli <chris@sinjakli.co.uk>
......@@ -21,10 +24,12 @@
* Matt Eldridge <matt.eldridge@us.ibm.com>
* Mike Hagedorn <mike@silverchairsolutions.com>
* Naoto TAKAHASHI <tnaoto@gmail.com>
* Patrick McAfee <PatrickMcAfee@users.noreply.github.com>
* Paul Thornthwaite <paul@brightbox.co.uk>
* Paul Thornthwaite <tokengeek@gmail.com>
* Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
* Peter Drake <peter.drake@acquia.com>
* Suraj Shirvankar <surajshirvankar@gmail.com>
* Wesley Beary <geemus+github@gmail.com>
* Wesley Beary <geemus@gmail.com>
* cristhiano <cristhiano_figueira@yahoo.com.br>
......
source "https://rubygems.org"
gem 'nokogiri', '~>1.5.11'
gem 'mime-types', '~>1.16'
gem 'rest-client', '~> 1.6.7'
group :development, :test do
gem 'rake', '~> 10.1.0'
# This is here because gemspec doesn't support require: false
gem 'coveralls', :require => false
end
gemspec
......@@ -4,6 +4,13 @@ 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)
## Ruby version
Fog-core requires Ruby `2.0.0` or later.
Ruby `1.8` and `1.9` support was dropped in `fog-v2.0.0` as a backwards incompatible
change. Please use the later fog `1.x` versions if you require `1.8.7` or `1.9.x` support.
## Installation
Add this line to your application's Gemfile:
......
1.37.0 03/31/2016
==========================================================
remove hp from providers
re-raise mime-type error, rather than exiting
fix tests
add introspection module
1.36.0 02/23/2016
==========================================================
default digitalocean to v2
fix eager/auto-loading
add cloud-at-cost
1.35.0 11/24/2015
==========================================================
make mime/types require optional
fix warnings about net-ssh vs net-cp
1.34.0 11/16/2015
==========================================================
make net/ssh and net/scp requires optional
1.33.0 11/15/2015
==========================================================
relax net/ssh and net/scp requirement
1.32.1 08/12/2015
==========================================================
......
......@@ -21,9 +21,6 @@ Gem::Specification.new do |spec|
spec.add_dependency("builder")
spec.add_dependency("excon", "~> 0.45")
spec.add_dependency("formatador", "~> 0.2")
spec.add_dependency("mime-types")
spec.add_dependency("net-scp", "~> 1.1")
spec.add_dependency("net-ssh", ">= 2.1.3")
spec.add_development_dependency("coveralls")
spec.add_development_dependency("minitest")
......
......@@ -10,17 +10,6 @@ module Fog
when :gogrid
require "fog/go_grid/compute"
Fog::Compute::GoGrid.new(attributes)
when :hp
version = attributes.delete(:version)
version = version.to_s.downcase.to_sym unless version.nil?
if version == :v2
require "fog/hp/compute_v2"
Fog::Compute::HPV2.new(attributes)
else
Fog::Logger.deprecation "HP Cloud Compute V1 service will be soon deprecated. Please use `:version => v2` attribute to use HP Cloud Compute V2 service."
require "fog/hp/compute"
Fog::Compute::HP.new(attributes)
end
when :new_servers
require "fog/bare_metal_cloud/compute"
Fog::Logger.deprecation "`new_servers` is deprecated. Please use `bare_metal_cloud` instead."
......@@ -42,12 +31,12 @@ module Fog
when :digitalocean
version = attributes.delete(:version)
version = version.to_s.downcase.to_sym unless version.nil?
if version == :v2
if version == :v1
error_message = "DigitalOcean V1 is deprecated.Please use `:version => :v2` attribute to use Next Gen Cloud Servers."
raise error_message
else
require "fog/digitalocean/compute_v2"
Fog::Compute::DigitalOceanV2.new(attributes)
else
require "fog/digitalocean/compute"
Fog::Compute::DigitalOcean.new(attributes)
end
when :stormondemand
require "fog/compute/storm_on_demand"
......@@ -58,6 +47,9 @@ module Fog
when :vclouddirector
require "fog/vcloud_director/compute"
Fog::Compute::VcloudDirector.new(attributes)
when :cloudatcost
require "fog/cloudatcost/compute"
Fog::Compute::CloudAtCost.new(attributes)
else
super(orig_attributes)
end
......
......@@ -65,7 +65,6 @@ module Fog
end
def scp(local_path, remote_path, upload_options = {})
require "net/scp"
requires :ssh_ip_address, :username
Fog::SCP.new(ssh_ip_address, username, ssh_options).upload(local_path, remote_path, upload_options)
......@@ -74,14 +73,12 @@ module Fog
alias_method :scp_upload, :scp
def scp_download(remote_path, local_path, download_options = {})
require "net/scp"
requires :ssh_ip_address, :username
Fog::SCP.new(ssh_ip_address, username, ssh_options).download(remote_path, local_path, download_options)
end
def ssh(commands, options = {}, &blk)
require "net/ssh"
requires :ssh_ip_address, :username
options = ssh_options.merge(options)
......
......@@ -61,6 +61,7 @@ require File.expand_path('../compute', __FILE__)
require File.expand_path('../dns', __FILE__)
require File.expand_path('../identity', __FILE__)
require File.expand_path('../image', __FILE__)
require File.expand_path('../introspection', __FILE__)
require File.expand_path('../metering', __FILE__)
require File.expand_path('../monitoring', __FILE__)
require File.expand_path('../network', __FILE__)
......
......@@ -91,10 +91,13 @@ module Fog
def self.reset
mocked_services = []
Fog.constants.map do |x|
next if Fog.autoload?(x)
x_const = Fog.const_get(x)
x_const.respond_to?(:constants) && x_const.constants.map do |y|
next if x_const.autoload?(y)
y_const = x_const.const_get(y)
y_const.respond_to?(:constants) && y_const.constants.map do |z|
next if y_const.autoload?(z)
mocked_services << y_const.const_get(z) if z.to_sym == :Mock
end
end
......
......@@ -40,7 +40,12 @@ module Fog
class Real
def initialize(address, username, options)
require "net/scp"
begin
require "net/scp"
rescue LoadError
Fog::Logger.warning("'net/scp' missing, please install and try again.")
exit(1)
end
key_manager = Net::SSH::Authentication::KeyManager.new(nil, options)
......
......@@ -34,7 +34,12 @@ module Fog
class Real
def initialize(address, username, options)
require "net/ssh"
begin
require "net/ssh"
rescue LoadError
Fog::Logger.warning("'net/ssh' missing, please install and try again.")
exit(1)
end
key_manager = Net::SSH::Authentication::KeyManager.new(nil, options)
......
module Fog
module Core
VERSION = "1.32.1"
VERSION = "1.37.0"
end
end
module Fog
module Introspection
extend Fog::ServicesMixin
end
end
begin
# Use mime/types/columnar if available, for reduced memory usage
require 'mime/types/columnar'
rescue LoadError
require 'mime/types'
end
module Fog
module Storage
extend Fog::ServicesMixin
def self.new(orig_attributes)
begin
# Use mime/types/columnar if available, for reduced memory usage
require 'mime/types/columnar'
rescue LoadError
begin
require 'mime/types'
rescue LoadError
Fog::Logger.warning("'mime-types' missing, please install and try again.")
raise
end
end
attributes = orig_attributes.dup # prevent delete from having side effects
case provider = attributes.delete(:provider).to_s.downcase.to_sym
when :internetarchive
......
......@@ -30,7 +30,7 @@ def collection_tests(collection, params = {}, mocks_implemented = true)
tests("Enumerable") do
pending if Fog.mocking? && !mocks_implemented
methods = %w(all any? find detect collect map find_index flat_map
methods = %w(all? any? find detect collect map find_index flat_map
collect_concat group_by none? one?)
# JRuby 1.7.5+ issue causes a SystemStackError: stack level too deep
......
......@@ -19,10 +19,12 @@ describe Fog::CurrentMachine do
describe "ip_address" do
it "should be thread safe" do
Excon.stub({ :method => :get, :path => "/" }, { :body => "" })
(1..10).map do
Thread.new { Fog::CurrentMachine.ip_address }
Thread.new do
Excon.stub({ :method => :get, :path => "/" }, { :body => "" })
Fog::CurrentMachine.ip_address
end
end.each(&:join)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment